feat(supervisor): single-declaration baseSpawnEnv for every agent CLI spawn - #588
Merged
Conversation
- Add base spawn environment utilities and version detection for agent adapters - Update ACP, Antigravity, CommandCode, Muse, and Factory adapter implementations - Improve runtime agent status service, status cache, and renderer status store - Update title, commit message, and PR summary generators alongside crossagent MCP execution - Add unit test coverage for session factories, spawn environment, and title generator - Update agent adapters documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces
baseSpawnEnvas the single declaration point for env that must ride every Poracode-made spawn of an agent CLI, replacing per-command-builderenvduplication. In practice this is for CLIs that fire a detached background self-updater — on Windows that updater escapes its parent's pseudoconsole, allocates a fresh console, and (with Windows Terminal as the default terminal app) pops a stray terminal window mid-session.A provider now declares its opt-out once on the
DetectionSpec; shared runtime fans it out to every lane, so a new launch point picks it up for free instead of every command builder having to remember its ownenv.Changes
base/spawnEnv.ts(new) —mergeSpawnEnv,withCommandBaseSpawnEnv,withBaseSpawnEnv,inheritBaseSpawnEnv. Adapters derive the map from their spec via...inheritBaseSpawnEnv(spec)so the two can never drift.probeEnv), terminal login (viaauthMethods[].env), PTY launch, ACP session/auth/logout, one-shots, context extraction, and subagent children.updatestays exempt — the user-driven "update agent" action must still reach the CLI's own updater.AGY_CLI_DISABLE_AUTO_UPDATE— including the account probe, whose 5-minute TTL was exactly the cadence that kept re-arming the updater.baseSpawnEnv— commandcode, factory, and muse drop their repeated per-builderenv.STATUS_CACHE_VERSION13→14 and the renderer store 10→11, since terminal auth methods now carrybaseSpawnEnv-derivedenv; a status persisted before that derivation would build a login command without it.Review fixes folded in
SubagentAttemptRunnerbuilt aCreateStructuredSessionInputby hand and never passedbaseSpawnEnv, unlikeSpawnPipeline— the one launch point where the "can't silently miss it" guarantee wasn't holding. Pinned with two regression tests.buildFactoryCommand's env parameter replaced the base constant instead of layering on top, so a caller forwarding a narrower env would have silently dropped the opt-out out of the WSL login-shell script — the one lane where spawn-level env can't rescue it. Now merges.withCommandBaseSpawnEnvis generic over the command shape, so lane extras (stdin,isolateCwd) survive the wrap.Testing
pnpm run typecheck,pnpm run lint,pnpm run fmt:check— all pass.pnpm exec vitest run src/supervisor src/renderer/state— 4098 passed, 1 failed. The single failure is the pre-existinggemini/plugin/install.test.tspwsh-absolute-path assertion, in a file this branch does not touch.AGY_CLI_DISABLE_AUTO_UPDATEis a real string in the shippedagy.exe(adjacent tofailed to check for updates), so the new opt-out is not a guess.🤖 Generated with Claude Code