Repository navigation
Conversation
This branch has not been deployed
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.
Human comments
What was wrong
runTurninpackages/provider-bridge-acp/src/bridge/bridge.tscalledreconcileExecutionSettings(bridge.ts#L3561) for every pending input, including internal inputs created byturn/steer(queued steers during an active turn and steers during unsolicitedagentactivity).reconcileExecutionSettingsmergedlaunchSpec?.envandoptions.envVarsunconditionally, causing changed environment values on a steer to restart the provider process mid-turn instead of waiting for the nextturn/start.What changed
packages/provider-bridge-acp/src/bridge/bridge.ts: addedpreserveActiveEnv?: booleantoAcpPendingTurnInput, setpreserveActiveEnv: trueon bothturn/steerenqueue paths (activePromptKind === "agent"andqueuedInputs), and keptsession.construction.envVarsinreconcileExecutionSettingswhenpreserveActiveEnvistrue. Permission and model reconciliation during steer are unchanged, and new environment values still apply on the nextturn/start.packages/provider-bridge-acp/src/bridge/fake-acp-agent.mjs,bridge.test.ts: updated"reports a permission-changing steer whose replacement fails to start"to triggersession/newfailure via launch args (FAKE_ACP_SESSION_NEW_ERROR_ON_ARG) instead of mid-turn env changes, and added 4 regression tests coveringoptions.envVars,launchSpec.env, and overridden inherited env across ordinary, stacked, unsolicited-agent, and permission-changing steers.docs/provider-bridge-protocol.mddescribesturn/steergenerally without env-reconciliation internals.No wire change and no schema change.
How you verified
Base commit:
origin/main4d7a9af609.origin/main)eb2eff955f)turn/steerwith changedoptions.envVars,launchSpec.env, or overridden inherited env (ordinary, stacked, or unsolicited agent turn)BAfor the steer; appliesBon nextturn/startturn/steerwith changed envBA; appliesBon nextturn/startAll 4 new regression tests in
packages/provider-bridge-acp/src/bridge/bridge.test.tsfailed before the fix and pass after (5/5 targeted tests pass).CI parity command:
pnpm exec turbo run typecheck test lint lint:type-aware --filter=@bb/provider-bridge-acp --filter=@bb/provider-parity --continue@bb/provider-bridge-acp:test: 23 files, 648 passed / 4 skipped; 0 lint/typecheck warnings or errors).Fixes #8512