8000 feat(agentcore): add durable execution loop by Fodesu · Pull Request #89 · felinics/twilight · GitHub
[go: up one dir, main page]

Skip to content

feat(agentcore): add durable execution loop - #89

Merged
Fodesu merged 1 commit into
feat/agent-runtime-core-15-effect-recoveryfrom
feat/agent-runtime-core-16-loop
Oct 3, 2026
Merged

Fodesu merged 1 commit into
feat/agent-runtime-core-15-effect-recoveryfrom
feat/agent-runtime-core-16-loop

Conversation

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

Summary

Adds the first Run execution Loop. The Loop interprets persisted machine state, commits protocol transitions through the caller-owned RunStore, and hands external work to an Executor only after the corresponding start barrier has been accepted.

Design

Advance always reloads state and derives its next action through plan.Next; it does not keep authoritative Run state in memory. Open Runs are prepared through a decision Builder, with the request, digest, prompt token, consumed inputs, and frozen tool specs persisted in ModelStepPrepared. Prepared steps are withdrawn when new inputs make the request stale. Model and tool starts resolve optional durable targets, validate with the Executor, commit an effect identity, and then dispatch an immutable Assignment.

Tool scheduling honors the frozen parallel/sequential mode and maximum concurrency. Model results are converted into deterministic tool-call bindings: CallIDs derive from step and position, while provider IDs remain round-trip metadata. Malformed results use the configured retry bound; provider failures, cancellation, missing frozen values, and unknown outcomes map to distinct Run commands. Tool failures that may have crossed the external boundary become unknown rather than being retried as known failures.

Deliver matches an Outcome by EffectID against the currently Executing model step or tool call and drops stale outcomes without writing. Run supplies the blocking form, sharing a settlement Watcher, cancelling effects on ownership loss, and settling accepted results under detached control contexts. Per-Run locking prevents interleaved local drivers while allowing different Runs to proceed concurrently.

The implementation establishes the event/observation split: committed Run facts are durable authority; progress and lifecycle events are only observations.

@Fodesu
Fodesu added this pull request to stack #105 October 3, 2026 12:27
@Fodesu Fodesu changed the title feat/agent runtime core 16 loop feat(agentcore): add durable execution loop Oct 3, 2026
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-16-loop branch from c1a10a5 to c7f8819 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-16-loop branch from c7f8819 to 1d776c4 Compare October 3, 2026 17:04
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-16-loop branch from 1d776c4 to 7a2c998 Compare October 3, 2026 17:11
@Fodesu
Fodesu merged commit 50febe4 into main Oct 3, 2026
8 checks passed
@Fo
747E
desu
Fodesu deleted the feat/agent-runtime-core-16-loop 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