Repository navigation
Conversation
Fodesu
force-pushed
the
feat/agent-runtime-core-14-turn-driver
branch
from
October 3, 2026 14:43
9274835 to
cf2d881
Compare
8000
Fodesu
marked this pull request as ready for review
October 3, 2026 14:46
Fodesu
force-pushed
the
feat/agent-runtime-core-14-turn-driver
branch
from
October 3, 2026 17:04
cf2d881 to
72fddd3
Compare
Fodesu
force-pushed
the
feat/agent-runtime-core-14-turn-driver
branch
from
October 3, 2026 17:11
72fddd3 to
f8eecb8
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
Introduces the Turn-facing decision and planning layer around a Run. The new
turn,decision,history,inbox,preset, andrun/planpackages separate logical Turn facts from Run execution facts and give the owner deterministic inputs for the next action.Design
A Turn owns
started,failed, andsupersededevents on a keyed inherited stream. Its surface joins those facts withchatlog.input_deliveredandrun_ended: the Run remains the authority for execution termination, while the Turn projection records ownership, input membership, settlement, replacement, and terminal status. Identity helpers derive plan, Run, cancellation, and Turn-related command IDs from stable canonical preimages.AgentPresetfreezes the decision identity: model, tool contracts, prompt-builder reference, scheduling, malformed-result retry budget, and system prompt. Registries retain digest-addressed versions and resolve only matchingPresetRefvalues.decision.Builderreturns a frozen request plus consumed input IDs, freshness token, and persisted tool specs;plan.Nextinterprets machine state into exactly one ephemeral action, including replanning when inputs arrive after preparation. Recovery planning turns lost model executions into withdrawal and lost tool executions into explicit unknown failures.The durable inbox provides per-session sequence ordering, idempotent command IDs, conflict detection, pending enumeration, and one-shot resolution. History scans committed events to calculate Turn-inclusive and Turn-exclusive fork boundaries and active-at-commit checks.
Testing
Tests cover Turn projection and wire behavior, preset digest/registry behavior, inbox map conformance, and planning/recovery invariants.