Repository navigation
Keep TUI runtime overrides scoped to each backend - #65410
copyberry[bot] merged 1 commit into
Conversation
## Why Switching backends could carry the outgoing backend's interactive settings into the destination. For example, resuming a session could use a directory selected with `/cd` on a different backend. Saved permission overrides could also reapply settings that a retained local thread had already superseded. ## What changed Save the working directory, approval policy, approvals reviewer, and permission profile overrides with each backend. Use the destination's overrides when preparing a start or resume, and adopt them only after the switch succeeds. Reconcile saved overrides with the active local thread's permissions on attachment and when thread settings updates arrive. Drop conflicting overrides and refresh a confirmed named profile's permissions for the resumed directory. ## Testing Extend backend handoff tests to cover failed switches and retries, isolation of resume parameters, and the first turn after returning to a retained thread with newer server settings. GitOrigin-RevId: fb2f348d47d150d8d4d8a9bb11d04f0507c1c650
1c0be13 to
c4c02a3
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c0be13168
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| &mut config, | ||
| RuntimePolicyOverrideScope::ExplicitOnly, | ||
| settings.config.approvals_reviewer, | ||
| &settings.runtime, |
There was a problem hiding this comment.
Use destination overrides when selecting the startup reviewer
When starting a new conversation on a backend with a saved runtime reviewer override, this applies the destination reviewer to config, but the subsequent new_session_execution() still checks self.runtime_approvals_reviewer_override from the outgoing backend. If the outgoing backend has no reviewer override and no config layer explicitly sets approvals_reviewer, apply_configured_reviewer() selects Invocation(None), so thread/start omits the destination's saved reviewer and uses the server default instead. Pass the staged destination runtime overrides into startup-choice construction too, so returning to a backend preserves its interactive reviewer selection.
Useful? React with 👍 / 👎.
Keep TUI runtime overrides scoped to each backend
Why
Switching backends could carry the outgoing backend's interactive settings
into the destination. For example, resuming a session could use a directory
selected with
/cdon a different backend. Saved permission overrides couldalso reapply settings that a retained local thread had already superseded.
What changed
Save the working directory, approval policy, approvals reviewer, and
permission profile overrides with each backend. Use the destination's
overrides when preparing a start or resume, and adopt them only after the
switch succeeds.
Reconcile saved overrides with the active local thread's permissions on
attachment and when thread settings updates arrive. Drop conflicting
overrides and refresh a confirmed named profile's permissions for the
resumed directory.
Testing
Extend backend handoff tests to cover failed switches and retries,
isolation of resume parameters, and the first turn after returning to a
retained thread with newer server settings.