Repository navigation
Conversation
gmjneko
marked this pull request as ready for review
October 30, 2026 09:56
Contributor
|
/cc @Aias00 ptal |
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.
This pr implements the engine-neutral journal neutral contract and shared implementation. so maintainers can review whether the plan is appropriate.
Since I see that many follow-up tasks depend on this task, I am concerned that there may be aspects of the design here that I have not fully considered.
Relate to #125
Scope
argi-agent-coreagent.durablepackage withModelTurnRecorder,ModelTurnCodec, stable journal identity types, recovery policy types, documentation, and reference tests.Design
1. Separate journal preparation from storage coordination
ModelTurnRecorderis stateless. It prepares immutable journal entries and validates replay.ModelTurnCodechandles versioned payloads, request fingerprints, canonical tool arguments, and tool-definition fingerprints.RunStore.commit, leases, revisions, checkpoints, and snapshot updates.2. Use stable logical identities
Callers provide
Turn(runId, turnId)and restore the same identity during recovery.Tool plans are identified by their logical turn and response ordinal within the run. Provider-generated tool-call IDs and model attempt numbers do not change task identity.
Request fingerprints, model-call reservations, terminal responses, and tool plans are journaled. Request bodies are not persisted. Messages, generation options, and disclosed tool definitions participate in the request fingerprint.
3. Persist before invoking or dispatching
The reference execution sequence is:
A complete recorded result is replayed without another model call. Revision conflicts require reloading the snapshot and repeating replay before reserving another attempt.
4. Make recovery and re-asking explicit
Replay validates the run identity, request fingerprint, entry types and versions, and the complete tool-plan set. Inconsistent or incomplete records fail closed.
ModelTurnAttemptPolicy.DEFAULTusesFAIL_CLOSEDwith one total model-call reservation. Recovery re-asking is allowed only when the caller explicitly usesMissingResponsePolicy.REASK, and it remains bounded bymaxAttempts.Committed reservations survive interruption and recovery and are never refunded. Streaming deltas are diagnostic only and cannot authorize model or tool execution.
The policy is caller-owned and is not persisted in
RunSpecor the journal schema. The caller must keep the same policy for the logical run across recovery.Validation scope
Reference tests use the existing
MemoryRunStoreto simulate recovery within one process. Durable backend integration, execution-position recovery, tool receipts, and exactly-once execution remain runtime responsibilities and are outside this PR.Validation completed with:
All reactor modules passed.