Files
buzz/crates/buzz-agent/src
Michael Neale 626b079fa3 fix(buzz-agent): keep agent conversations out of the user's goose session DB
goose's SessionManager::instance() resolves to Paths::data_dir(), so
buzz-agent was persisting every turn into the same sessions.db as the
user's own goose CLI history. On this machine that file is already 132 MB
and 892 sessions, with desktop agent turns from minutes ago interleaved
into it.

Not a correctness bug -- SQLite handles concurrent writers -- but agent
conversations do not belong in a human's personal session history, and
buzz-agent should not grow a shared file it does not own and cannot prune.

Resolves its own directory instead: BUZZ_AGENT_SESSION_DIR when absolute,
else <data-dir>/buzz-agent, else goose's singleton. A relative env value
is ignored rather than resolved against the agent's CWD, which is the
user's workspace.

Deliberately not GOOSE_PATH_ROOT: that would move goose's config and
keyring lookups too, and provider configuration should keep resolving
where goose puts it.

Resolved once behind a OnceLock -- SessionManager::new builds its own
SQLite pool, so a per-session call would open a pool per session against
the same file.

Verified: with BUZZ_AGENT_SESSION_DIR set, the turn's session lands in
that directory and the shared DB is untouched.

Co-authored-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
2026-08-11 18:23:53 +10:00
..
…