feat(desktop): add thread-scoped ACP session experiment - #6909
Open
salman1993 wants to merge 4 commits into
Open
feat(desktop): add thread-scoped ACP session experiment#6909salman1993 wants to merge 4 commits into
salman1993 wants to merge 4 commits into
Conversation
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
The managed-agent harness reads BUZZ_ACP_SESSION_POLICY only at launch, but the effective policy was absent from SpawnConfigSnapshot. Toggling the "Thread Scoped ACP Sessions" experiment while a local agent was running left restart_diff/needs_restart false, so the running process silently kept the old policy until a manual restart. Capture the resolved policy in both the stamped and prospective spawn snapshots so the existing config-drift path lights the restart-required badge and the auto-restart lifecycle applies the new policy on the next turn. Resolve the policy once at spawn and use the same value for the command env and the stamp, so badge and process can never disagree. - Add session_policy to SpawnConfigInputs / SpawnConfigSnapshot and thread it through prospective_spawn_config_snapshot. - apply_app_acp_session_policy_env now returns the applied policy so the spawn path resolves it once. Local starts, provider deployments, reserved-env precedence, and persisted startup state are unchanged. - Tests: channel->thread and thread->channel now require restart; unchanged policy does not; add the diff-coverage mutation row. File-size ratchet housekeeping (runtime.rs sat at the 1000-line cap): - Move child_rust_log_filter into runtime/metadata.rs (its natural home for child-process env construction) to make room. - Place the new regression tests in the existing spawn_snapshot/tests_ext sibling rather than growing tests.rs past the cap. Signed-off-by: Salman Mohammed <smohammed@squareup.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bad0b59d20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,140 @@ | |||
| use std::{ | |||
There was a problem hiding this comment.
The reviewed commit message has no Signed-off-by: trailer, so the repository's required DCO Check will reject this change; sign off this commit before it is merged.
AGENTS.md reference: AGENTS.md:L145-L145
Useful? React with 👍 / 👎.
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.
Why
Thread-scoped ACP sessions from #6732 need an opt-in desktop rollout that preserves today’s channel policy by default.
What
BUZZ_ACP_SESSION_POLICY=channel|threadfor every local and provider-backed managed ACP launch. Changes apply when managed agents next start; DMs remain conversation-scoped by the backend.Risk Assessment
Low. The experiment defaults off and explicitly preserves
channel; changes are limited to managed-agent launch configuration. Existing running agents are unchanged until their next start.Testing
. ./bin/activate-hermit && just ci— passed on the final restacked tree, including 5,674 desktop tests, 2,796 Tauri tests, and 1,860 mobile tests.cd desktop && pnpm build:e2e && pnpm exec playwright test tests/e2e/experimental-features.spec.ts --project=smoke— 1 passed.. ./bin/activate-hermit && cargo test --manifest-path desktop/src-tauri/Cargo.toml session_policy --lib— 4 passed.. ./bin/activate-hermit && cargo test --manifest-path desktop/src-tauri/Cargo.toml commands::agents::deploy::tests --lib— 15 passed.. ./bin/activate-hermit && cargo test -p buzz-backend-kubernetes --test wire_fixtures— 4 passed.Stack Info
Stacked on #6732. This PR depends on #6732 and should merge after it.
Generated with Codex