mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-24 17:15:50 +00:00
fix: ACP NewSessionResponse 恢复返回 models 字段
67fdd4ca 那次合规审计误将 models 从响应里移除,但 SDK 0.19.2 的 schema 实际允许 models?: SessionModelState | null(标注 UNSTABLE 仅表示"未来可能变",并非 "agent 禁止返回")。标准 ACP 客户端(Cursor/Zed/VS Code/RCS)依赖此字段填充 模型选择器 —— 缺失会导致客户端 supportsModelSelection=false,模型切换 UI 不可用。 - createSessionMethod: return 里加回 models - sessionLifecycle: getOrCreateSession 两处 return 透传 models(resume/load 路径) - agent.test: 更新过时的 "models omitted for v1 compliance" 断言 Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
@@ -79,6 +79,9 @@ async function getOrCreateSession(
|
||||
return {
|
||||
sessionId: params.sessionId,
|
||||
modes: existingSession.modes,
|
||||
// Carry models over on reconnect so the client keeps its model selector
|
||||
// populated (standard clients gate supportsModelSelection on this field).
|
||||
models: existingSession.models,
|
||||
configOptions: existingSession.configOptions,
|
||||
}
|
||||
}
|
||||
@@ -150,6 +153,8 @@ async function getOrCreateSession(
|
||||
return {
|
||||
sessionId: response.sessionId,
|
||||
modes: response.modes,
|
||||
// createSession already returns models; pass it through. Same reason as above.
|
||||
models: response.models,
|
||||
configOptions: response.configOptions,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user