Skip to content

feat(desktop): add thread-scoped ACP session experiment - #6909

Open
salman1993 wants to merge 4 commits into
codex/thread-scoped-acp-sessionsfrom
codex/thread-scoped-acp-sessions-desktop
Open

feat(desktop): add thread-scoped ACP session experiment#6909
salman1993 wants to merge 4 commits into
codex/thread-scoped-acp-sessionsfrom
codex/thread-scoped-acp-sessions-desktop

Conversation

@salman1993

Copy link
Copy Markdown
Contributor

Why

Thread-scoped ACP sessions from #6732 need an opt-in desktop rollout that preserves today’s channel policy by default.

What

  • Add the default-off “Thread Scoped ACP Sessions” toggle under Settings → Experiments using the existing feature-override persistence.
  • Map the persisted setting to BUZZ_ACP_SESSION_POLICY=channel|thread for every local and provider-backed managed ACP launch. Changes apply when managed agents next start; DMs remain conversation-scoped by the backend.
  • Keep the desktop setting authoritative over descriptor environment and cover the UI, persistence, local spawn, provider payload, and existing Projects/Workflows experiments.

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

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>
@salman1993
salman1993 marked this pull request as ready for review August 27, 2026 17:01
@salman1993
salman1993 requested a review from a team as a code owner August 27, 2026 17:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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::{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required DCO sign-off

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 👍 / 👎.

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.

1 participant