Repository navigation
Replies: 1 comment
|
Workaround available for this one. I hit it exactly as reported — a review route pinned to What it changes for this report: the review request now carries Also in the same plugin (the #8670 half): the request carries the session's reasoning level plus a capability-checked fallback level, and if a pinned review route cannot take that level, the review retries once without it instead of failing every call of that session. Extra: a per-session reviewer-model picker — review with a different model than the one under review, stored per session, resettable to "follow the session model". Install (dsh then restart Disclosure — please read before installing:
Repo + design notes: https://github.com/DMIAOCHEN/dsh-auto-review-plus |
Uh oh!
There was an error while loading. Please reload this page.
环境
0.2.0-rc.2(web profile,/permission auto)@deepseek-ai/dsh-experimental-auto-review0.2.0-rc.2opencode-go,modeldeepseek-v4.1-flash(agent-default-model.reasoningEffort: high)现象
开启 Auto review 后,每次工具调用(原生与 PTC 内层)都失败、fail-closed(工具体不执行):
根因链
pi-ai(
@earendil-works/pi-ai@0.87.1)的dist/providers/opencode-headers.js为 opencode / opencode-go 注入必需的路由头,条件是请求选项里带sessionId:packages/llm/llm-pi-ai/src/adapter.ts的streamWithSnapshot()把请求的 sessionId 原样透传给 pi-ai:主对话:agent-loop 强制每条请求携带 session id(
packages/core/agent-loop/src/invariant.ts: "a loop-built request must carry a session id";agent.ts里sessionId: this.session.id)→ 头存在 → 网关正常路由。Auto review:
packages/experimental/auto-review/src/index.ts的classifyRisk()构造的GenerateOptions只包含provider/model/system/messages/temperature: 0/signal—— 没有sessionId→ pi-ai 不加头 → opencode 网关 400MissingSessionID→ reviewer 失败 → 该工具调用失败。影响
凡是对请求路由有会话级要求的 provider(至少 opencode / opencode-go)都无法与 Auto review 共用:Auto 模式在这些路由下完全不可用(每次工具调用都会失败)。
现有绕过(及其代价)
headers: { x-opencode-session: <稳定值> }。因为 pi-ai 的hasHeader检查同时作用于主对话,主对话也会改用这个静态值,失去按会话的路由亲和(多会话时缓存/路由效率下降),所以只算权宜之计。建议修复
让 reviewer 请求继承当前会话的
sessionId。它是传输层的路由元数据、不会进入审查内容,因此与 README 中"审查输入不含持久身份或来源"的设计并不冲突(隐私边界在审查内容,不在传输头)。顺带一个同源建议:审查请求同样应当继承会话当前的 reasoning effort —— 相关缺陷另见 #8670(本条的根因是缺失
sessionId,那条是缺失reasoningEffort,属于同一类"reviewer 请求未继承会话请求上下文"的问题)。感谢!
All reactions