Repository navigation
chore - add automatic resource-aware reflection - #196
Merged
Merged
Conversation
Register resource observations on both hosts and add five-minute tool-completion reflection with immutable concurrent claims. Preserve measurement coverage and lag, document costs and evidence limits, and use the installed Codex in tooling.
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
Mantra previously required resource environment variables and separately configured hooks. It now registers resource observations automatically on Claude Code and Codex, and reminds the model to reconsider the requested outcome, progress and uncertainty when choosing to continue, change approach or finish.
Startup/clear previews later reflection. Prompts, resume and compaction deliver self-contained guidance; tool completion adds reflection about every five minutes. Prompts/session starts reset the cadence, subagent receipts are excluded, and Stop remains passive. Immutable claims prevent duplicate reminders under concurrent completion; cadence-storage failures preserve resource context. Mantra is bumped to 0.11.0.
Repository CI and probes use the installed Codex and report its actual version, without a package-version selector. Documentation and archived synthetic evidence describe the final behavior and its limits.
Test Plan
npm test: 650 tests in 25 suites, including 89 Mantra tests and deterministic concurrency/fault regressions.npm run validate:plugins, strict Claude marketplace/Mantra validation, installed Codex isolated installation, andgit diff --check: passed.Limitations
No demonstrated judgment improvement, causal resource savings or minimum model/effort. The paired clarification case remained unresolved in both arms; the final cadence has delivery evidence rather than a new behavioral comparison. Five minutes is provisional, not a task deadline or stopping quota.
Token observations are cumulative, partial and potentially delayed; transcripts over 2 MiB yield unknown token values. Pre/post collection measured about 95–110 ms per tool locally, and per-tool observation text accumulates in history. Periodic claims require hard-link support, and a crash after publication can omit one reminder. See
docs/reviews/mantra-resource-reflection.mdandmantra/context/resources.mdfor evidence and the current contract.