Commit Graph

5 Commits

Author SHA1 Message Date
97a472c5f8 Fix memory_compact deadlock: return immediately, fire summarize via setTimeout
The tool was awaiting ctx.client.session.summarize() but compaction
can't start until the tool returns control. Now returns right away
and schedules the summarize call via setTimeout(0).
2026-04-21 11:47:34 +00:00
f822d93662 Collapse 8 tools to 2: memory router + memory_compact
All read-only operations now dispatch through a single memory tool that
routes by {tool: "name", args: {...}}. This cuts visible tool count from
8 to 2, significantly reducing context bloat for small models. The
memory_compact tool remains separate as it is a write/mutation operation.
2026-04-21 11:17:34 +00:00
38b84b8163 Add memory_compactions tool for browsing compaction checkpoints
Queries compaction-type parts in the DB to find session compaction
events, then retrieves the summary text from the adjacent assistant
message. Presents compactions as navigable checkpoints with list and
read modes.
2026-04-21 09:20:53 +00:00
f7bb7f94cf Replace sqlite3 subprocess with bun:sqlite native driver, add AGENTS.md and tests
Rewrites history/queries.ts to use bun:sqlite with readonly mode and
parameterized queries instead of spawning sqlite3. Consolidates threshold
constants into a single source of truth. Adds AGENTS.md as the canonical
operational doc, moves architecture to docs/, and adds initial test suite.
2026-04-20 16:14:35 +00:00
9a42dcfb94 Initial scaffold: open-memory plugin for OpenCode
- Plugin entry point with hooks: experimental.session.compacting,
  experimental.chat.system.transform, event
- Context tracker: SSE-based token tracking per session with
  green/yellow/red/critical thresholds
- Tools: memory_context, memory_compact, memory_summary,
  memory_sessions, memory_messages, memory_search, memory_plans
- History module: sqlite3 queries + markdown rendering
- Compaction: improved prompt emphasizing self-continuity
- Research docs: ARCHITECTURE.md + opencode-memory reference
2026-04-20 14:55:20 +00:00