You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aad53cf
Browse filesBrowse the repository at this point in the historyBrowse files
fix(reactor): persist resolved approval removal with its result turn
Tool cycles write turns only and defer metadata to the next terminal
commit. An approved or rejected call drops its pending operation from
memory, but a teardown before that terminal left it in metadata.json; a
reactor rebuilt from the store re-armed the answered call's gate and, at
the original deadline, appended a second tool_result for the same call
id, which the prompt tripwire rejects.
The turns-only write now also writes metadata when a resolved approval
changed the pending operations, so the removal lands with the turn that
answers the call. Writing metadata in tryCorrelate instead would drop
the op before the re-dispatched result is on disk, leaving a dangling
tool_use with no gate to answer it. Cycles that leave pending operations
untouched still skip the metadata write.
Copy file name to clipboardExpand all lines: vendor/intx-inference/PATCHES.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -469,6 +469,23 @@ segments in the working tree, and `load()` (the path an interrupt-rebuild
469
469
takes) reads them, so the tool exchange survives a rebuild exactly as the
470
470
old per-batch commit did.
471
471
472
+
Pending-operation durability contract: a resolved approval's pending
473
+
operation leaves `metadata.json` together with the turn that answers the
474
+
parked call, never later. `tryCorrelate`'s redispatch and `error_result`
475
+
paths and `onGateCleared`'s timeout path set `pendingOperationsChanged`
476
+
when they drop the op from memory; the shared turns-only write
477
+
(`writeCycleTurns`, called from the `executeTools` tail and from the loop's
478
+
`resume.tool_result` branch right after the synthetic error result is
479
+
appended) writes metadata after the turns whenever that flag is set, and
480
+
`writeMetadata` clears it. Without this, a teardown between the redispatch
481
+
and the next terminal left the op on disk; a reactor rebuilt from that store
482
+
re-armed the answered call's gate at its original deadline and injected a
483
+
second `tool_result` for the same call id, failing the well-formedness
484
+
tripwire. Tool cycles that leave pending operations untouched still write
485
+
turns only, so the coalescing savings hold. A crash between the turns write
486
+
and the metadata write can still leave a stale op for an answered call;
487
+
that narrower window is the rehydration guard's concern, not this patch's.
488
+
472
489
**Disposition:** Promotion candidate. Performance coalescing — collapses K
473
490
git commits per agentic turn to one deferred commit while preserving
474
491
rebuild-from-disk durability.
@@ -710,7 +727,7 @@ revisit point is the next vendored sync (see `docs/VENDORING.md`).
710
727
| errors-ts-classify-abort-reason | Add optional `reason` param to `classifyAbortError`, carried as `raw: { origin }`| Alexander Guy <alexander.guy@pm.me> | This ledger (#errors-ts-classify-abort-reason) | Next vendored sync |
711
728
| harness-ts-inactivity-on-semantic-progress | Gate the inactivity watchdog's re-arm on parsed events, not raw SSE bytes | Alexander Guy <alexander.guy@pm.me> | This ledger (#harness-ts-inactivity-on-semantic-progress) | Next vendored sync |
712
729
| reactor-ts-correlating-ids-leak | Wrap `tryCorrelate` in try/finally so `correlatingIds` clears on success dispatch paths | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-correlating-ids-leak) | Next vendored sync |
713
-
| reactor-ts-tool-cycle-turns-only (supersedes reactor-ts-checkpoint-after-tool-cycle) |`executeTools` writes turns to store segments only and defers the cycle commit to terminals | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-tool-cycle-turns-only) | Next vendored sync |
730
+
| reactor-ts-tool-cycle-turns-only (supersedes reactor-ts-checkpoint-after-tool-cycle) |`executeTools` writes turns to store segments only and defers the cycle commit to terminals; metadata rides along only when a resolved approval dropped a pending operation| Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-tool-cycle-turns-only) | Next vendored sync |
714
731
| reactor-ts-skip-unchanged-history (+ reactor-ts-last-written-turns-revision) | Skip `contextStore.writeTurns` when `getTurnsRevision()` is unchanged | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-skip-unchanged-history) | Next vendored sync |
715
732
| reactor-ts-compact-publish-then-memory | Persist compact blobs, stage `writeTurns`, commit, then `replaceTurns` so memory stays on the old generation until publication | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-compact-publish-then-memory) | Next vendored sync |
716
733
| reactor-ts-after-checkpoint-director-only | Gate `afterCheckpoint` on `hasOverride` so auto-commits do not emit it | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-after-checkpoint-director-only) | Next vendored sync |
0 commit comments