Repository navigation
fix: scan-3 triage — all 10 MAJOR findings fixed (Wave 1, issue #132) - #135
Merged
Merged
Conversation
1. turn.rs resume: InvalidToolArgs intents (input = bare JSON string) are re-settled as errors on replay — never executed with the raw string. The Guarded-replay block (approver consult, pre-hook deny) and the execution now live inside the object-only else branch. 2. turn.rs resume: opt-in pre-hooks apply on Guarded replay too (the hook-deny was bypassable by crashing before settlement). 3. subprocess: sh -c payloads starting with '-' are scanned (leading dash on the program token is dash-stripped conservatively). 4. storage: compact() marks the session poisoned when the post-rename reopen fails — commits fail loudly instead of vanishing into an unlinked inode. 5. openai: tool settlements verify the parent entry is an INTENT before emitting a tool message on the wire. 6. serve: request-line + headers capped at 32 KiB (pre-auth memory DoS). 7. session_host: new_session_id gains a monotonic counter suffix (ms+pid collisions silently overwrote sessions). 8. serve: sessions capped at 256 with non-busy eviction (long-running daemon growth). 9. main.rs: global --workspace/--memory now flow into serve/acp/mcp as fallbacks (previously silently ignored). 10. test renamed to match verified behavior (both abort flavors). MINOR/INFO findings (test hygiene, non-unix paths, evals python) were addressed in the same pass where touched; the remainder are cosmetic and tracked on the branch.
| let oldest = sessions | ||
| .map | ||
| .iter() | ||
| .filter(|(_, st)| !*st.busy.lock().expect("busy lock")) |
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
CodeCora scan round-2: the eviction filter called busy.lock().expect() while holding the sessions map lock — a turn mid-flight (busy held for the entire LLM call) would block POST /sessions for the turn's whole duration, stalling every other route that needs the map. try_lock now skips locked-busy sessions without blocking; all-busy at capacity returns 503.
ajianaz
added a commit
that referenced
this pull request
Sep 29, 2026
… provider-failure recovery (#106, #85, #84) #106 — Cargo.lock committed (rmcp pinned at the verified 3.4.0) and removed from .gitignore: CI resolved fresh every run while local machines carried stale locks — 'what compiles' depended on WHEN you resolved, not the commit. Fresh clone → cargo build --workspace now reproduces CI's dependency set deterministically (verified from a clean clone). #85 — loop guard poll exemption: job_poll with identical input is the CORRECT pattern (arguments name the job; the RESULT carries the change) — the old guard aborted healthy 14-minute-render missions at the 3rd poll. Poll tools now trip at 120 (patience ceiling, still guards a true stuck-poll); non-poll tools trip at 3 unchanged. Regression test: 25 identical polls complete; identical non-poll calls still trip. Live-verified: a 16s detached job polled 6 times to completion, no trip. #84 — terminal provider failures now SETTLE the turn (Planning→Final with a durable error record) instead of wedging at pc=Planning: a plain 'tole resume <id> "prompt"' works next, matching the E5 crash-resume guarantee. (The malformed-intent replay guard — the other half of the original wedge — landed with the scan-3 triage #135.) Tests updated to the new contract: provider-failure lands Final and the follow-up turn drives cleanly; the mid-flight refusal test now constructs its wedge state directly. Live-verified: connection-refused failure → pc Final → prompt resume answers RECOVERED.
ajianaz
added a commit
that referenced
this pull request
Sep 29, 2026
… provider-failure recovery (#106, #85, #84) (#140) #106 — Cargo.lock committed (rmcp pinned at the verified 3.4.0) and removed from .gitignore: CI resolved fresh every run while local machines carried stale locks — 'what compiles' depended on WHEN you resolved, not the commit. Fresh clone → cargo build --workspace now reproduces CI's dependency set deterministically (verified from a clean clone). #85 — loop guard poll exemption: job_poll with identical input is the CORRECT pattern (arguments name the job; the RESULT carries the change) — the old guard aborted healthy 14-minute-render missions at the 3rd poll. Poll tools now trip at 120 (patience ceiling, still guards a true stuck-poll); non-poll tools trip at 3 unchanged. Regression test: 25 identical polls complete; identical non-poll calls still trip. Live-verified: a 16s detached job polled 6 times to completion, no trip. #84 — terminal provider failures now SETTLE the turn (Planning→Final with a durable error record) instead of wedging at pc=Planning: a plain 'tole resume <id> "prompt"' works next, matching the E5 crash-resume guarantee. (The malformed-intent replay guard — the other half of the original wedge — landed with the scan-3 triage #135.) Tests updated to the new contract: provider-failure lands Final and the follow-up turn drives cleanly; the mid-flight refusal test now constructs its wedge state directly. Live-verified: connection-refused failure → pc Final → prompt resume answers RECOVERED. Co-authored-by: ajianaz <[email protected]>
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
All 10 MAJOR findings from the 2026-09-28 full cora scan (67 files), validated against the code and fixed with regression coverage where testable:
Why
The code landed after the previous full scan (#92/#93) and had never been scanned — the findings live in code written during the scan-3 wave, the ACP host, the MCP server, and the HTTP daemon.
Changes
sh -cpayloads starting with-are scanned (dash-stripped program lookup, conservative)compact()marks the session poisoned when the post-rename reopen fails — commits fail loudly instead of vanishing into an unlinked inodenew_session_idgains a monotonic counter suffix (ms+pid collisions silently overwrote sessions)--workspace/--memorynow flow into serve/acp/mcp as fallbacks (previously silently ignored)Closes #132 (Wave 1). Wave 2 (serve hardening) is #133; release #134.
Testing