Conversation
hallerite
marked this pull request as ready for review
October 1, 2026 00:47
hallerite
marked this pull request as draft
October 1, 2026 00:47
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.
Model transcripts cannot currently drive a fresh execution of an RLM session tree. This draft adds an opt-in
ExecutionTapethat feeds recorded model responses into the normal engine loop while native tools and child agents execute again in fresh kernels.A parent IPython cell can spawn two children, await their work, and continue with its existing Python variables. Replay restores the children's identities and checks the recorded order of model/tool boundaries across the tree rather than flattening nested calls into a list. Compaction responses are recorded too. Divergence is latched across actors; incomplete recordings and unused replay events fail explicitly.
The implementation is a Python API prototype with a runnable
examples/replay.pydriver.REPLAY.mddescribes preparation, the artifact format, guarantees, and next steps. The ACP contract and normal execution remain unchanged when no tape is supplied.Scope: this is boundary-level replay, not perfect deterministic execution. The caller must restore the initial sandbox at the same workspace path. Network/tool effects still execute; broker deliveries, arbitrary process races, clocks, randomness, cancellations, and model errors are not reproduced. Session paths are normalized for comparison, but executable responses are retained exactly. Runtime credentials are excluded from recorded configuration; prompts and outputs can still contain sensitive data.
Validation:
uv run pytest tests/— 330 passed. Changed-file pre-commit hooks (markdownlint, Ruff check, Ruff format),git diff --check, and the example's--helppass. Six new tests include real-kernel concurrent child execution with recreated files and no provider calls, persistent parent state, compaction, changed tool output/requests, incomplete tapes, and failure propagation.Note
Medium Risk
Touches the core engine model/tool loop and supervisor spawn paths, but behavior is gated behind an optional tape and default execution is unchanged.
Overview
Adds an opt-in
ExecutionTapethat records an RLM session tree to append-only JSONL and replays it by substituting stored model responses while native tools and child agents run again in fresh kernels. Normal runs are unchanged when no tape is passed.RLMEngineaccepts optionalexecution_tape, shares it with the supervisor, assigns stable root/child invocation IDs from the tape, logs boundary events (engine.start,model.start/model.end,tool.start/tool.end,prompt.end), routes completions throughtape.model()instead of the provider on replay, and aborts the tape on startup/prompt failures. Compaction with a tape requires an explicitsummarize_at_tokensorcompaction=False.SessionTreeSupervisorpropagates the tape and usestape.child()for deterministic child IDs andsub-{id}session dirs during record/replay.Ships
examples/replay.py(record/replay CLI),REPLAY.md(format, guarantees, limits), a README pointer, and integration tests (nested concurrent children, compaction, divergence, incomplete tapes).Reviewed by Cursor Bugbot for commit c2b01d2. Bugbot is set up for automated code reviews on this repo. Configure here.