Skip to content

fix(server): apply runtime-mode changes to live ACP sessions - #49629

Draft
karank2512 wants to merge 1 commit into
pingdotgg:mainfrom
karank2512:fix/runtime-mode-live-sessions
Draft

karank2512 wants to merge 1 commit into
pingdotgg:mainfrom
karank2512:fix/runtime-mode-live-sessions

Conversation

@karank2512

Copy link
Copy Markdown

Problem

Changing a thread's runtime mode (e.g. plan to full-access) in Settings while its ACP session is running has no effect on that session: it keeps the mode captured at session start until restart. The UI reflects the new mode, the agent does not have it.

Fix

Thread runtime-mode updates through Orchestrator and ProviderSessionManager into live ACP sessions; ProviderTurnStartService applies the current mode on the next turn, and the ACP adapter exposes the mode update on the session.

Tests

Added ProviderSessionManager coverage for live mode updates (76 lines); existing turn-control tests updated. Verified manually on 0.1.14-nightly.20261205.5766: switching a running Antigravity thread from plan to full-access applies without restart.

Notes

No behavior change for sessions whose runtime mode is unchanged.

Push thread.runtime-mode.set updates to live provider sessions that support in-session mode switching (such as Antigravity) via a process-bound outbox effect and optional runtime updateRuntimePolicy hook, while keeping detach/reopen for providers without live switching. Re-evaluate pending live approval requests on in-place switches (accepting command/file/permission in full-access and file approvals in auto-accept-edits, leaving auto, user_input, and fullAccessOverride prompts untouched) and report failed live switches on the session banner with next-turn restart recovery.

The live switch reuses configureSession's runtime-mode ceiling and session-mode lock, records the modes it sets so they are not reported as the agent's own changes, and tracks the applied runtime mode in the adapter's configuredRuntimeMode, reset on every session reset.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +4 test cases (browser 0, unit 0, server +4; +418 test lines).

Proof of a fix is not automatically a permanent CI test—keep new tests only when they clear the keep bar in Testing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant