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 efa0a36
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: vendor/intx-inference/PATCHES.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -508,9 +508,37 @@ segments in the working tree, and `load()` (the path an interrupt-rebuild
508
508
takes) reads them, so the tool exchange survives a rebuild exactly as the
509
509
old per-batch commit did.
510
510
511
+
The loop's `resume.tool_result` step (a parked call rejected, timed out or
512
+
dropped without running) writes turns the same way, through the shared
513
+
`writeTurnsIfChanged` helper `executeTools` also calls, so a rebuild before
514
+
the next terminal loads the result. That closes the parked approval only
515
+
because Corbits' optimized context store drops, on load, a pending operation
516
+
whose call has a `tool_result` in the turn log (`openPendingOperations` in
517
+
`src/session/optimized-context-store.ts`). The reactor does not clear the
518
+
record itself: a store that returns pending operations from metadata as last
519
+
committed, such as `@intx/storage-isogit`, reloads both the result and the
520
+
parked approval, and the re-armed gate's deadline adds a second result.
521
+
Upstream needs no equivalent while it commits every tool cycle. A staged
522
+
compact skips the write in both places; a parked approval cannot coincide
523
+
with one, since the suspend terminal commits and clears it.
524
+
525
+
`initiateShutdown` appends any `resume.tool_result` still queued behind the
526
+
abort (a decision the reactor accepted and removed from its pending set, but
527
+
never processed, since the loop serves `abort` first), before
528
+
`gates.shutdown()` clears the gate timers. It then writes turns once, only
529
+
when it appended something, inside a `try/catch` that reports a non-fatal
530
+
`reactor.error`, so a failing store cannot skip `reactor.done` or leak the
531
+
workdir lock. Approved calls (`resume.execute_tools`) are not flushed: one
532
+
that never ran stays parked on disk rather than gaining a result for a
533
+
tool that did not run. A flushed result closes the approval under the same
534
+
store dependency as the `resume.tool_result` write.
535
+
511
536
**Disposition:** Promotion candidate. Performance coalescing — collapses K
512
537
git commits per agentic turn to one deferred commit while preserving
513
-
rebuild-from-disk durability.
538
+
rebuild-from-disk durability. The `resume.tool_result` write and the
539
+
shutdown flush rely on the store closing an answered call's approval, which
540
+
upstream stores do not do, so promoting them also needs the reactor to clear
541
+
that pending operation when it writes the result.
514
542
**Removal path:** Upstream PR replacing the `executeTools` checkpoint with a
515
543
writeTurns-only segments touch and deferring the cycle commit to cycle
516
544
terminals.
@@ -750,7 +778,7 @@ revisit point is the next vendored sync (see `docs/VENDORING.md`).
750
778
| 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 |
751
779
| 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 |
752
780
| 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 |
753
-
| 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 |
781
+
| reactor-ts-tool-cycle-turns-only (supersedes reactor-ts-checkpoint-after-tool-cycle) |`executeTools`and the `resume.tool_result` step write turns to store segments only and defer the cycle commit to terminals | Alexander Guy <alexander.guy@pm.me> | This ledger (#reactor-ts-tool-cycle-turns-only) | Next vendored sync |
754
782
| 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 |
755
783
| 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 |
756
784
| 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