feat(web): add bounded transcript content search - #387
Conversation
|
CI status note: Node 22/24 completed this PR's repository checks and failed only at the final fresh-install I reproduced the packed install independently: npm now admits Pi 0.85.0 through OpenPI's published No dependency workaround is mixed into this feature PR. |
tt-a1i
left a comment
There was a problem hiding this comment.
需要改:tool-call 参数会进搜索 snippet
web/search/transcript-search.ts 的 messageEvidence 对 toolCall 做了:
const payload = tool.arguments === undefined ? tool.input : tool.arguments;
text: `${tool.name} ${JSON.stringify(payload)}`PR 正文写排除 private result details,但 arguments / input 整段可搜、可进 snippet。工具参数里的 token、路径、密钥会漏到 Web 搜索面。
toolResult 正文也会整段进 index。请把 arguments 从 searchable text 拿掉,或只留 allowlisted 的非敏感字段,并补一条「密钥不得出现在 snippet」的测试。
原语本身(文件/大小/命中上界、symlink 检查、AbortSignal)是好的,泄漏修完再合。现在还没有 HTTP endpoint,但这个函数一旦接上就会爆。
Problem
Issue #349 requires transcript-aware server search, but the current Web snapshot exposes only a bounded title/cwd/first-message projection. The open metadata-search PRs do not provide a safe mechanism for scanning Session JSONL content or tool evidence.
Relates to #349. This PR implements the transcript-scanner slice only; it does not duplicate PR #362's endpoint or PR #376's pagination work.
Value
Approach
searchWebTranscripts()over a caller-authorized Session catalog; the scanner never discovers or widens filesystem authority.AbortSignalcancellation.partialReasonsand accounting.The existing lightweight metadata filtering remains separate. Endpoint composition, pagination/cursors, and derived index invalidation remain follow-up slices of #349.
Validation
node --test --experimental-strip-types tests/web/transcript-search.test.ts— 8 passedbun run check— passedbun run test— Node: 1249 passed, 0 failed, 1 platform skip; Vitest: 30/30 passedImpact