Skip to content

fix: build determinism + loop-guard poll exemption + provider-failure recovery (#106 #85 #84) - #140

Merged
ajianaz merged 1 commit into
developfrom
fix/batch-106-85-84
Sep 29, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/batch-106-85-84

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What

Three live-mission findings fixed together (all from the parallel-session wave):

  1. build: Cargo.lock ignored + floating rmcp req — local and CI can resolve different rmcp APIs (ClientConfig) #106 — Cargo.lock committed (rmcp pinned at verified 3.4.0), removed from .gitignore
  2. Loop guard trips on legitimate repeated job_poll while a detached job runs #85 — loop-guard poll exemption: job_poll identical-input streaks trip at 120 instead of 3
  3. Provider 502 mid-turn wedges session at pc=Planning; recovery is interactive-only #84 — terminal provider failures settle the turn (Planning→Final + durable error) — resume <id> "prompt" just works

Why

Changes

  • turn.rs: POLL_LOOP_TRIP_AFTER = 120 + is_poll_tool; provider-failure path commits Planning→Final after the durable error record
  • turn_loop.rs tests: 25-identical-polls pass / non-poll still trips at 3; provider-failure lands Final + next turn drives; mid-flight-refusal test constructs its wedge directly (CAS seq ordering fixed)
  • .gitignore / Cargo.lock: lock committed

Testing

Closes #106, closes #85, closes #84.

/// keeps polling far past any sane job-wait budget. 120 polls ≈ hours
/// of attached waiting; a real loop still trips well before token ruin.
pub const POLL_LOOP_TRIP_AFTER: usize = 120;

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

… 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
ajianaz force-pushed the fix/batch-106-85-84 branch from c94e9b0 to feaa6c9 Compare September 29, 2026 02:36
@ajianaz
ajianaz merged commit 146f9e2 into develop Sep 29, 2026
16 checks passed
@ajianaz
ajianaz deleted the fix/batch-106-85-84 branch September 29, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants