Repository navigation
feat(agentcore): add effect recovery and redispatch contracts - #88
Merged
Fodesu merged 1 commit intoOct 3, 2026
Conversation
Fodesu
force-pushed
the
feat/agent-runtime-core-15-effect-recovery
branch
from
October 3, 2026 14:43
f93b040 to
d168455
Compare
Fodesu
marked this pull request as ready for review
October 3, 2026 14:46
Fodesu
force-pushed
the
feat/agent-runtime-core-15-effect-recovery
branch
from
October 3, 2026 17:04
d168455 to
010aae6
Compare
Fodesu
force-pushed
the
feat/agent-runtime-core-15-effect-recovery
branch
from
October 3, 2026 17:11
010aae6 to
5c1d80b
Compare
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.
Summary
Adds the process-independent effect and recovery contracts between a Run Loop and the component that performs model and tool effects. It also adds the redispatch ledger and reconciliation package needed when the owner, worker, or transport fails at different points in the handoff.
Design
effect.Assignmentis the immutable cross-process description of one effect. Its key is scoped by session, Run, and EffectID; its sealed body is either a model assignment or a tool assignment. Custom JSON encoding enforces that the discriminator and body agree. Outcomes likewise distinguish successful model results, known tool failures, unknown tool outcomes, cancellation, and executor recovery without exposing provider SDK types.Failure classification maps API status and transport errors to stable wire codes, with retryability derived from the code rather than duplicated state. Progress is explicitly provisional and lossy: generation resets invalidate earlier deltas, while sequence gaps expose eviction. Settlement notices carry only a key and stream position;
Watchertreats them as a wake-up and rereads the durable outcome, polling and reconnecting so missed notices do not lose completion.Reconcilercompares Run state, executor attachment state, and the redispatch ledger. Active or terminal attachments are kept, orphaned records are deferred or recovered, and missing records are either disposed or redispatched according to explicit policy. Redispatch recordsplannedbefore dispatch anddispatchedafter acceptance, so a crash between those operations reoffers the same attempt without consuming another budget slot. Disposal aborts the key before issuing Run recovery.Testing
Tests cover classification, sealed assignment/result behavior, replay policy encoding, progress and settlement contracts, redispatch folding, idempotency, fencing, and recovery dispositions.