-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(cli): expose reasoning effort through ACP #8526
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
87570d5
0273f82
dd0e7a8
2a51b54
c8067c4
d703074
54163b7
6c4a28e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,8 @@ import { | |
| normalizeSnapshotPayload, | ||
| startEventLoopLagMonitor, | ||
| refreshMemoryInstruction, | ||
| applyReasoningEffort, | ||
| REASONING_EFFORT_TIERS, | ||
| extractDaemonTraceContext, | ||
| withDaemonSpan, | ||
| type AgentParams, | ||
|
|
@@ -109,6 +111,7 @@ import { | |
| type ProviderConfig, | ||
| type ProviderModelConfig, | ||
| type ProviderSetupInputs, | ||
| type ReasoningEffort, | ||
| type ResumedSessionData, | ||
| type SendSdkMcpMessage, | ||
| type SessionArtifactEventRecordPayload, | ||
|
|
@@ -363,6 +366,14 @@ const POSIX_TMP_LOCAL_READ_ROOT = '/tmp'; | |
| const BTW_CHILD_TIMEOUT_MS = 55_000; | ||
| const MCP_OAUTH_START_TIMEOUT_MS = 30_000; | ||
| const SESSION_DRAIN_TIMEOUT_MS = 30_000; | ||
| const ACP_REASONING_EFFORT_DEFAULT = 'default'; | ||
| const ACP_REASONING_EFFORT_NAMES: Record<ReasoningEffort, string> = { | ||
|
Collaborator
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. [Suggestion] The new Suggested fix (spans multiple files, so no one-click suggestion): extract one shared tier→label record next to 中文说明新增的 建议修复(跨多文件,故不提供一键 suggestion):在 — qwen3.8-max via Qwen Code /review (v0.21.7) |
||
| low: 'Low', | ||
| medium: 'Medium', | ||
| high: 'High', | ||
| xhigh: 'Extra high', | ||
| max: 'Max', | ||
| }; | ||
|
|
||
| // Must be less than WORKSPACE_MEMORY_REMEMBER_TIMEOUT_MS (300s) in bridge.ts. | ||
| const WORKSPACE_MEMORY_REMEMBER_CHILD_TIMEOUT_MS = 295_000; | ||
|
|
@@ -5173,6 +5184,25 @@ class QwenAgent implements Agent { | |
| ); | ||
| break; | ||
| } | ||
| case 'reasoning_effort': { | ||
| const effort = | ||
| value === ACP_REASONING_EFFORT_DEFAULT | ||
| ? undefined | ||
| : REASONING_EFFORT_TIERS.find((tier) => tier === value); | ||
| if (value !== ACP_REASONING_EFFORT_DEFAULT && effort === undefined) { | ||
| throw RequestError.invalidParams( | ||
| undefined, | ||
| `Unknown reasoning effort: ${value}. Choose one of: ${ACP_REASONING_EFFORT_DEFAULT}, ${REASONING_EFFORT_TIERS.join(', ')}`, | ||
| ); | ||
| } | ||
| if (!applyReasoningEffort(session.getConfig(), effort)) { | ||
| throw RequestError.invalidParams( | ||
| undefined, | ||
| 'Reasoning effort cannot be applied while thinking is disabled', | ||
| ); | ||
| } | ||
| break; | ||
| } | ||
| default: | ||
| throw RequestError.invalidParams( | ||
| undefined, | ||
|
|
@@ -11973,7 +12003,30 @@ class QwenAgent implements Agent { | |
| options: configModelOptions, | ||
| }; | ||
|
|
||
| return [modeConfigOption, modelConfigOption]; | ||
| const reasoningEffortConfigOption: SessionConfigOption = { | ||
|
Collaborator
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. [Suggestion] Suggested fix: omit the option or mark it unavailable when 中文说明
建议修复:当 — qwen3.8-max via Qwen Code /review (v0.21.7) |
||
| id: 'reasoning_effort', | ||
| name: 'Reasoning effort', | ||
| description: 'How hard reasoning-capable models should think', | ||
| category: 'thought_level', | ||
| type: 'select' as const, | ||
| currentValue: | ||
| config.getReasoningEffort?.() ?? ACP_REASONING_EFFORT_DEFAULT, | ||
| options: [ | ||
| { | ||
| value: ACP_REASONING_EFFORT_DEFAULT, | ||
| name: 'Default', | ||
| description: 'Use the model or provider default', | ||
| }, | ||
| ...REASONING_EFFORT_TIERS.map((effort) => ({ | ||
| value: effort, | ||
| name: ACP_REASONING_EFFORT_NAMES[effort], | ||
| description: | ||
| 'Providers map or clamp the requested tier for the active model', | ||
| })), | ||
|
zjunothing marked this conversation as resolved.
|
||
| ], | ||
| }; | ||
|
|
||
| return [modeConfigOption, modelConfigOption, reasoningEffortConfigOption]; | ||
|
zjunothing marked this conversation as resolved.
|
||
| } | ||
|
|
||
| private buildSelectableModelOptions(config: Config) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.