Changeset 0.15.1 (#73)

This commit is contained in:
2026-02-27 00:12:46 +00:00
parent e663104575
commit 1370d701af
7 changed files with 693 additions and 16 deletions

View File

@@ -786,28 +786,30 @@ summary. After compaction (v0.15.0) or in long conversations, the model
may need to re-read source material. These tools bridge that gap.
**`attachment_recall` tool**
- [ ] `attachment_recall(attachment_id)` — re-reads attachment content from storage
- [ ] Images: re-inject as base64 content part (vision gating still applies)
- [ ] Documents: return extracted text
- [ ] Security: scoped to current channel's attachments only
- [ ] Extend `ExecutionContext` with optional storage backend reference
- [ ] Tool definition includes attachment list hint so model knows what's available
- [x] Two-action design: `list` (channel metadata) + `read` (content by ID)
- [x] Images: base64 data URI from object storage (10MB cap)
- [x] Documents: return `extracted_text` from DB
- [x] Security: channel-scoped — attachment must belong to `ExecutionContext.ChannelID`
- [x] Late registration: only registered when `objStore` is non-nil
- [x] Category: `context` (groups with conversation_search in toggle UI)
**`conversation_search` tool**
- [ ] Keyword search over compacted/archived messages in current channel
- [ ] Returns matching message excerpts with timestamps
- [ ] Useful post-compaction when summary dropped details the user asks about
- [x] Full-text keyword search via `plainto_tsquery` over channel messages
- [x] `ts_headline` for highlighted excerpts with `**` markers
- [x] Role filter: `all`, `user`, `assistant`
- [x] Scoped to current channel, excludes soft-deleted messages
- [x] On-the-fly `to_tsvector` (no migration needed — channel-bounded)
**Token estimator improvements**
- [ ] Include attachment token estimates in context counter
- [ ] Images: use provider-specific sizing rules (e.g. tile-based for OpenAI)
- [ ] Documents: count extracted text tokens
- [ ] Staged attachments reflected in input token counter before send
- [x] `Tokens.estimateAttachments()`images ~765 tokens, docs by text length
- [x] Staged attachment tokens reflected in input counter before send
- [x] Context percentage includes attachment estimates
**KB auto-injection** (depends on: knowledge bases v0.14.0, compaction v0.15.0)
- [ ] Pre-pend top-K KB results to system prompt (automatic, no tool call needed)
- [ ] Context budget aware: skip injection if context already near limit
- [ ] Per-channel toggle: tool-only vs auto-inject vs both
- _(deferred — requires adding embedder to CompletionHandler, latency budgeting)_
---