Repository navigation
fix(subagents): reject unsupported resume option overrides - #1055
Merged
Merged
Conversation
Reject effective creation options before resuming an existing child. Preserve empty defaults, including max_turns: 0, and document the continuation contract. Reuse the existing SDK integration harness to verify rejection before dispatch and compatible continuation.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
8 tasks done
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.
Summary
Agentacceptsmodeland other creation options, but the resume path does not apply them. A caller can request another model and incorrectly believe the override took effect.Make the continuation contract explicit: reject nonempty
model,thinking,input_files,isolation,inherit_context: true, and nonzeromax_turnsbefore calling the runtime. Empty defaults, includingmax_turns: 0, retain the existing start behavior. To change creation options, start a new subagent; this does not implement model hot-swapping. The tool description and documentation now state this contract.This is the resume-contract split from #1054, based directly on official
main. It does not include or depend on that PR's turn-limit/runtime changes. The regression reuses the existing SDK integration harness instead of copying the lifecycle fixture or introducing an abstraction.Evidence
Before: On unmodified upstream
6fcd7d4, the new SDK-dispatch regression fails:After: A real SDK
AgentSessioncalls the model-onlyAgenttool using faux model responses. A recording runtime delegate observes no resume dispatch for any rejected option and exactly one dispatch for the compatible empty-default request. Errors name the rejected option.Before: Resume coverage was bundled with the lifecycle change.
After: This independent resume-only branch passes:
npm testnpm run lintnpm run build, including TypeScript checkingThe model boundary and runtime delegate are controlled in the new integration test; it exercises actual SDK tool dispatch, not a live external provider or a real child execution. Local validation used macOS/arm64 and Node 26.5.0. The unchanged session-export route still emits its dynamic-dependency build warning. Both split patches apply together, and their combined production code is byte-identical to the previously reviewed implementation.
Merge Danger
Door: two-way
No data migration, settings, dependencies, or new runtime states are introduced. Reverting restores the previous silent-ignore behavior.
Blast Radius: Resume
Callers that repeat nonempty creation options when resuming will now receive an explicit error and must omit them or create a new child. Empty-default calls remain compatible. Turn limits, terminal outcomes, provider selection, tool permissions, ownership checks, and existing session configuration are not changed.