Skip to content

fix: persist budget checkpoint, reset degraded memory, document inert knobs - #4

Open
AsherDLL wants to merge 4 commits into
mainfrom
fix/core-config-and-memory-findings
Open

fix: persist budget checkpoint, reset degraded memory, document inert knobs#4
AsherDLL wants to merge 4 commits into
mainfrom
fix/core-config-and-memory-findings

Conversation

@AsherDLL

Copy link
Copy Markdown
Member

Summary

Four small, independently-committed fixes to the neutral core (src/arema),
each verified. Two are real bugs; two are documentation-only.

Commit Type What
fix(context) Bug Context-budget checkpoints were never persisted — the writer used context_budget:checkpoint while the after-agent recorder read SessionKeys.CONTEXT_CHECKPOINT. Bind the key to the canonical session key so writer == reader.
fix(memory) Bug MemoryService._degraded never reset, so one transient write failure marked /status degraded for the whole process lifetime. Clear it on a successful write.
docs(config) Docs Note that memory_enabled and context_max_list_items are currently inert (read nowhere in src).
docs Docs Note the pre-arema-domain-reset-2026-07-21 recovery tag isn't present in this squashed public mirror.

Two findings from the earlier review were already resolved on main and are not included (README lists xAI; MCP is wired via build_mcp_toolset).

Testing

  • New writer→reader regression test for the checkpoint key contract.
  • New fail-then-recover regression test for the degraded-memory latch.
  • Full suite green: 2480 passed, 1 skipped; ruff, ruff format --check, and mypy --strict all clean.

🤖 Generated with Claude Code

enforce_context_budget wrote the hard-limit checkpoint under
"context_budget:checkpoint", but make_checkpoint_recorder reads
SessionKeys.CONTEXT_CHECKPOINT ("_runtime:context_checkpoint"), so the
after-agent recorder never saw a real budget checkpoint and it was never
persisted. Bind CHECKPOINT_STATE_KEY to the canonical session key so the
writer and reader agree; the payload shape was already compatible.

Adds a writer->reader regression test.
MemoryService._degraded was set on a failed safe_append_event but never
reset, so a single transient store failure marked health() (and /status)
degraded for the whole process lifetime even after the store recovered.
Clear the flag on a successful write so health reflects current
writability. Adds a fail-then-recover regression test.
Both settings are documented in .env.example but read nowhere in src:
composition always builds a store keyed off memory_backend, and list
truncation uses the per-tool OutputPolicy.max_list_items. Note that they
are currently inert so the knobs are not mistaken for live controls.
The plan references pre-arema-domain-reset-2026-07-21, but this mirror's
history is squashed from Initial Commit so the tag isn't present here.
Add a note so the reference isn't read as a live, resolvable pointer.
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