Repository navigation
召回前用会话自己的模型改写查询 - #49
forrestlinfeng wants to merge 6 commits into
Conversation
With EVOMAP_API_KEY set, recall asks gemini-3.5-flash on the EvoMap gateway to rewrite the whole task (up to 6000 characters) into one English search query, fetches the Hub's top ten for it, and has the same model judge each candidate against the task (up to 4000 characters), one request per candidate sent together. Up to five accepted candidates are injected; none are injected when none is accepted. A failed rewrite searches with the 400-character prompt prefix, a failed review injects the best candidate unreviewed, and both are reported in the recall outcome and logged. Without the key recall is unchanged. Offline over the 499-task bank this cut misleading injections from 715 to 13 while keeping 384 of 406 fitting ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A follow-up such as "Continue with the task from where you stopped." says nothing about the work. Judged alone, its rewrite became a query about resuming interrupted workflows and the review accepted three checkpointing playbooks for a legal drafting task. The rewrite and the review now read the session's opening prompt followed by this turn's; a fallback still searches with this turn's prompt prefix, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gateway caps concurrent requests per key and answers 429 concurrency_limit; a review sends ten at once beside the agent's own calls on the same key, and a lost verdict counts as a rejection. A 429 or 5xx is retried twice, after 1 s and 3 s or the Retry-After it names (at most 5 s); any other refusal fails at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 GitHub CI 未通过。 此状态来自当前 CI gate,不是 Sentinel finding;请以最新 CI attempt 的日志为准。 另有 5 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 a3cf6e022a75 |
|
Sentinel 保留了 5 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 a3cf6e022a75 |
The query rewrite no longer calls a hard-coded gateway and model: it runs on the provider and model the session already uses, through dsh's llm service, so it needs no key of its own. Without that route, or when the rewrite fails, recall searches with the prompt prefix as before. The pre-injection review is gone, with the ten-candidate request, the five-asset injection and the gateway retries: recall injects the single best asset again, as on main. The review added up to ten model calls and about ten seconds before the first step, and up to five strategies to the context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 3 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 05b06a2b3756 |
|
Sentinel 保留了 3 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 05b06a2b3756 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 6 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 ce51ef3d9a59 |
|
Sentinel 保留了 6 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 ce51ef3d9a59 |
背景
插件现在用题目前 400 字向 Hub 召回。金融、办公表格、业务流程、客服、法律 5 个门类的题,前 400 字是同一段模板,等于每题都发同一条查询。本 PR 在召回前把完整题目改写成一句检索查询。
改动
llm服务,用当前 agent 的provider/model调一次,不再写死网关地址和模型,也不需要单独的 key。提示词与离线回放时一致。llm服务、agent 没有 provider/model,或改写失败(报错、超时 12 秒、返回空)。失败原因写进召回日志的rewrite_error,并输出ctx.logger.warn。测试 166 个,在 Node 22.22 和 Node 26 下都通过。之前 Node 22 下失败的那组 recall-judge 测试已随复核一起删除。
已知数据(需在线验证)
分层评估第 2 层离线回放,Hub 为 #3832,Jev 门槛 0.4,只测改写、不含复核:
只改写、不复核时,非模板题小幅变好,金融模板题明显变差。合并前需要跑同一时段的小规模在线对照(main 对比本 PR),看完成率、token 和首步延迟。
成本与延迟
回滚
git revert。🤖 Generated with Claude Code