fix(delegate-task): only check resolved model for isUnstableAgent, not category default#2507
Merged
acamq merged 1 commit intocode-yeongyu:devfrom Mar 15, 2026
Conversation
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Correctly ensures that model overrides use the appropriate execution path by checking the resolved model's stability rather than the category default. High confidence in no regressions.
Collaborator
|
Thank you! |
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
Closes #2287
The
isUnstableAgentcheck incategory-resolver.tswas checking both the resolved model (actualModel) and the category's default model (resolved.config.model). This meant that even when a user overridesvisual-engineeringorwritingto use a stable model likeanthropic/claude-sonnet-4-6, the default model name (google/gemini-3.1-proorkimi-for-coding/k2p5) still triggeredisUnstableAgent = true.This routed tasks through
executeUnstableAgentTask()instead of the stable execution path, causing a race condition wheremanager.getTask(task.id)returnsundefinedafter the task completes before the polling loop catches it, resulting in "Task not found" errors.Changes
src/tools/delegate-task/category-resolver.ts— Only check the resolved/actual model for unstable agent detection, not the category's hardcoded default modelBefore
After
Impact
Summary by cubic
Fixes unstable-agent detection to consider only the resolved model, so stable overrides use the stable execution path. Resolves #2287 by removing misroutes that caused intermittent "Task not found" errors.
src/tools/delegate-task/category-resolver.tsto check only the resolved model inisUnstableAgent, not the category default.Written for commit eb79d29. Summary will update on new commits.