Repository navigation
session-search: multi-word queries are phrase-only; event reads carry stream telemetry #13215
zhengyuantai
started this conversation in
Ideas
Replies: 1 comment
|
AND 建议补个反例:两条消息各含一个词,别拼成“同一事件命中”;再单测 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Two friction points in the experimental session-search bundle (
@deepseek-ai/dsh-experimental-session-search), measured on dsh 0.2.2-rc.2 (macOS) against a workspace with 22 sessions and about 14 MB of JSONL logs. Both have small patches; I am posting here becauseCONTRIBUTING.mdsays external pull requests are not accepted at the moment. Happy to reshape either one to whatever the team prefers.1. Multi-word queries are a single FTS5 phrase, so they usually return nothing
quoteFtsData()insession-query-sqlite/src/query.tswraps the entire query in one phrase:A query like
CBETA 敦煌therefore requires the two tokens to be adjacent, in that order. The tool description says "literal full-text query", which reads like AND to most callers, and the result is an empty result set even when one event contains both words.Measured:
CBETA敦煌CBETA 敦煌两城镇尉迟寺两城镇 尉迟寺Splitting unquoted whitespace into terms and joining them with
ANDmakes the last row return 3 sessions while"两城镇 尉迟寺"(quoted) still behaves as a phrase. That is a semantic change, so the safer variant is an explicitoperator: 'phrase' | 'and'input (default unchanged).Separately: CJK text is tokenized by
unicode61as whole runs, so渠道does not match文献渠道清单. That is a different problem (tokenizer/bigram strategy) and is not addressed by the patch.2.
session_event_readis dominated by stream telemetryThe tool returns the full raw event, including
stream,usageandreplayState. In one measured assistant message the JSON was about 18k characters; roughly 15k of that was stream chunks. The useful content is a small fraction, and it can consume a large share of a context window.Omitting those three fields by default and adding
full: trueto keep them drops the same read to about 2.6k characters.Patch
Both changes are in a fork branch (rebased on current
master):https://github.com/zhengyuantai/deepseek-harness/tree/session-event-read-compact
It contains the
session_event_readchange only (4 files, +20/−3). The AND-query change is kept separate and can be shared as a diff, or reworked as an opt-in flag, whichever the team prefers.All reactions