fix: persist budget checkpoint, reset degraded memory, document inert knobs - #4
Open
AsherDLL wants to merge 4 commits into
Open
fix: persist budget checkpoint, reset degraded memory, document inert knobs#4AsherDLL wants to merge 4 commits into
AsherDLL wants to merge 4 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four small, independently-committed fixes to the neutral core (
src/arema),each verified. Two are real bugs; two are documentation-only.
fix(context)context_budget:checkpointwhile the after-agent recorder readSessionKeys.CONTEXT_CHECKPOINT. Bind the key to the canonical session key so writer == reader.fix(memory)MemoryService._degradednever reset, so one transient write failure marked/statusdegraded for the whole process lifetime. Clear it on a successful write.docs(config)memory_enabledandcontext_max_list_itemsare currently inert (read nowhere insrc).docspre-arema-domain-reset-2026-07-21recovery tag isn't present in this squashed public mirror.Two findings from the earlier review were already resolved on
mainand are not included (README lists xAI; MCP is wired viabuild_mcp_toolset).Testing
ruff,ruff format --check, andmypy --strictall clean.🤖 Generated with Claude Code