Skip to content

fix(nix): keep runtime mode out of agent environment - #2697

Merged
boudra merged 1 commit into
getpaseo:mainfrom
shin-sakata:fix/nix-runtime-env
Jul 31, 2026
Merged

fix(nix): keep runtime mode out of agent environment#2697
boudra merged 1 commit into
getpaseo:mainfrom
shin-sakata:fix/nix-runtime-env

Conversation

@shin-sakata

@shin-sakata shin-sakata commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • set the packaged daemon runtime mode with PASEO_NODE_ENV instead of NODE_ENV
  • remove the duplicate runtime-mode assignment from the NixOS module
  • extend the daemon launch regression test to prevent either Nix path from reintroducing the leak

Why

The server already treats PASEO_NODE_ENV as Paseo-owned runtime control and scrubs it from external agent processes. The Nix wrapper and module still set NODE_ENV=production, so every agent and command launched by a NixOS Paseo service inherits production mode. This changes npm install behavior and can make test runners select production builds.

The package wrapper is the single owner of the packaged daemon's production mode. User-provided NODE_ENV remains pass-through as designed.

Validation

  • node packages/cli/tests/26-daemon-launch-supervision.test.ts
  • npm run build:server
  • npm run build:app-deps
  • npm run typecheck
  • npm run lint
  • nix build .#packages.x86_64-linux.default --no-link
  • built wrapper contains export PASEO_NODE_ENV='production' and no Paseo-owned NODE_ENV

Refs #2560

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR isolates Paseo’s packaged production runtime mode from agent environments.

  • Replaces the Nix server wrapper’s NODE_ENV assignment with PASEO_NODE_ENV.
  • Removes the duplicate runtime-mode assignment from the NixOS module.
  • Extends daemon-launch regression checks to cover both Nix configuration paths.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The NixOS service starts the changed package wrapper, the server consumes PASEO_NODE_ENV for its runtime mode, and external-process environment construction removes that Paseo-owned variable while preserving user-owned NODE_ENV.

Important Files Changed

Filename Overview
nix/package.nix Moves the packaged daemon’s production-mode setting to the Paseo-specific variable consumed by server configuration.
nix/module.nix Removes the redundant service-level NODE_ENV assignment while retaining the package wrapper as runtime-mode owner.
packages/cli/tests/26-daemon-launch-supervision.test.ts Adds regression assertions preventing either Nix source from restoring a module-owned NODE_ENV leak or duplicating PASEO_NODE_ENV.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Nix package wrapper] -->|PASEO_NODE_ENV=production| B[Daemon supervisor]
    B --> C[Daemon worker]
    C -->|runtime mode consumed| D[Paseo configuration]
    C -->|PASEO_NODE_ENV scrubbed| E[External agents and commands]
    F[User-provided NODE_ENV] -->|preserved| E
Loading

Reviews (1): Last reviewed commit: "fix(nix): keep runtime mode out of agent..." | Re-trigger Greptile

@boudra
boudra merged commit a54cb66 into getpaseo:main Jul 31, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants