Repository navigation
feat(recall): send recent turns (prompt + answer) and the session title in the recall context - #92
forrestlinfeng wants to merge 4 commits into
Conversation
A recall's context now carries the typed prompts before this turn's, oldest
first, as recent_turns ({ role: 'user', text }; at most 5, 1000 characters
each and 4000 in all, cleaned and redacted like a prompt; commands excluded).
The Hub records them beside the recall for evaluation and does not rank by
them yet, so a follow-up like "and step three?" can be studied with what it
refers to.
The context limit follows the Proxy the plugin requires (2.0.50 keeps up to
16 KiB, not 4096 bytes): the oldest recent turns are dropped first, and only
then is the task cut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 3 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 da03c1268468 |
|
Sentinel 保留了 3 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 da03c1268468 |
…turns # Conflicts: # lib/app/prompt.js
…title
A short follow-up such as "how many assets in all?" was recalled with only
the session's first prompt beside it. A Gene for counting an EvoX asset
library was taken for it in a session that counted a distillation
pipeline's output. The prompts before it ("report progress") said as
little.
- recent_turns now holds the last three typed turns, each prompt then the
answer the turn ended with, as { role: 'user' | 'assistant', text }.
A prompt keeps 500 characters and an answer its first 800, 4000 in all,
whole turns only, cleaned and redacted as a prompt is. The answer is
kept at turn end, or at settle from a host that tells it among its
tool notes (Cursor, ZCode).
- context.title is the host's newest name for the session. Claude Code
gives it as the last custom-title in its transcript, which the hooks
module now names through $.session.info().
- Over the Proxy limit, the oldest turn goes whole, prompt with answer,
before the task is cut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 4 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 507dd5283bf7 |
|
Sentinel 保留了 4 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 507dd5283bf7 |
…keeps recent turns - A turn joined the recent turns only when the next turn was typed. So a task notification's turn between two typed turns lost the first typed turn's answer, and its own answer was recorded under that turn's prompt. Each turn now records whether a person typed it, and a typed turn joins the recent turns when the next turn of any kind opens. - endedSession dropped the recent turns and title. A session ended and resumed under the same id then recalled with its task alone. It now keeps both, with the last typed turn added. Found by replaying each host's captured payloads over three turns. Every host passed before and after the fix; the untyped-turn and resume cases failed before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 GitHub CI 未通过。 此状态来自当前 CI gate,不是 Sentinel finding;请以最新 CI attempt 的日志为准。 另有 7 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 99866df5d988 |
|
Sentinel 保留了 7 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 99866df5d988 |
What
A recall's
contextnow carries what came before the current prompt:recent_turns: the last three typed turns before this one, oldest first. Each turn is its prompt{ role: 'user', text }followed by the answer it ended with{ role: 'assistant', text }.promptTextOf). Commands, and turns nobody typed, are left out.title: the host's newest name for the session, up to 120 characters.custom-titleentry in its transcript. The hooks module now sendstranscript_path(from$.session.info()), and the profile reads the last 256 KiB of that file.Why
A real bad case from a Claude Code session distilling the nexu-io sources:
inspect_assets, a tool Claude Code does not have. The turn then credited it as reused.Hub side (required for any effect)
The Hub currently keeps only
task,triggerandlanguagefrom the context (fetchContextOf).recent_turnsandtitlepass through the.passthrough()schema and are dropped. Until the Hub feeds them to the context-fit judge, or at least records them for evaluation, this change has no effect on ranking. A separate Hub change is needed.Data
Sending assistant answers sends more of the session to the Hub than sending prompts did: the first 800 characters of each of the last three answers. They are redacted the same way prompts are. This was agreed with the plugin owner for this change.
Tests
test/app/recall-context.test.js:test/recall.test.js:recentTurnsOflimits, whole turns, redaction, and dropping whole turns under the Proxy limit.test/hosts/claude-code/profile.test.js: the newestcustom-titleis used, and none is used without one. Checked against a real transcript, it read the title in about 2 ms.mainhere.🤖 Generated with Claude Code