Repository navigation
fix(core): resolve Qwen 3.8 reasoning budget conflicts #8525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
196e37b
a111a74
b5cadf7
cbf9685
5386e37
acfebe2
858147c
6957bf7
cbd23e4
6515cb1
0def9da
c6999e6
3f92484
4e9ebc6
9f27e19
d1335e5
b214a83
32c69a6
fc7e54e
aa30c2d
282079c
a2703eb
ea91a35
868b25c
e176476
3c74544
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ import { | |
| normalizeReasoningEffort, | ||
| loadUsageDashboard, | ||
| type MCPOAuthConfig, | ||
| type ReasoningEffortOverride, | ||
| } from '@qwen-code/qwen-code-core'; | ||
|
|
||
| const debugLogger = createDebugLogger('SYSTEM_CONTROLLER'); | ||
|
|
@@ -162,6 +163,14 @@ export class SystemController extends BaseController { | |
| } | ||
|
|
||
| this.context.config.setSdkMode(true); | ||
| let effortStatus: | ||
| | { | ||
| effort: string; | ||
| applied: boolean; | ||
| override: ReasoningEffortOverride | null; | ||
| reason?: string; | ||
| } | ||
| | undefined; | ||
|
|
||
| const canUseToolTimeout = payload.timeout?.canUseTool; | ||
| if ( | ||
|
|
@@ -177,13 +186,30 @@ export class SystemController extends BaseController { | |
| const normalized = normalizeReasoningEffort(payload.effort); | ||
| if (normalized) { | ||
| try { | ||
| if (applyReasoningEffort(this.context.config, normalized)) { | ||
| debugLogger.info( | ||
| `[SystemController] Set reasoning effort to: ${normalized}`, | ||
| const effortMatches = applyReasoningEffort( | ||
| this.context.config, | ||
| normalized, | ||
| ); | ||
| const override = | ||
| this.context.config.getReasoningEffortOverride?.() ?? null; | ||
| const applied = effortMatches && override === null; | ||
| const reason = applied | ||
| ? undefined | ||
| : [ | ||
| ...(effortMatches ? [] : ['thinking may be disabled']), | ||
| ...(override | ||
| ? [`${override.source}.${override.field} takes precedence`] | ||
| : []), | ||
| ].join('; '); | ||
| effortStatus = { effort: normalized, applied, override, reason }; | ||
|
|
||
| if (!applied) { | ||
| debugLogger.warn( | ||
| `[SystemController] Effort '${normalized}' was not applied (${reason})`, | ||
| ); | ||
| } else { | ||
| debugLogger.warn( | ||
| `[SystemController] Effort '${normalized}' was not applied (thinking may be disabled)`, | ||
| debugLogger.info( | ||
| `[SystemController] Set reasoning effort to: ${normalized}`, | ||
| ); | ||
| } | ||
| } catch (error) { | ||
|
|
@@ -310,6 +336,7 @@ export class SystemController extends BaseController { | |
| subtype: 'initialize', | ||
| session_id: this.context.config.getSessionId(), | ||
| capabilities, | ||
| ...(effortStatus ? { effort_status: effortStatus } : {}), | ||
|
DragonnZhang marked this conversation as resolved.
Resolved
|
||
| }; | ||
| } | ||
|
|
||
|
|
@@ -532,7 +559,13 @@ export class SystemController extends BaseController { | |
| } | ||
|
|
||
| try { | ||
| const applied = applyReasoningEffort(this.context.config, normalized); | ||
| const effortMatches = applyReasoningEffort( | ||
| this.context.config, | ||
| normalized, | ||
| ); | ||
| const override = | ||
| this.context.config.getReasoningEffortOverride?.() ?? null; | ||
| const applied = effortMatches && override === null; | ||
|
|
||
| debugLogger.info( | ||
| `[SystemController] Reasoning effort set to: ${normalized} (applied: ${applied})`, | ||
|
|
@@ -542,6 +575,7 @@ export class SystemController extends BaseController { | |
| subtype: 'set_effort', | ||
| effort: normalized, | ||
| applied, | ||
| override, | ||
|
Comment on lines
575
to
+578
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acknowledged. This is a valid diagnostic consistency follow-up, but it does not identify a current correctness, security, or data-loss failure. This PR is beyond five change-producing review rounds, so the repository policy limits further scope to Critical findings. Deferring this item to avoid another diff expansion and leaving the thread unresolved for maintainer prioritization. |
||
| }; | ||
|
DragonnZhang marked this conversation as resolved.
Resolved
|
||
| } catch (error) { | ||
| const errorMessage = | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.