Repository navigation
feat(core): E10 loop guard + E11 secret redaction - #25
Merged
Merged
Conversation
- E10: fingerprint consecutive identical tool calls (name + canonical JSON input); trip at LOOP_TRIP_AFTER=3 with durable error entry and TurnOutcome::LoopDetected. Budget test updated to use distinct inputs so it exercises the ceiling, not the guard. - E11: scrub() now also applied to message text in request_body — the API key never leaves the machine in cleartext; durable log untouched. - CLI: report LoopDetected with resume hint (exit code 7). Closes #22, closes #23
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 7, 2026
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.
What
Two small, independent guards adopted from oh-my-pi research (#22, #23):
TurnOutcome::LoopDetectedwith a durableerrorentry explaining the trip. Guard resets on any different call. Budget ceiling (MAX_STEPS=32) unchanged — now covered by a test using distinct inputs per step.scrub()was already applied to provider error strings; it is now also applied to message text inrequest_body(). If a user message accidentally quotes the API key, it never reaches the provider in cleartext. The durable log keeps the original text (redaction is wire-only).loop detectedmessage with a resume hint (exit code 7).Why
Both land in the "cheap, high-value" bucket from the oh-my-pi deep-dive: loop guard prevents burning the step budget on a stuck model repeating the same call; secret redaction closes a real leak path before more tools can see environment content.
Testing
cargo test --workspace: 81/81 pass (69 core + 12 CLI), incl. 3 new loop-guard tests (trip, durable record + sandwich count, reset-on-different-input) and 2 new redaction tests (key absent from wire body, durable log untouched).cargo clippy --workspace --all-targets: 0 warnings.cora review: no findings.Closes #22, closes #23