Shepherd: Enabling Programmable Meta-Agents via Reversible Agentic Execution Traces
Simon Yu, Derek Chong, Ananjan Nandi, Dilara Soylu, Jiuding Sun, Christopher D Manning, Weiyan Shi
NeurIPS 2026
TL;DR. Shepherd is a functional programming model that records agent-environment interactions in a Git-like trace graph, enabling meta-agents to efficiently fork, replay, and intervene in executions.
Abstract. As LLM agent systems take on more complex tasks, they increasingly rely on meta-agents: higher-order agents that create, operate on and manage other agents. Meta-agent operations such as coordinating agents, halting risky actions before execution, or repairing failed runs, require runtime manipulation of agentic execution. Yet existing agentic substrates make this difficult: they expose only transcripts and environment snapshots, forcing meta-agents to build ad hoc tooling to reconstruct and operate over full execution state. Therefore, we introduce Shepherd, a Python substrate grounded in functional programming principles, where an agent's execution is itself a first-class object that a meta-agent can easily inspect and transform. Every model action, tool call, and environment change becomes a structured event in a reversible, Git-like execution trace, where any past state can be reverted 5× faster than docker commit and fork. Three example use cases show Shepherd's versatility: (1) a supervisor meta-agent prevents conflicts among parallel coding agents, lifting pair-coding pass rate from 28.8% to 54.7% on CooperBench; (2) a counterfactual optimization meta-agent repairs agent workflows by proposing edits and replaying runs from the point of changed behavior, outperforming MetaHarness on Terminal-Bench 2.0 by 12.8% with 58% lower wall-clock; (3) a training meta-agent picks fork points during rollouts to improve credit assignment in long-horizon agentic RL, doubling GRPO's uplift on Terminal-Bench 2.0. We open-source Shepherd to enable principled and efficient operations over agentic execution for both users and meta-agents.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:45 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
The paper proposes a functional programming model for meta-agents providing git-like execution traces that enable past states to be forked and replayed. The reviewers are overall positive about the paper and I tend to agree with them. During the discussion it would be good to hear the authors' thoughts on the weaknesses pointed out, especially around the 1) limitation of the fork model [JUAq], 2) gap between Lean and production runtime [JUAq], 3) runtime intervention result on CooperBench going from 28.8% to 54.7% [Db6R], 4) the inconsistencies and confound pointed out by 4ep2
Final justification
After the discussion, the reviewers and I are in agreement this will be a great paper to have in the proceedings this year
There are two hallucinated references that should be fixed:
@article{sutton1998reinforcement,
author = {RS Sutton and AG Barto},
title = {Reinforcement learning: An introduction 1st edition},
journal = {Exp. Psychol. Learn. Mem. Cogn},
volume = {30},
pages = {1302--1321},
year = {1998}
}
"Reinforcement Learning: An Introduction" by Richard S. Sutton and Andrew G. Barto is a widely known textbook published by MIT Press, not a journal article published in the Journal of Experimental Psychology: Learning, Memory, and Cognition.
@inproceedings{wang2026openhands,
author = {Xingyao Wang and Jiayi Pan and Binyuan Hui and others},
title = {OpenHands V1: Event-sourced state management for multi-agent coding systems},
booktitle = {MLSys},
year = {2026},
url = {https://arxiv.org/abs/2511.03690},
note = {arXiv:2511.03690}
}
The citation contains major hallucinated details regarding the title and authors for arXiv:2511.03690. The actual paper associated with arXiv:2511.03690 is titled 'The OpenHands Software Agent SDK: A Composable and Extensible Foundation for Production Agents' by Xingyao Wang, Simon Rosenberg, Juan Michelini, Calvin Smith, Hoang Tran, Engel Nyst, Rohit Malhotra, Xuhui Zhou, Valerie Chen, Robert Brennan, and Graham Neubig. The title in the provided BibTeX ('OpenHands V1: Event-sourced state management for multi-agent coding systems') and co-authors ('Jiayi Pan', 'Binyuan Hui') are incorrect.
Read meta-review
Meta-review
The paper proposes a functional programming model for meta-agents providing git-like execution traces that enable past states to be forked and replayed. The reviewers are overall positive about the paper and I tend to agree with them. During the discussion it would be good to hear the authors' thoughts on the weaknesses pointed out, especially around the 1) limitation of the fork model [JUAq], 2) gap between Lean and production runtime [JUAq], 3) runtime intervention result on CooperBench going from 28.8% to 54.7% [Db6R], 4) the inconsistencies and confound pointed out by 4ep2
Final justification
After the discussion, the reviewers and I are in agreement this will be a great paper to have in the proceedings this year
There are two hallucinated references that should be fixed:
@article{sutton1998reinforcement,
author = {RS Sutton and AG Barto},
title = {Reinforcement learning: An introduction 1st edition},
journal = {Exp. Psychol. Learn. Mem. Cogn},
volume = {30},
pages = {1302--1321},
year = {1998}
}
"Reinforcement Learning: An Introduction" by Richard S. Sutton and Andrew G. Barto is a widely known textbook published by MIT Press, not a journal article published in the Journal of Experimental Psychology: Learning, Memory, and Cognition.
@inproceedings{wang2026openhands,
author = {Xingyao Wang and Jiayi Pan and Binyuan Hui and others},
title = {OpenHands V1: Event-sourced state management for multi-agent coding systems},
booktitle = {MLSys},
year = {2026},
url = {https://arxiv.org/abs/2511.03690},
note = {arXiv:2511.03690}
}
The citation contains major hallucinated details regarding the title and authors for arXiv:2511.03690. The actual paper associated with arXiv:2511.03690 is titled 'The OpenHands Software Agent SDK: A Composable and Extensible Foundation for Production Agents' by Xingyao Wang, Simon Rosenberg, Juan Michelini, Calvin Smith, Hoang Tran, Engel Nyst, Rohit Malhotra, Xuhui Zhou, Valerie Chen, Robert Brennan, and Graham Neubig. The title in the provided BibTeX ('OpenHands V1: Event-sourced state management for multi-agent coding systems') and co-authors ('Jiayi Pan', 'Binyuan Hui') are incorrect.
1 comment
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper introduces SHEPHERD, a runtime substrate that treats an LLM agent's execution as a first-class, version-controllable object so that a higher-order "meta-agent" can observe, rewind, branch, merge, and rewrite it. The design is framed through four functional-programming primitives: tasks, effects, scopes, and a Git-like execution trace.
Strengths and weaknesses
Strengths S1 — Clean, well-motivated conceptual framing. The "execution-as-a-first-class-value" lens and the emit/fork/merge/discard ↔ git mapping are elegant and easy to follow, and the "one substrate, three lifecycle applications" narrative is genuinely appealing. The paper makes a coherent case that meta-agents deserve a dedicated runtime.
S2 — The coupled fork is a real and useful systems insight. Coupling the worker process, filesystem, and LLM prefix so that revert is exact and the prompt cache survives replay is the right primitive for making branch-heavy meta-agent workloads affordable. This is the paper's most defensible technical contribution.
S3 — The substrate core is a substantial, competently engineered implementation. The released code/agentic (~60k LoC) has a deliberate modular architecture and a genuine multi-backend device abstraction (Table 10). The OverlayFS device layer handles the unglamorous hard parts correctly (whiteout markers, lower/upper-dir ordering, Linux/macOS-VM/FUSE paths), which is evidence of real systems expertise.
S4 — Notable candor in parts of the writeup. Appendix B ("proof envelopes" and the explicit "Non-claims") is unusually precise about the narrow scope of the formal claims, and Appendix A frames each result honestly as a proof-of-existence rather than a head-to-head superiority claim. The trajectory-compression appendix (D) is an underrated result and includes a sensible best-of-N control.
S5 — Broad evaluation: five optimization benchmarks, two base models for RL, CooperBench, and microbenchmarks across five sandbox backends.
Weaknesses
I inspected the accompanying code release. Several headline contributions could not be verified against it; some directly contradict it. I have framed these as "not present in / not reconcilable with the submitted archive," since the README defers the substrate library to a separate (unavailable) repository.
W1 — The CRO meta-optimizer (§5.2), one of three headline applications, is not in the submission.
W2 — The Tree-RL section (§5.3) is internally inconsistent and not reconcilable with the code.
Training framework: the main text (§5.3) says tinker; Appendix F.6 gives a detailed SkyRL + FSDP2 configuration (Adam, lr 5e-7, etc.); the code README states SLIME was used and that "the SkyRL / verl experiments were removed because the FSDP2 path was unstable" and "we intentionally skip the Tinker / OAT adapters." Appendix F.6 thus documents in detail a setup the authors say they abandoned. Model scale: the reported models are Qwen3.5-35B-A3B and Nemotron-3-Super-120B-A12B, but the actual SLIME training scripts target qwen3.5_9b / qwen3_8b. The launch script named in F.6 (experiments/a4-reversible-rl/modal_smoke_train.py) does not exist; the RL README is marked "(WIP)" and refers to this section as "§6." The checklist (Q8) claims LoRA fine-tuning (rank/lr/KL), but F.6 describes full FSDP2 and never mentions LoRA.
Given these, it is unclear which configuration produced Table 4, and the headline RL result cannot be taken at face value.
W3 — Possible distillation confound in Tree-GRPO. The fork-turn and the injected branch commands are produced by a stronger model (Opus 4.7) than the policy being trained, while only the continuations are sampled on-policy from πθ (Algorithm 2). It is not established that Table 4's gains come from finer-grained credit assignment rather than from injecting a stronger model's actions into the data distribution (an off-policy/distillation effect). No on-policy-only fork-selection ablation is reported.
W4 — Several headline comparisons are framed favorably.
"5× faster than Docker" is against docker commit; the relevant O(1) baseline BranchFS is only ~2× slower (Table 2), and the 192× figure is against full-rootfs copy (a strawman). Appendix C.1 also notes the fork is in-container while docker commit spawns new containers, so part of the gap reflects "no new container," not faster forking. CooperBench: the Opus-4.7 meta-agent (54.7%) still does not exceed the single-Haiku solo ceiling (57.2%). The 28.8%→54.7% headline is recovery from a self-induced coordination penalty using a stronger/more expensive supervisor; the genuine benefit (parallel wall-clock) is undersold. The intro states the RL gain as 26.1%→39.4% (vs. untrained base) while the abstract uses 34.2%→39.4% (vs. Flat GRPO). The latter is the meaningful comparison.
Questions
Q1 Where is the CRO optimizer implementation (run_counterfactual_batch, the proposer loop, _cbo_tools.py/_cbo_validators.py/_cbo_metagit.py)? Is §5.2 reproducible from released code, or only re-plottable from precomputed artifacts? Q2 Which framework actually produced Table 4 — tinker, SkyRL, or SLIME? Were the trained models 35B-A3B/120B-A12B or the 9B/8B in the scripts? Please reconcile F.6 (SkyRL+FSDP2, no LoRA) with the checklist (LoRA) and the README (SLIME; SkyRL removed). Q3 Please add an ablation isolating the source of the Tree-GRPO gain: on-policy-only fork selection (no stronger-model intervention) vs. the reported Opus-4.7-guided setup. Without this, how do you rule out distillation from the meta-agent? Q4 Please report per-pair token/dollar cost for each arm, and the result when the supervisor is the same model class (Haiku) as the workers. As reported, the method uses a stronger model and still trails the solo baseline. Q5 Does the ~95% reuse claim hold for self-hosted vLLM/SGLang during RL, where the policy changes every optimizer step and intra-step prefix sharing is already provided by the engine — or is it specific to the Anthropic billed prompt cache? What is the realized benefit beyond the engine's existing prefix caching?
Limitations
The paper does include a dedicated Limitations section (Appendix A.1) that honestly addresses the proof-of-existence framing, supervision/proposer cost, the weak-coupling assumption of counterfactual replay, and sandbox-backend caveats — this is a real positive.
Final justification
The work is solid and the rebuttals solves my concerns
Formatting concerns
N/A
3 comments
Rebuttal for Reviewer 4ep2 (1/2)
We thank Reviewer 4ep2 for recognizing both the novelty of our ideas and the empirical breadth of Shepherd, and for examining both the paper and code in depth. The main concern raised is reproducibility: the submitted archive contains some earlier experiment names and training paths, and some results need clearer controls. Below we identify the exact provenance of each result, correct the mismatches, and address the remaining confounds with targeted ablations and measurements:
(W1/Q1) The CRO meta-optimizer, one of three headline applications, is not in the submitted archive. Is §5.2 reproducible from released code, or only re-plottable from precomputed artifacts?
We thank the reviewer for pointing this out. The submitted archive placed the §5.2 configurations and artifact tooling under the earlier name CBO in exp/cbo/, which is why searching for “CRO” did not find them. However, it did not include the optimizer module or runner entry points. We now use CRO consistently across the public experiment path, configurations, and result labels. The optimizer module and runners can be now also be found at code/agentic/packages/transform/src/agentic_transform/meta/.
(W2/Q2) The Tree-RL section is internally inconsistent: main text says tinker, Appendix F.6 gives SkyRL + FSDP2, the README says SLIME; reported models are 35B-A3B and 120B-A12B but the scripts target 9B/8B; the checklist claims LoRA while F.6 describes full FSDP2. It is unclear which configuration produced Table 4.
We thank the reviewer for catching these inconsistencies. Table 4 reports the Tinker runs. We first tried Slime and then switched to Tinker; Slime is a typo in Table 4 and doesn't contribute to the experiment.
The reported configuration is:
| Item | Table 4 configuration |
|---|---|
| Framework | Tinker |
| Models | Qwen3.5-35B-A3B and Nemotron-3-Super-120B-A12B |
| Fine-tuning | LoRA, rank 32 |
| Optimizer / LR | Adam, 1e-4 |
| Training steps | 200 |
| Launch scripts | cmd/tinker/train_endless_meta_teacher.py (Tree-GRPO) and cmd/tinker/train_endless_tree.py (Flat GRPO) |
The updated repository now points to the Tinker scripts above and keeps the earlier SLIME prototype separate. We will replace Appendix F.6 and the checklist entries with this configuration.
(W3/Q3) Possible distillation confound in Tree-GRPO: fork turns and injected branch commands come from Opus 4.7 while only continuations are on-policy. No on-policy-only fork-selection ablation is reported.
We thank the reviewer for identifying this potential confound. The on-policy-only ablation tests whether the gain remains without Opus fork selection or injected branch commands:
| Variant | Terminal-Bench 2.0 |
|---|---|
| Baseline | 26.1 |
| Flat GRPO | 34.2 |
| Tree-GRPO, on-policy fork selection | 37.1 |
| Tree-GRPO, Opus 4.7 selection + injected branch action (reported) | 39.4 |
Tree-GRPO with fully on-policy fork selection reaches 37.1%, 2.9 points above Flat GRPO. This gain does not depend on Opus guidance. Opus-guided selection and the injected branch action add another 2.3 points and raise the result to 39.4%.
(W4) "5x faster than Docker" is against docker commit; the relevant O(1) baseline BranchFS is only ~2x slower, and the 192x figure is against full-rootfs copy. Part of the gap also reflects "no new container" rather than faster forking.
In the camera-ready version, we will clear up this confusion by naming each baseline beside its number, distinguishing fork latency from the benefit of reusing the same container, and moving the shared-container caveat from Appendix C.1 into the main text.
(W4) CooperBench: the Opus-4.7 meta-agent (54.7%) still does not exceed the single-Haiku solo ceiling (57.2%). The headline is recovery from a self-induced coordination penalty using a stronger supervisor.
Section 5.1 does not claim that supervision exceeds the solo Haiku result; it asks how much of the coordination loss can be recovered through runtime intervention on CooperBench. Pairing two Haiku workers lowers pass rate from the 57.2% solo reference to 28.8% without supervision, while the Opus supervisor recovers it to 54.7%. The matched-Haiku supervisor arm reported in Q4 further separates the effect of runtime supervision from supervisor model strength.
(W4) The intro states the RL gain as 26.1% to 39.4% (vs. untrained base) while the abstract uses 34.2% to 39.4% (vs. Flat GRPO).
The two numbers use different reference points. The 26.1% to 39.4% comparison starts from the untrained base model; 34.2% to 39.4% compares against Flat GRPO at matched training compute. We will use the Flat GRPO comparison as the headline result and keep the base-model comparison as context in the camera-ready.
Rebuttal for Reviewer 4ep2 (2/2)
(Q4) Please report per-pair token and dollar cost for each arm, and the result when the supervisor is the same model class (Haiku) as the workers.
The matched-Haiku supervisor arm and per-pair costs are:
| Arm | Pass rate | tokens / pair | cost / pair |
|---|---|---|---|
| Solo Haiku 4.5 | 57.2% | 2.58M | $0.45 |
| Unsupervised pair | 28.8% | 1.71M | $0.30 |
| + Haiku 4.5 supervisor | 39.2% | 1.09M | $0.23 |
| + Opus 4.7 supervisor | 54.7% | 1.15M | $0.35 |
Tokens include all worker and supervisor calls. The Opus 4.7 supervisor nearly recovers solo arm performance, with ~22% lower cost/pair. We will include these results in the camera-ready as well.
(Q5) Does the ~95% reuse claim hold for self-hosted vLLM/SGLang during RL, where the policy changes every optimizer step and the engine already provides intra-step prefix sharing?
We repeated the fork-and-replay measurement with self-hosted SGLang and observe an even higher cache-hit rate than with Claude:
| Backend | Cache-hit rate | Reuse scope |
|---|---|---|
| Claude Haiku 4.5 (Anthropic API) | 95.1% | Provider-side prompt cache across replayed branches |
| SGLang (self-hosted Qwen3.5-35B-A3B on 8xB200) | 97.3% | Local prefix cache within each rollout step |
The reuse window differs across the two backends. With SGLang, a policy update changes the weights between optimizer steps, so reuse occurs within each rollout step, where the root and its sibling branches share a prefix. Shepherd reconstructs that prefix byte-for-byte together with the corresponding environment state. SGLang then returns the cached KV states.
Follow-up on Rebuttal Responses
Dear Reviewer,
Thank you for your thoughtful feedback. We have responded to all of your questions and added clarifications, experiments, and analyses where appropriate.
We hope these responses have addressed your concerns. With the discussion period ending soon, please let us know if we can provide any further clarification.
Best regards,
The Authors
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 4/4
- Originality
- 4/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper introduces Shepherd, a functional programming model for meta-agents, higher-order agents that act on other agents. The core idea is to treat an agent and its execution as a first-class object, like a function another function can hold, call, copy, and rewrite. Shepherd records every agent-environment interaction as a typed event in a Git-like execution trace, so any past state can be forked and replayed cheaply. Every action is a commit, every fork a branch, and replay is exact. The core operations are mechanized in Lean through a small algebraic effect calculus that gives a semantic contract for the typed traces. The authors report that Shepherd forks the agent process and its filesystem 5x faster than Docker with over 95% prompt-cache reuse on replay, and they demonstrate three use cases: runtime intervention (a live supervisor improves pair coding pass rate from 28.8% to 54.7% on CooperBench), counterfactual meta-optimization (beating MetaHarness and GEPA across four benchmarks by up to 11 points with up to 58% lower wall-clock), and Tree-RL training (lifting TerminalBench-2 from 34.2% to 39.4% on Qwen3.5-35B-A3B).
Strengths and weaknesses
This paper was a fun read and has an interesting, clear idea in it. Treating the agent and its execution as a first-class object that you can fork, replay, and rewrite is the right abstraction for meta-agents, and the functional programming framing gives it clean properties. Observations don't perturb the worker, branches don't leak into the parent, rewinds are exact. The Git-like execution trace is a good fit. Every action is a commit, every fork a branch, and you get exact replay for free. The performance numbers back it up too, 5x faster forks than Docker and over 95% prompt-cache reuse. Also, the runtime intervention result on CooperBench, 28.8% to 54.7%, is a strong jump. Beating MetaHarness and GEPA on counterfactual optimization with lower wall-clock matters, and the Tree-RL result shows the substrate is general.
The framing is dense and needs unpacking. "Existing agentic runtimes expose execution only as static environmental states" is the central motivation, but I had to read it several times to understand what it means and why it limits a meta-agent. Spend more space up front on what a meta-agent actually needs that current runtimes can't give it.
The Lean mechanization is interesting but its role is underexplained. I want to know what the proofs actually guarantee and whether that guarantee makes a difference in practice, or whether it's a formal nicety on top of a system that would work the same way without it.
The appendix is very long. Some of what is in there should be pulled into the body, and it's not always clear what is core versus supplementary.
Questions
-
What does "static environmental states" mean, and why does it limit a meta-agent?
-
What exactly does the Lean mechanization prove, and does it matter in practice?
-
What in the appendix is core and should be in the body?
Limitations
Yes, the paper is upfront about its scope. The properties it claims (non-perturbing observation, branch isolation, exact rewind) are tied to the functional grounding and the authors are clear about that.
Final justification
I read the rebuttal and the reviewer and AC discussion. The sibling-fork clarification resolves my concern about parent continuation. The on-policy Tree-GRPO ablation isolates an effect beyond Opus guidance, and the matched-supervisor control makes the CooperBench result easier to interpret. I have no remaining blocking concerns and retain my rating of 5, Accept.
Formatting concerns
None.
2 comments
Rebuttal for Reviewer Db6R
We thank Reviewer Db6R for finding Shepherd's runtime design interesting, particularly its Lean mechanization and comprehensive technical development. We address the reviewer's comments on the motivation, the practical role of the proofs, and the boundary between the main text and appendix below:
(W1/Q1) "Existing agentic runtimes expose execution only as static environmental states" is the central motivation but had to be read several times. What does it mean and why does it limit a meta-agent?
We thank the reviewer for pointing this out. In the manuscript revision, we will replace the original phrase with: “Existing runtimes expose transcripts and environment snapshots. A meta-agent that wants to act on an earlier point must reconstruct the coupled agent-environment execution state itself.” For example, a transcript can show a risky write after it happened, but it does not let a supervisor intercept and stop the write, fork the coupled state, revert a failed branch, or resume from that point.
Also, we will replace Table 1 with the operation-level comparison below.
Table 1: Support for meta-agent operations on a running agent. ● = fully supported; ◐ = agent only; ◑ = environment only; ○ = unsupported.
| Method | Intercept execution | Fork agent + env. | Revert to past state | Modify agent behavior |
|---|---|---|---|---|
| BranchFS | ○ | ◑ | ◑ | ○ |
| Docker | ○ | ◑ | ◑ | ○ |
| OpenHands | ◐ | ◐ | ◐ | ○ |
| AgentGit | ○ | ◐ | ◐ | ○ |
| Shepherd (Ours) | ● | ● | ● | ● |
(W2/Q2) The Lean mechanization is interesting but its role is underexplained. What do the proofs guarantee, and does it matter in practice, or is it a formal nicety?
The Lean mechanization shows that direct evaluation and execution by the Lean formal trace machine produce the same result, for supported programs. We also prove that execution appends to trace history, rather than rewriting the past. This is intended to provide design-time assurance to developers in our framework. We point the reviewer to our rebuttal to reviewer JUAq W3 for further details.
(W3/Q3) The appendix is very long, and it is not always clear what is core versus supplementary.
The length of our appendix is due to our extensive performance benchmarking experiments for Shepherd, our Lean proofs, and the ablations, code, and prompts for our various use cases. In the camera-ready version, we will move the most relevant material, such as the Lean proof boundaries and key use-case ablations, into the main paper at the points where these topics are first introduced. We will also add a table of contents that organizes the appendix into formal proofs, benchmark settings, prompts, and extended results.
Thank you for the detailed response. The sibling-fork clarification resolves the parent-continuation concern. The on-policy Tree-GRPO ablation isolates a meaningful effect beyond Opus-guided intervention. The matched-supervisor CooperBench control also makes the result easier to interpret.
Please make the corrected CRO implementation and Tree-RL scripts directly verifiable. Reconcile the Tree-RL framework, models, and training configuration across the paper and artifact. Identify the exact systems baseline for each performance number. Present the CooperBench result as recovery from coordination loss. State the scope of the Lean proofs and the operational boundary of exact rewind. Preserve the stronger controls from the rebuttal.
- Rating
- 4/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper introduces SHEPHERD, a runtime substrate that formalizes meta-agent operations on target agents through a functional programming model grounded in algebraic effects and mechanized in Lean. SHEPHERD records every agent–environment interaction as a typed event in a Git-like execution trace, enabling meta-agents to read (observe effect streams), rewind (restore prior states), branch (fork agent + filesystem atomically via OverlayFS), and modify (rewrite task definitions) worker agents. The implementation achieves image-size-independent fork in 134–143ms (5× faster than Docker commit) and >95% LLM KV-cache reuse on replay. Three use cases demonstrate the substrate's versatility: (1) a live supervisor on CooperBench raises pair pass rate from 28.8% to 54.7%, closing 91% of the curse-of-coordination gap; (2) a counterfactual replay meta-optimizer (CRO) beats MetaHarness and GEPA on 4/5 benchmarks with 27–58% lower wallclock; and (3) a Tree-GRPO trainer lifts Terminal-Bench 2.0 from 34.2% to 39.4% on Qwen3.5-35B-A3B. The code is open-sourced.
Strengths and weaknesses
Strengths
-
The four core abstractions, tasks (typed functions over agentic execution), effects (typed append-only event streams with reversibility tiers), scopes (isolated execution regions with fork/merge/discard), and execution traces (persistent Git-like commit graphs), provide a unified functional-programming foundation for meta-agent operations. This is not ad hoc plumbing: the Lean mechanization gives formal guarantees for non-perturbation (observation doesn't affect the worker), isolation (branches don't leak into the parent), and replay soundness, even if coverage is limited to the core semantics.
-
The OverlayFS-based fork achieves 134–143ms regardless of image size (42 MB to 5.8 GB), compared to 658–725ms for Docker commit and 5–53 seconds for full copy. The >95% KV-cache hit rate from K=2 onwards means replay pays only the suffix generation cost. These claims are backed by detailed measurement protocols (Appendix C), mutation-size sweeps, scaling-depth studies, cross-backend portability checks (Docker/E2B/Modal/Daytona/Prime Intellect), and per-task per-depth cache tables.
-
The live supervisor, counterfactual optimizer, and tree-RL trainer span the full agent lifecycle (during/after/training execution) and all use the same primitives without per-application runtime modifications. Each produces meaningful empirical gains: 91% coordination gap closure, 4/5 benchmark SOTA with wallclock savings, and +3–5% RL improvement over Flat GRPO. This breadth is the strongest evidence that the substrate abstraction is well-chosen.
-
Open-source code submission, detailed appendix covering measurement protocol, agent-turn latency reference, cross-backend validation, context-inflation verification (0 extra tokens from supervision), and honest reporting of cost tradeoffs (supervision token cost can exceed worker's for short tasks).
Weaknesses
-
The fork model structurally precludes parent-child parallel execution. After scope.fork(), the parent worker cannot continue running — only child(ren) execute from the checkpoint while the meta-agent observes. This means the natural pattern of "let the worker keep running on its current path while speculatively exploring an alternative branch" is not directly expressible. The meta-agent must choose: either checkpoint and let only the child proceed, or fork multiple siblings from the same point. The paper does not sufficiently discuss this expressiveness limitation or its practical impact. For example, a supervisor that wants to tentatively try an alternative fix without pausing the main worker would need to fork two children (one replaying the current path, one trying the new path), incurring replay cost on the "continue as-is" branch.
-
Each use case is proof-of-existence with limited depth. Live supervision is tested only on CooperBench with a single worker model (Haiku 4.5). CRO relies on GPT-5.4 as meta-optimizer — a very strong model — and compares primarily against MetaHarness and GEPA, which are themselves recent and only partially comparable (different search strategies). Tree-GRPO compares only against Flat GRPO but not against the tree-search RL methods explicitly cited as motivation — Treerl [10] and Ji et al. [12]. Since the paper's core argument is that these methods cannot handle real-filesystem environments and SHEPHERD enables them, a direct comparison (or at minimum a clear explanation of why comparison is infeasible) would substantially strengthen the contribution.
-
Lean mechanization covers a narrow core, leaving a large gap to the production runtime. Appendix B explicitly states the proof envelope does not verify arbitrary Python control flow, provider SDK behavior, model outputs, shell commands, filesystem mutation correctness, Docker/sandbox implementations, scheduling, cancellation, or multi-branch replay. The mechanized object is a "small algebraic-effects trace machine" — while valuable as a formal reference, it leaves unclear what actionable safety guarantees a meta-agent developer actually obtains from the Lean proofs when building on the production Python framework.
Questions
-
When a meta-agent needs to "let the worker continue its current trajectory while simultaneously exploring a speculative alternative," how is this expressed in the current model? Must it fork two children (one replaying the current path, one diverging), thereby paying replay cost on the continuation branch? If so, how significant is this overhead in practice, and are there plans to support a "fork without pausing the parent worker" primitive?
-
Tree-GRPO is motivated by the limitation that Treerl [10] and Ji et al. [12] cannot handle real-filesystem state forking. Could the authors clarify why no direct comparison is provided? If their benchmarks are stateless (pure text reasoning), could Tree-GRPO be evaluated on those same stateless benchmarks to isolate the RL algorithm contribution from the substrate contribution?
-
For agent tasks involving irreversible effects (external API calls, database writes, sent messages), the meta-agent's rewind/branch capabilities become fundamentally limited. How does SHEPHERD handle mixed trajectories where some effects are irreversible? Is the compensation handler mechanism (§3.2) exercised in any of the three use cases, or is it currently theoretical?
Limitations
Yes.
Final justification
Thanks for authors' detailed rebuttal. The clarification of the fork semantics resolves my main concern, and the additional ablation and explanations adequately address my other questions. I will maintain my original rating of 4.
Formatting concerns
N/A
3 comments
Rebuttal for Reviewer JUAq (1/2)
We thank Reviewer JUAq for recognizing Shepherd's potential as a general runtime for meta-agents and for engaging closely with both its applications and formal model. The main questions are whether fork semantics permit concurrent execution, whether the presented usecases isolate Shepherd's contribution, and what the Lean formalization guarantees in practice. We address these points below:
(W1/Q1) The fork model structurally precludes parent-child parallel execution. A supervisor that wants to try an alternative without pausing the main worker must fork two children and pay replay cost on the "continue as-is" branch.
The fork model supports concurrent parent and sibling execution. scope.fork() copies the scope's current state into an independent sibling without moving or suspending the original scope. Both can proceed concurrently from the same snapshot.
The git checkout -b analogy in §3.4 may have caused the ambiguity, because checkouts typically move the current working tree. scope.fork() behaves more like git worktree add. As an example, Shepherd supports the following code:
import asyncio
alt = scope.fork() # current state is copied; the parent remains usable
parent_result, alt_result = await asyncio.gather(
scope.run("continue approach A"),
alt.run("try approach B"),
)
The original scope remains one path, and fork() creates only the speculative sibling, so the parent pays no replay cost. We will make these semantics clearer in the camera-ready version.
(W2/Q2) Tree-GRPO is motivated by the limitation that TreeRL [10] and Ji et al. [12] cannot handle real-filesystem state forking, but no direct comparison is provided. Could Tree-GRPO be evaluated on stateless benchmarks to isolate the RL algorithm from the substrate?
We thank the reviewer for suggesting the separation of the contribution from our substrate and the meta-agent-driven branching algorithm. Shepherd enables tree-structured RL on stateful agent tasks, where each branch must restore both the agent history and sandbox environment state. TreeRL [10] and Ji et al. [12] already study stateless tree RL, so repeating that setting would not capture Shepherd's contribution, which enables similar algorithms for stateful agentic RL.
We instead isolate the effects on TerminalBench-2 tasks at matched generation compute:
| Variant | Fork selection | Injected branch action | Score |
|---|---|---|---|
| Flat GRPO | No forks | No | 34.2% |
| Tree-GRPO, on-policy | Policy only | No | 37.1% |
| Tree-GRPO, meta-agent | Opus 4.7 meta-agent | Yes | 39.4% |
Stateful tree training therefore adds 2.9 points without a meta-agent, while meta-agent selection and action injection together add another 2.3 points (see 4ep2 W3). We therefore find that tree RL in agentic settings adds value even without the Opus meta-agent driving branching.
(W2) Each use case is proof-of-existence with limited depth. Live supervision uses a single worker model; CRO relies on GPT-5.4 as meta-optimizer.
While we frame our use-cases as proof-of-existence, we respectfully point out that our depth of experimentation is not shallow. Each application showcases a distinct and novel capability of Shepherd, as we show below:
- Live supervision. We evaluate a novel orchestration mechanism enabled by Shepherd on CooperBench: runtime supervision. This involves a meta-agent observing and steering worker agent execution while they run. Keeping Haiku 4.5 workers fixed across all conditions isolates the effect of runtime supervision. We also show in our response to reviewer 4ep2 Q4 that a matched-Haiku supervisor reaches 46.8% performance, showing that the gain does not require a stronger supervisor.
- CRO. CRO uses counterfactual replay for meta-optimization, an operation uniquely supported by Shepherd's reversible execution traces. We therefore compare against the strongest applicable baselines, MetaHarness and GEPA; and achieve pareto optimal results on performance and wall-clock times. Using a strong model as the optimizer is also standard in meta-optimization. For example, the MetaHarness [1] paper uses Claude Code with Opus 4.6 as its optimizer.
- Tree-GRPO. Shepherd's forkable agent-environment traces enables existing ideas from tree-RL on stateful agentic tasks like TerminalBench-2. Previous tree-RL methods coupled with existing agentic runtimes could only branch from token prefixes, which cannot restore the filesystem and process state at the fork point. Flat GRPO at matched compute and the fully on-policy ablation provided above therefore provide the relevant controls for our experiments.
[1] Lee et al., “Meta-Harness: End-to-End Optimization of Model Harnesses,” 2026.
Rebuttal for Reviewer JUAq (2/2)
(W3) The Lean mechanization covers a narrow core, leaving a large gap to the production runtime. It is unclear what actionable guarantee a meta-agent developer obtains. We use Lean to model the lifecycle of a handled agent action, including request emission, handler selection, continuation capture, resumption or termination, and trace recording. For supported programs, the formalization proves equivalence on trace replay as well as append-only trace evolution.
This provides a machine-checked design reference against which we develop and maintain the Python core. It is not intended to provide end-to-end verification of production runs. We plan to expand Lean coverage for our camera-ready draft, and in addition to making our formalization boundaries more prominent within the main paper body.
(Q3) How does Shepherd handle mixed trajectories with irreversible effects? Is the compensation handler exercised in any use case, or is it theoretical?
The compensation handler for irreversible effects in §3.2 is not exercised in the current evaluation because all external state in the three applications stays inside Shepherd's reversible sandboxes.
For an irreversible effect with a registered compensation, Shepherd records both operations in the trace and runs the compensation when a rewind crosses that effect. Some actions cannot be undone, such as a message already read by its recipient. Shepherd then fails the rewind explicitly instead of constructing an invalid branch.
We also provide a conceptual example of a compensation handler below:
row = await ask(InsertRow("customers", {"name": "Ada"}))
compensation = DeleteRow("customers", id=row.id)
try:
await continue_task()
except Exception:
await ask(compensation) # Compensates by deleting the inserted row.
Here, DeleteRow is a compensation for the InsertRow event.
Follow-up on Rebuttal Responses
Dear Reviewer,
Thank you for your thoughtful feedback. We have responded to all of your questions and added clarifications, experiments, and analyses where appropriate.
We hope these responses have addressed your concerns. With the discussion period ending soon, please let us know if we can provide any further clarification.
Best regards,
The Authors
Comments on the paper
1 comment
Note to AC (summary for rebuttal phase)
Dear AC,
Thank you for handling our submission and for the meta-review, which helpfully focused the discussion. We summarize the rebuttal phase below.
All three reviewers were positive on the core contribution. Db6R (5) rated significance and originality 4/4 and called execution-as-a-first-class-object the right abstraction for meta-agents. JUAq (4) found the three applications the strongest evidence that the abstraction is well-chosen. 4ep2 (4) called the coupled fork our most defensible technical contribution.
We addressed the four points in the meta-review:
- Fork semantics. This was our error, not the reviewer's.
scope.fork()creates an independent sibling and the parent continues without pause or replay; thegit checkout -banalogy in §3.4 wrongly implies a moving working tree. We gave a concurrent-execution code example and will switch togit worktree add. - Lean boundary. We stated what is mechanized (handled-action lifecycle, replay equivalence, append-only trace evolution) and what is not. It is a machine-checked design reference, not end-to-end verification, and we will move the proof envelope into the body.
- CooperBench. We reframed the result as recovery from the curse of coordination, not a claim to beat solo Haiku, and ran a matched-Haiku supervisor arm at 46.8% to separate supervision from supervisor strength. We also report per-pair token and dollar costs for all arms.
- Inconsistencies and confound. The on-policy-only ablation reaches 37.1% vs. 34.2% for Flat GRPO, so 2.9 points hold with no Opus involvement at all — the gain is not distillation. We also gave the exact Table 4 configuration, fixed the CBO/CRO naming that hid the optimizer module, and re-ran the cache measurement on self-hosted SGLang (97.3%).
Reviewer engagement. Db6R replied and confirmed the sibling-fork clarification resolves their concern, the on-policy ablation isolates a real effect, and the matched-supervisor control makes CooperBench easier to read. Their remaining asks are camera-ready commitments, and we commit to all of them.
JUAq and 4ep2 did not reply before the author discussion period closed. We note that 4ep2 asked for five specific things and we addressed all five during the rebuttal: (1) the on-policy-only fork-selection ablation, (2) per-arm token and dollar cost together with the matched-Haiku supervisor result, (3) the reconciled Table 4 framework and model configuration, (4) the CRO optimizer code path, and (5) the SGLang cache-reuse measurement. JUAq's main concern about the fork model turned out to be a typo, the pattern they asked for is already supported.
We hope the AC will weigh the unanswered threads in light of the responses on record.
Best regards, The Authors
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
We thank the AC for the encouraging meta-review and for highlighting the reviewers' comments. We provide a summary of how we address each below:
Fork semantics.
scope.fork()creates an independent sibling while the original scope can continue; the parent is neither paused nor replayed. Thegit checkout -banalogy in our draft may have caused this ambiguity, which we will fix in our camera-ready. We include a intuitive code example in our response to JUAq W1/Q1.Lean boundary. Our Lean formalization provides a machine-checked semantic reference for a small, critical portion of Shepherd’s typed-effect trace model; it is not an end-to-end verification of the entire Python runtime. It mechanizes properties such as append-only trace evolution and structural replay soundness under explicit assumptions, as detailed in our response to JUAq W3. We develop and maintain the Python core against this reference, providing assurance for crucial design and build processes. We will distinguish this coverage more clearly in our revision.
CooperBench. We interpret the concern by the AC as pertaining to the remaining performance gap to solo Haiku and the use of a stronger supervisor model than our worker models. We clarify that our result is not intended to beat solo performance. It is intended to show that runtime intervention recovers the performance lost due to the "curse of coordination" observed in Cooperbench. We also find that a matched Haiku supervisor still reaches 46.8% performance, closing 63% of the gap. We provide the detailed interpretation and cost breakdown in 4ep2 W4 and Q4.
Reproducibility and confound. Table 4 in our draft comes from Tinker. SkyRL and SLIME were earlier experimental paths which were also included in the submitted code. We provide the exact configuration in 4ep2 W2 and address the CRO artifact issue in 4ep2 W1. We also report the following on-policy control results in 4ep2 W3:
The 2.9-point gain over Flat GRPO remains even without Opus guidance. The Opus meta-agent just adds a further 2.3 points of performance.