8000 feat(agentcore): add effect recovery and redispatch contracts by Fodesu · Pull Request #88 · felinics/twilight · GitHub
[go: up one dir, main page]

Skip to content

feat(agentcore): add effect recovery and redispatch contracts - #88

Merged
Fodesu merged 1 commit into
feat/agent-runtime-core-14-turn-driverfrom
feat/agent-runtime-core-15-effect-recovery
Oct 3, 2026
Merged

Fodesu merged 1 commit into
feat/agent-runtime-core-14-turn-driverfrom
feat/agent-runtime-core-15-effect-recovery

Conversation

@Fodesu
@Fodesu Fodesu commented Oct 3, 2026 •
Copy link
Copy Markdown
Member

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.Assignment is 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; Watcher treats them as a wake-up and rereads the durable outcome, polling and reconnecting so missed notices do not lose completion.

Reconciler compares 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 records planned before dispatch and dispatched after 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.

@Fodesu
Fodesu added this pull request to stack #105 October 3, 2026 12:27
@Fodesu Fodesu changed the title feat/agent runtime core 15 effect recovery feat(agentcore): add effect recovery and redispatch contracts Oct 3, 2026
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-15-effect-recovery branch from f93b040 to d168455 Compare October 3, 2026 14:43
@Fodesu
Fodesu marked this pull request as ready for review October 3, 2026 14:46
@Fodesu
Fodesu removed this pull request from stack #105 October 3, 2026 16:13
@Fodesu
Fodesu added this pull request to stack #107 October 3, 2026 16:16
@Fodesu
Fodesu removed this pull request from stack #107 October 3, 2026 16:34
@Fodesu
Fodesu added this pull request to stack #108 October 3, 2026 16:37
@Fodesu
Fodesu removed this pull request from stack #108 October 3, 2026 16:51
@Fodesu
Fodesu added this pull request to stack #110 October 3, 2026 16:55
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-15-effect-recovery branch from d168455 to 010aae6 Compare October 3, 2026 17:04
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-15-effect-recovery branch from 010aae6 to 5c1d80b Compare October 3, 2026 17:11
@Fodesu
Fodesu merged commit 6dc05ac into main Oct 3, 2026
4 checks passed
@Fodesu
Fodesu deleted the feat/agent-runtime-core-15-effect-recovery branch October 5, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0