Repository navigation
refactor(delegation): offer Delegation on every supported turn without a per-turn flag - #2280
Merged
Merged
Conversation
TurnRequest.threadControlEligible was the last piece of the wording gate. Since #2271 the server set it from the provider alone, so it never varied for a Codex session, but the Codex adapter still used it to decide whether to attach the Delegation toolkit and kept a session restart for an eligibility change that could no longer happen. Codex now attaches the Delegation toolkit to every session, as the Claude, Cursor and Copilot adapters already do. The steer runtime reads whether a turn holds the Delegation lease from the lease directive itself instead of the request flag. Part of #2218
…per-turn eligibility Part of #2218
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.
What
Before this PR, #2271 had already removed the wording check from the server: every turn on a provider that supports Delegation gets the Delegation lease, and the mcode instructions tell the model when to use
delegate_taskinstead of a native sub-agent orthread_launch. One gate was left behind. The server still sent a per-turnthreadControlEligibleflag, and the Codex adapter used it to skip the mcode attach (or restart a pooled session) when the flag changed.This PR removes that flag. Codex now attaches the Delegation toolkit on every session, like the other adapters. The Coordinator wake check reads the lease the turn actually holds (
holdsDelegationLease) instead of the removed flag.The runtime-mode ceiling from ADR-0032 already holds on main: a delegated thread inherits the Coordinator's mode and cannot ask for a broader one.
Verification:
packages/providers: full suite, 112 files and 1700 tests passed.apps/server: themcode-mcp,thread-controlandagents/steeringsuites, plusturn-steer-deliveryandagent-service-gate, ran 39 files and 496 tests, all passed.contracts,providersandserver.bun run lintshows only existing warnings in unrelated scripts.Codex test change:
threadControl: false.attachto be called withthreadControl: true.Closes #2218
Why
Delegation should be offered whenever the provider supports it, and the user should not have to phrase a request a certain way to get it. The runtime-mode ceiling is the safety bound, not wording. The leftover flag kept a second, Codex-only gate alive. It also cost a session restart whenever eligibility changed.
Review Notes
fullandsupervised, and every provider supports both, so the rule never changes the outcome. I left it out rather than add code that does nothing.ProviderMcodeAttachRequest.threadControlis now alwaystrue. Removing the field touchesMcodeSessionand the MCP tool listing, so it belongs in its own PR. I updated its docstring for now.Need help on this PR? Tag
@codesmith-botwith what you need.