Skip to content

fix: say when the store stops saving - #46

Open
rbartoli wants to merge 1 commit into
mainfrom
fix/show-store-write-failures
Open

rbartoli wants to merge 1 commit into
mainfrom
fix/show-store-write-failures

Conversation

@rbartoli

Copy link
Copy Markdown
Owner

This is L3 from the 2026-10-24 security review.

The mod store holds 4 MiB of JSON in all, and $.store.set rejects once a write would pass that. The guard caught each failed write and logged it only to the debug log. Once publish failed, other sessions stopped counting this session's agents, so the machine-wide caps undercounted with no visible sign. (Today's store is 135 KB, so this is far off, but the failure was silent.)

Changes

  • Every store write in the adapter (peer record, last-active time, journal) goes through a new save(), which records the last failure and clears it once a write works.
  • While writes fail, the status line adds store not saving: other sessions can't count this one, and /agent-guard status adds a Store: line with the error. Both clear on the next successful write, and the status line redraws when the state changes.
  • The test harness gets a storeFull switch that makes store.set reject.

Nothing about the gates changes.

Test plan

  • New test: with writes failing, the status line and /agent-guard status say so; once a write works again, the line clears
  • claude plugin test . on 2.1.310: 104 pass. With hooks/register.ts and core/status.ts stashed, the new test fails.
  • claude plugin validate . --strict and tsc are clean
  • CI is green

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