fix(nodeagent): blank-sheet write deadlock + accrued doom-loop breaker#215
Merged
Conversation
…oop cap Live incident (room NRNXCFYJK5B, 2026-07-18): a first-user "create a Q3 variance sheet" command in a fresh authenticated prod room looped 11 model turns with every managed write blocked, wrote zero cells, and burned credits until manually cancelled. Root cause 1 — blank-sheet preflight deadlock: verify_workbook preflight required an existing integer version for every target cell, but first writes target cells that DO NOT EXIST yet; re-reading can never version them, so preflight returned needs_repair forever and the workflow guardrail blocked every write behind it. Fix: a missing version is a CREATE (the managed write path already defaults creates to baseVersion 0) — preflight passes and approves those ops at baseVersion 0; stale versions on existing cells still fail closed. (tests/verifyWorkbookBlankSheet.test.ts, 4 scenarios) Root cause 2 — breaker defeated by interleaving: the consecutive deterministic-failure cap resets when any unrelated call succeeds; the live loop alternated write(blocked) -> inspect(ok) -> verify(needs_repair) so the count never exceeded 1. Fix: accrued per-failure-key cap (6) that survives interleaving and terminates with an honest protocol_stall handoff naming the tool. (tests/deterministicFailureAccrual.test.ts) Floor: 2,515/2,515, typechecks clean (exit 0). PROCESS NOTE: this branch's convex functions were unintentionally pushed to zealous-goshawk-766 pre-review by `npx convex dev --once` (the CLI reads .env.local directly; `env -u CONVEX_DEPLOYMENT` does not isolate). Prod failure logs verified clean post-push; merging this PR reconciles git with what prod already runs, followed by a protocol-correct convex:deploy from main. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Scaffold Handoff — For Your Coding Agent
Immutability CheckMode: advisory ✅ No immutable files were modified in this branch. Changed Files
Needs Adversarial Review — Do NOT Apply YetThese proposals passed the reject check but have not been approved by
Safety Boundary
Immutable files (never modify):
Scaffold files (safe to modify):
|
…coverage Live re-verify of the blank-sheet fix (room NR44HTRXVCD) surfaced deadlock layer 2: instruction-derived required targets parse as A1 (Sheet!B6) while agent plans write structured room ids (r6__B), so missing_target_coverage returned needs_repair on every preflight regardless of plan quality — the model even tried writing "uses the fully qualified elementId ...!B6" into its own instruction to appease the checker. normalizeAddress now maps structured letter-column ids (r6__B, R12__aa) onto their A1 twin at the key-derivation choke point, so every target set and coverage comparison lands in one address space. Semantic column ids (r_rev__variance) have no A1 twin and pass through untouched. 70/70 across verifyWorkbookBlankSheet, workbookTaskIntelligence(+V2), and deterministicFailureAccrual; typecheck clean. Changed areas: - src - workbookTaskIntelligence structured-id A1 canonicalization - tests - verifyWorkbookBlankSheet target-coverage cases Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HomenShum
force-pushed
the
fix/live-agent-write-path
branch
from
July 18, 2026 10:15
5c2f2f6 to
d22b5d7
Compare
HomenShum
added a commit
that referenced
this pull request
Jul 18, 2026
…ebius (#216) The live-run probe (room NRNXCFYJK5B) showed every fresh room landing on the GLM-Nebius orchestrator route. This promotes moonshotai/kimi-k3 (1M context) to the front of the openrouter agent/chat/coding/judge/analysis/deepResearch preference ladders; z-ai/glm-5.2 is DEMOTED to a fallback, never dropped. - modelPricing: kimi-k3 added ($3/$15 per 1M, 1M ctx) so cost/receipts are non-zero and honest (getProviderForModel already routes moonshotai/* to OpenRouter, whose key ships in prod). - The live default is also env-driven (AGENT_ORCHESTRATOR_MODEL); that convex env flip is a separate, cost-bearing prod change staged after the P0 write-path fix (#215) deploys — NOT included here. Changed areas: - src - modelCatalog kimi-k3 pricing + openrouter preference reorder - tests - kimiK3Default pins priced/provider/lead-of-ladder - docs - ORCHESTRATOR_WORKER_ROUTING orchestrator model - README - routing prose + honest cost framing (caps, not stale $/job) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Live incident this fixes
Fresh authenticated prod room, first spreadsheet command -> 11 model turns, every
update_sheetblocked, zero cells written, credits burned until manual cancel.Full telemetry:
.qa/evidence/20260718-live-agent/(roomNRNXCFYJK5B).Two root causes, two fixes
verify_workbookpreflight demanded an existingversion for every target cell; first writes target cells that don't exist, re-reading
can never version them, so preflight failed forever and the guardrail blocked all
writes behind it. Missing version now = CREATE approved at
baseVersion 0(matchingthe write path's own contract); stale versions on existing cells still fail closed.
any interleaved success; the doom cycle (write blocked -> inspect ok -> verify
needs_repair) kept it at 1 forever. Added an accrued per-failure-key cap (6) that
terminates with an honest
protocol_stallhandoff naming the blocked tool.Verification
tests/verifyWorkbookBlankSheet.test.ts— 4 scenarios incl. fail-closed stale-versiontests/deterministicFailureAccrual.test.ts— interleaved loop terminates at exactly 6npm run floor: 2,515/2,515, exit 0Process disclosure
The convex functions on this branch reached
zealous-goshawk-766pre-review vianpx convex dev --once(the CLI reads.env.localdirectly;env -udoes notisolate — memory updated). Prod failure logs verified clean post-push. Merging
reconciles git with what prod already runs; a protocol-correct
convex:deployfrom main follows the merge. Live re-verification of the fix (fresh room, same
command, cells must land) is the close-out gate.
🤖 Generated with Claude Code