Repository navigation
fix: resolve search_context conversation_id "current" to current session - #1127
Conversation
The search_context conversation_id param description promises "Defaults to the current conversation", but executeSearchContextTarget only special-cased an empty id or one exactly equal to the session id — sending the literal "current" fell through to the foreign lookup and failed as unknown session "current". Resolve "current" (any case) to the current session so the documented default actually works. Real session ids are generated (pfa-* / mNNNNN-style), so shadowing a hypothetical session literally named "current" is negligible; cross-session search for real ids is unchanged. Fixes #1125
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1127Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1127.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR review — verified mergeable. Diff hygiene: 2 files, +19/−1; every line relates to the fix. No unrelated changes, no whitespace churn, no lockfile/generated-file churn. Rebased onto current master (merge-base == master tip Triage (reproduce → layering → approach):
Pre-flight (re-ran locally on head
No small fixes found to add — nothing to patch. Ready for human merge. 中文摘要:修复了 search_context 把字面量 conversation_id "current"(参数描述承诺的默认值)误当外部会话查询而报 unknown session 的问题——在唯一的路由决策点(decompress-shared.ts:184)让 "current"(任意大小写)回落到当前会话;已验证回归测试修复前必现、修复后通过,diff 干净、本地与 CI 全绿,可以合并。 |
What changed
executeSearchContextTarget(src/decompress-shared.ts) only treated an empty id or an id exactly equal to the current session id as "the current session"; any other value went straight to the cross-session foreign lookup (resolveForeignSessionState). So when a model followed the parameter description verbatim and sentconversation_id: "current"— the description atsrc/compress-tool.ts:84promises "Defaults to the current conversation" — the call failed with[search_context FAILED: unknown session "current"].The fix makes the literal
"current"(any case) resolve to the current session, honoring the documented default:Why it's safe
Real session ids are generated (
pfa-*store keys /mNNNNN-style refs), so shadowing a hypothetical session literally namedcurrentis negligible. Cross-session search (#841) for real ids is unchanged — the new branch only fires for the exact word "current".Tests
Added a self-contained regression case in
tests/search-context-cross-session.test.ts:conversation_id: "current"/"Current"/"cUrReNt"all equal direct current-session execution (before the fix each returnedunknown session "current");FAILEDon the alias.Pre-flight (rebased onto current master)
npm run typecheck— greennpm test— 2199 pass / 0 fail (2 skipped =ACP_TEST_E2E-gated e2e)npm run build— successStandalone minimal PR split out of #1121 per the owner's split directive there.
Fixes #1125