Skip to content

[Feature & Fix] Enhance session and history search and analysis - #39

Merged
wangxingjun778 merged 5 commits into
mainfrom
feat/stream_loop
Aug 12, 2026
Merged

[Feature & Fix] Enhance session and history search and analysis#39
wangxingjun778 merged 5 commits into
mainfrom
feat/stream_loop

Conversation

@wangxingjun778

Copy link
Copy Markdown
Member

No description provided.

Remove intermediate thinking flush from tool_started(). Thinking buffer
now accumulates silently during tool execution and renders as a single
panel at finish(). Eliminates N interleaved thinking panels between tool
audit lines, dramatically reducing visual clutter during long tasks.
During tool execution gaps, the spinner now shows a truncated thinking
preview (💭 analyzing...) that updates in-place instead of being invisible.
When a tool starts, spinner switches back to tool display. Final thinking
panel still renders at finish() for the complete record.
…y at finish)

The thinking buffer now flushes when the FIRST tool in a new batch starts
(checked via empty _active_tools), not at every tool_started (original noise)
and not only at finish (Phase 1 - invisible during execution).

Pattern: one thinking panel per LLM reasoning round, followed by that round's
tool audit lines. The user sees thinking progress throughout execution.
…OR semantics

P0: DuckDB FTS Chinese support
- FTS index: stemmer='none', stopwords='none', ignore='(\.|[^\w])+'
- CJK characters now properly indexed (no longer dropped by [^a-z] filter)
- Drop + rebuild on startup to ensure correct tokenization

P0: session_list tool
- New tool for browsing past sessions (titles/dates/summaries)
- No keywords needed — returns chronological list (limit=10, max=30)
- Registered alongside session_search

P0: conversation_sessions.summary column
- Schema migration: ALTER TABLE ADD COLUMN summary
- end_session() accepts summary parameter
- _persist_session_summary writes to both leap_memory and sessions table

P1: Memory search OR semantics + CJK bigram tokenization
- semantic.py: ILIKE AND → OR with overlap-ratio scoring
- _tokenize_for_search(): CJK bigram splitting (no jieba dependency)
- Applied to manager.py prefetch + engine.py _keywords_from_query

P1: session_search Chinese improvement
- _prepare_fts_query(): CJK chars split individually for BM25 matching
- Fallback: OR-based multi-keyword ILIKE (max 6 terms)

P2: System prompt three-tier recall guidance
- Layer 0 context → session_list → session_search (escalating specificity)
@wangxingjun778
wangxingjun778 merged commit fc4cb4b into main Aug 12, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant