acceptodds
Under review as a conference paper at ICLR 2027

CAPSULE: Runtime Control and Hot Patching for Code-as-Policy Robotic Agents

Abstract

Code-as-Policy (CaP) robotic agents generate executable programs to orchestrate perception, planning, and control for robotic manipulation. However, relying solely on rollout-level feedback makes it difficult to associate execution failures with the relevant code segments. Recovery is further complicated by physical changes that persist after a failed execution, such as an upright book being knocked flat, which can make rerunning the program unsafe or ineffective. We introduce CAPSULE, a runtime control layer for CaP agents that supports group-level execution and effect-aware program repair without requiring the control layer itself to call existing robot APIs. CAPSULE partitions each program into source-local, effect-bounded execution groups and maintains a persistent namespace. It links execution traces and task feedback with the corresponding source regions to support inspection, local patching, and recovery. When recovery is needed after physical effects have occurred, CAPSULE avoids replaying groups whose physical effects have already occurred and generates forward recovery patches conditioned on updated environment observations. Across eight backbone LLMs on Robosuite and LIBERO, CAPSULE outperforms the CaP-X multi-turn baseline, boosting macro-averaged success rates from 36.7% to 49.7% and 8.2% to 16.8%, respectively. Ablation studies show that local patching and physical-state forward recovery provide complementary gains. Furthermore, we propose CAPSULE-Critique-GRPO (CC-GRPO), a post-training scheme that leverages execution-grounded repair trajectories to enhance standalone program generation. In a two-task study, CC-GRPO outperforms vanilla GRPO, increasing task success rates from 17.5% to 31.3% on Cube Stack and from 16.3% to 28.8% on Spill Wipe.

Primary area:
applications to robotics, autonomy, planning
Keywords:
Code-as-Policy, Robotic Manipulation, Runtime Control, Reinforcement Learning

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_wssUOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

CAPSULE partitions generated robot programs into effect-bounded execution groups, preserves their runtime namespace, and associates execution feedback with source regions. An LLM controller patches groups before physical actions occur or appends recovery code afterward. Evaluation across eight main backbones reports success improvements from 36.7% to 49.7% on Robosuite and 8.2% to 16.8% on LIBERO, with component ablations. CC-GRPO additionally uses independently verified repaired programs to improve standalone generation on two tasks.

Critical strengths

The paper provides practical runtime design for recovery. The design enables targeted correction while retaining useful variables and continuing from the current scene. Broad evidence of system-level utility. Full CAPSULE improves over CaP-X-MT for each of the eight main backbones on both benchmarks, with aggregate gains of 13.0 percentage points on Robosuite and 8.6 on LIBERO. Component ablations further support the usefulness of combining local patching and forward recovery.

Critical weaknesses

Limited demonstrated novelty and insufficient isolation of the proposed mechanism. Relative to CaP-X, CAPSULE appears to be an incremental runtime extension providing intermediate LLM intervention, persistent execution state, and code editing.

The evaluation lacks a stepwise code-generation baseline that executes newly generated blocks in a persistent namespace and receives the same feedback at the same execution boundaries. Such a baseline would test whether maintaining and locally editing a full program provides benefits beyond online next-block generation. Consequently, the evaluation does not establish the value of the specific grouping/patching machinery beyond ordinary stepwise replanning, more frequent feedback, and additional inference.

The execution granularity also seems inconsistently specified throughout the manuscript. Section 2.2 places group boundaries after each effectful region, whereas Appendix A groups separate top-level effectful calls together: Group 1 contains both home_pose() and open_gripper(), and Group 2 contains two goto_pose(...) calls followed by close_gripper(). The exception preserving compound statements does not explain these examples. Despite substantial formal notation, the implemented partition remains unclear. This affects intervention frequency and how much physical execution fits within the 30-step controller budget, limiting reproducibility.

Questions for authors

Which grouping rule is implemented in the experiments? Does Appendix A aggregate groups for presentation, and is the LLM controller queried after every executed group?

How does CAPSULE compare with generating only the next execution group from the current state, while matching namespace persistence, feedback, intervention boundaries, and inference budget? This comparison would directly affect my assessment of the methodological contribution.

3 comments

We sincerely appreciate your detailed feedback.

W1: Limited demonstrated novelty and insufficient isolation of the proposed mechanism. Relative to CaP-X, CAPSULE appears to be an incremental runtime extension providing intermediate LLM intervention, persistent execution state, and code editing.

Response to W1:

We acknowledge that CAPSULE builds upon the CaP paradigm. Its contribution, however, is not merely the addition of intermediate LLM intervention, persistent state, or code editing. The stronger frozen controller is used during training to generate repair candidates for both CC-GRPO and GRPO + BC, and is disabled during evaluation. Before physical effects occur, faulty code can be patched in place while preserving the active namespace. Once an effectful API invocation has been recorded, the executed group cannot be patched or replayed, and recovery must proceed through newly appended continuation code. This distinction is absent from the CaP-X multi-turn baseline and is central to our design.

Our existing ablations (Fig. 3) further isolate the two mechanisms by separately evaluating local patching and forward recovery. Full CAPSULE (A4) improves success rates by 16.9 percentage points on Robosuite and 6.5 points on LIBERO relative to the recovery-only control (A2). Enabling forward recovery over the patching-only control (A3) similarly yields gains of 15.4 and 8.8 points, respectively. These results support the complementary contributions of the two recovery mechanisms.

W2: The evaluation lacks a stepwise code-generation baseline that executes newly generated blocks in a persistent namespace and receives the same feedback at the same execution boundaries. Such a baseline would test whether maintaining and locally editing a full program provides benefits beyond online next-block generation. Consequently, the evaluation does not establish the value of the specific grouping/patching machinery beyond ordinary stepwise replanning, more frequent feedback, and additional inference.

Response to W2:

The suggested stepwise baseline would help determine whether maintaining and locally editing a full program provides benefits over online next-block generation under matched feedback conditions. Our current ablations isolate the roles of patching and recovery within the full-program setting, but do not establish an advantage over this stepwise alternative.

CAPSULE is built on top of the full-program generation paradigm, where the LLM first produces a complete program for the task. Our contribution lies in how to make this full program more robust and editable at runtime. We partition the generated program into groups, maintain persistent execution state, and perform local patching or forward recovery based on intermediate feedback. The suggested baseline changes how the program is generated, so it addresses a broader comparison than an ablation within this setting. Nevertheless, it is relevant to assessing whether the observed benefits require maintaining and editing a full program.

To examine the contributions of patching and recovery within the full-program setting, we provide the ablations in Section 3.2.2 and Figure 3.

ConfigurationRobosuite success rateLIBERO success rate
A1: One-shot full program, no intermediate control26.3%6.0%
A2: Recovery only, append_recovery enabled and patch_group disabled32.8%10.3%
A3: Patching only, patch_group enabled and append_recovery disabled34.3%8.0%
A4: Full CAPSULE49.7%16.8%

Adding forward recovery to the patching-only configuration (A3 → A4) improves success by 15.4 percentage points on Robosuite and 8.8 percentage points on LIBERO. Adding local patching to the recovery-only configuration (A2 → A4) improves success by 16.9 and 6.5 percentage points, respectively. These results support the contribution of each mechanism when combined with the other within the full-program setting. They do not, however, separate the benefits of maintaining and editing a full program from those of stepwise generation with matched feedback boundaries and inference budgets. Our experimental conclusions are therefore limited to the evaluated full-program configurations.

W3: The execution granularity also seems inconsistently specified throughout the manuscript. Section 2.2 places group boundaries after each effectful region, whereas Appendix A groups separate top-level effectful calls together: Group 1 contains both home_pose() and open_gripper(), and Group 2 contains two goto_pose(...) calls followed by close_gripper(). The exception preserving compound statements does not explain these examples. Despite substantial formal notation, the implemented partition remains unclear. This affects intervention frequency and how much physical execution fits within the 30-step controller budget, limiting reproducibility.

Response to W3:

Thank you for carefully checking the consistency between the grouping rules and the case study. You are correct that the original Appendix A did not match Section 2.2. Its group boundaries were retained from an earlier developmental version and were not updated to reflect the final partitioning rules. We apologize for this inconsistency and have corrected the appendix.

The revised case study follows the effect-bounded grouping rules in Section 2.2 for both the initial program and the appended recovery code. Group 1 contains the import and home_pose(), while Group 2 contains only open_gripper(). Each subsequent top-level motion or gripper call ends a separate group, with preceding observation and computation statements included according to the same rules. The initial program comprises Groups 1–9, and the recovery source is partitioned into Groups 10–18. The compound-statement exception is not needed to explain these boundaries.

We have also made the controller-budget accounting explicit. The illustrated sequence through Step 19 comprises 17 run_group decisions, including the failed attempt and subsequent execution of the patched Group 6, one patch_group decision, and one append_recovery decision. It therefore uses 19 of the 30 available controller steps, provided that no additional inspection or repair decisions are inserted. If task completion is reported after Step 19, execution terminates without an additional finish decision, and Groups 17–18 are not executed. This accounting distinguishes controller decisions from robot API invocations and simulator steps, clarifying how execution granularity relates to the controller budget.

Q1: Which grouping rule is implemented in the experiments? Does Appendix A aggregate groups for presentation, and is the LLM controller queried after every executed group?

Response to Q1:

All experiments use the deterministic grouping procedure specified in Section 2.2. This procedure inserts a boundary immediately after each region with η^i=1\hat{\eta}_i = 1, preserves compound statements through control-flow atomicity, and applies dependency-aware closure without crossing effect boundaries.

The original Appendix A example used an outdated developmental fragment that did not match this procedure. We have corrected the case study to follow Section 2.2. The revised Appendix A shows individual execution groups without aggregating them for presentation, including those partitioned from the appended recovery code.

The LLM controller is queried after each executed group unless the runtime has terminated. After each run_group, source-local feedback is returned, and the controller selects the next action if execution continues. When post-action feedback indicates task completion, the runtime exits without another controller query. The illustrated sequence in Appendix A uses 19 of the 30 available controller steps, comprising 17 run_group decisions, one patch_group decision, and one append_recovery decision, provided that no additional inspection or repair decisions are inserted.

Q2: How does CAPSULE compare with generating only the next execution group from the current state, while matching namespace persistence, feedback, intervention boundaries, and inference budget? This comparison would directly affect my assessment of the methodological contribution.

Response to Q2:

We agree that the proposed comparison would help determine whether maintaining and locally editing a full program provides benefits beyond generating only the next execution group under matched conditions.

CAPSULE is deliberately built on the standard Code-as-Policy paradigm used by CaP and CaP-X, where the LLM first synthesizes a complete program. Our contribution is a runtime layer that supports effect-aware local editing and recovery during physical execution. Our comparison with the CaP-X multi-turn baseline evaluates this runtime mechanism against full-program regeneration.

The suggested baseline uses a different generation strategy, but it is a relevant comparison for assessing the value of maintaining and editing a full program. Matching namespace persistence, feedback, intervention boundaries, and inference budget would help distinguish the benefits of CAPSULE’s editing and recovery mechanism from those of stepwise generation with intermediate feedback. Our current evaluation does not establish an advantage over this matched next-group generation baseline. Our claim is therefore limited to the benefits demonstrated relative to the evaluated full-program baselines.

Reviewer_ZhqROpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
1
Soundness
1
Read review
Paper summary

This paper introduces CAPSULE, as a runtime control layer, grouping generated robot codes into effect-bounded execution groups, supporting local patching and forward recovery. The paper reports higher average success rates than its CaP-X multi-turn baseline across multiple models on both Robosuite and LIBERO. To resolve the poor performance issue of small models, it also introduces CC-GRPO, which combines ordinary policy samples with verified repaired programs to improve code generation. CC-GRPO is compared against vanilla GRPO, proving its efficiency.

Critical strengths

1.This paper provides a well-structured problem formulation to locate runtime failure at either perception level or execution level, which is pratically useful for CaP agents when earlier robot actions can change the environment. Seperating local patching and forward recovery is helpful for code repairing during execution. The benchmarking results provide reasonable proof for CAPSULE’s claim.

2.The paper reports the performance degration of smaller models used as CaP agents for runtime control, providing a useful observation for studying small-model limitations. The paper also provides CC-GRPO as a reasonable solution to strengthen these small-model's CaP capabilities.

Critical weaknesses

1.The structural differences and independent contributions of CAPSULE relative to CaP-X are not clearly positioned. CaP-X (https://github.com/capgym/cap-x.git) already supports revising subsequent code based on execution feedback, and multi turn recovery in a single trial. The detailed explanation of how code examine, modification policy is not detailly introduced in methods. Authors should clearly state their contributions, and explain the criteria controller uses to inspect intermediate states and how it decides to modify the code.

2.The theoretical justification and validation of CC-GRPO is less convincing. Adding an off-policy repaired trajectory into GRPO groups might conflict with the on policy sampling for GRPO, while the guided loss itself is similar to a weighted imitation loss. The paper did not fully explain why coupling the repair inside the group outperforms method like directly adding a behaivor cloning loss. The ablation in this section should also discuss improvement under patch group disable, append recovery enable to compare against effectiveness of its own proposed methods.

Questions for authors

1.Could the authors clarify the exact rules for inspecting and modifying code during runtime control and forward recovery? What criteria are used to judge whether a modification or recovery block is safe to execute?

2.Could the authors more clearly define the boundary between CAPSULE and CaP-X in related work, to show the specific advantage of proposed methods?

3.The reported CaP-X baseline seems different from the iterative and RL post training resuls in CaP-X (CaP-Agent0, CaP-RL etc.) paper. Could the authors clarify the CaP-X configuration for baselien, cand compare under matched conditions to provide a clearer breakdown of what failure types are actually improved by “patchgroup” and “appendrecovery”?

4.For CC-GRPO, as discussed in weakness part, could the authors compared against vanilla GRPO plus a seperate BC loss on the same repair trajectories? Also Table 8 in appendix shows the use of stronger models as controllers, but I failed to locate the setup in main text, could this be unfair when comparing against vanilla GRPO? Please describe this setup in detail.

7 comments

We sincerely appreciate your detailed feedback.

W1: The structural differences and independent contributions of CAPSULE relative to CaP-X are not clearly positioned. CaP-X (https://github.com/capgym/cap-x.git) already supports revising subsequent code based on execution feedback, and multi turn recovery in a single trial. The detailed explanation of how code examine, modification policy is not detailly introduced in methods. Authors should clearly state their contributions, and explain the criteria controller uses to inspect intermediate states and how it decides to modify the code.

Response to W1:

We agree that CaP-X already supports revising subsequent code based on execution feedback and multi-turn recovery within a single trial. Below, we clarify CAPSULE’s structural differences and independent contributions relative to CaP-X, including how the controller inspects intermediate states and decides when and how to modify code.

The key structural differences between CaP-X and CAPSULE are as follows. CaP-X multi-turn operates at the granularity of complete code blocks or turns: after a block finishes, the agent receives aggregate feedback (stdout/stderr and, in stronger tiers, visual differencing) and decides whether to regenerate subsequent code. CAPSULE instead introduces an effect-aware runtime control layer that partitions the generated program into source-local, effect-bounded execution groups (Section 2.2) and maintains a persistent computational namespace. This enables two complementary recovery modes:

Hot patching (local in-place repair). Before any primitive in A_eff has been executed inside the current group, the controller can inspect intermediate variables and traces and modify the group’s source in place (patch_group), preserving the active namespace Γt\Gamma_t. Effect-aware forward recovery. Once an effectful API invocation is recorded in the runtime trace, CAPSULE strictly forbids replaying or patching that group. It instead synthesizes and appends new continuation code (append_recovery) conditioned on fresh environment observations.

The controller inspection and modification criteria is deterministic and grounded in both static analysis and runtime evidence (Sections 2.2–2.3):

  • Static profiling: Each top-level source region rir_i is assigned an effect indicator η^i∈0,1\hat{\eta}_i \in \\{0,1\\}, which is set to 1 if the region (or a resolvable helper) invokes any API in Aeff\mathcal{A}_{\mathrm{eff}}. Group boundaries are then constructed by the three rules in Section 2.2: effect boundary (at most one marked effectful region per group), control-flow atomicity, and dependency-aware closure.
  • Runtime verification: Lightweight tracing decorators record structured invocation tuples. Before executing a group, the controller records a checkpoint; only events after this checkpoint are attributed to the active group, producing source-bound feedback.
  • Repair decision:
    • If the current group has not yet produced physical effects → inspect variables and traces → apply patch_group if a fault is detected.
    • If an effectful primitive has already executed → switch to append_recovery with code that re-queries the environment and continues from the current physical state.
    • Task completion or unrecoverable failure triggers finish.

We have clarified more details in Section 2.3 and the structural differences between CAPSULE and CaP-X in Section 4.

W2: The theoretical justification and validation of CC-GRPO is less convincing. Adding an off-policy repaired trajectory into GRPO groups might conflict with the on policy sampling for GRPO, while the guided loss itself is similar to a weighted imitation loss. The paper did not fully explain why coupling the repair inside the group outperforms method like directly adding a behaivor cloning loss. The ablation in this section should also discuss improvement under patch group disable, append recovery enable to compare against effectiveness of its own proposed methods.

Response to W2:

We thank the reviewer for the thoughtful comments on CC-GRPO.

Adding a verified repaired trajectory into a GRPO group does not inherently conflict with GRPO’s design. Recent analysis (Mroueh et al., ICLR 2026) shows that both on-policy and off-policy GRPO objectives yield a lower bound on reward improvement, and that off-policy GRPO matches or outperforms its on-policy counterpart under standard clipping and KL regularization. Critique-GRPO (Zhang et al., ICML 2026) also combines ordinary on-policy rollouts with critique-guided refinements within the same optimization group and provides empirical support for this hybrid design. These studies motivate our formulation.

In our implementation the repaired program is not treated as an arbitrary off-policy sample:

  1. It is admitted only after an independent clean replay from the initial state s0s_0 succeeds (Appendix C.3).
  2. Its policy likelihood is evaluated strictly under the original task instruction xx (no critique tokens are prepended at training time).
  3. The group still consists predominantly of ordinary on-policy samples (7 ordinary + at most 1 repaired).
  4. Advantages are computed group-relatively, so a repaired trajectory receives a positive advantage only when it outperforms the group mean.

The guided loss (Eq. 6 in the appendix) is deliberately a shaped, advantage-weighted term ℓi,tguide=−Aipi,tpi,t+γ\ell_{i,t}^{\mathrm{guide}} = -A_i \frac{p_{i,t}}{p_{i,t}+\gamma} (γ=0.1\gamma = 0.1), not a plain imitation loss. This is the same shaping device used in Critique-GRPO to amplify low-probability corrective tokens while avoiding entropy collapse. Together these choices keep the update close to the on-policy manifold while still allowing the policy to internalize high-value recovery patterns that pure on-policy sampling rarely discovers.

Regarding the question of whether the gains of CC-GRPO could be explained by simply performing additional SFT/BC on the repaired programs, Our design follows the Critique-GRPO framework, which already examined this exact question. Critique-GRPO constructs groups that mix ordinary on-policy rollouts with verified critique-guided refinements, and explicitly compares this hybrid objective against offline Refinement FT / SFT on the same refined trajectories. The hybrid approach substantially outperforms pure supervised fine-tuning on the refinements (approximately +8–12 pp average Pass@1 across Qwen models).

In the revision, we have added this baseline (Vanilla GRPO + BC). We have therefore added vanilla GRPO + BC on the same verified repair trajectories, described in Section 2.4 and evaluated in Section 3.3, Table 3b. Using Qwen2.5-Coder-7B, GRPO + BC improves success over vanilla GRPO from 17.50% to 23.75% on Cube Stack and from 16.25% to 18.75% on Spill Wipe. CC-GRPO achieves 31.25% and 28.75%, respectively, exceeding GRPO + BC by 7.50 and 10.00 percentage points.

Based on our analysis and related work (e.g., Critique-GRPO, which shows that simply mixing expert repair trajectories into GRPO yields smaller gains than methods that more tightly integrate the correction process). This would further support that the gains of CC-GRPO stem not merely from access to high-quality repair data, but from the specific way these trajectories are utilized within the group-relative optimization framework.

A key point we emphasize in Critique-GRPO is that online-generated, critique-guided refinements that stay close to the current policy are more effective than simply imitating expert demonstrations. Expert trajectories are often quite far from the model’s current policy distribution, so the resulting distribution shift makes them less efficient for learning.

Recovery-only ablation. We have added the requested configuration with patch_group disabled and append_recovery enabled (A2) in Section 3.2.2 and Figure 3. Averaged equally across backbones and tasks or suites, recovery-only control improves success over one-shot execution from 26.3% to 32.8% on Robosuite and from 6.0% to 10.3% on LIBERO. Full CAPSULE (A4) achieves 49.7% and 16.8%, respectively, and also outperforms patching-only control (34.3% and 8.0%). These results support the complementary contributions of local patching and forward recovery to runtime execution.

Q1: Could the authors clarify the exact rules for inspecting and modifying code during runtime control and forward recovery? What criteria are used to judge whether a modification or recovery block is safe to execute?

Response to Q1:

Runtime control and inspection are governed by six discrete operations. As described in Section 2.3, CAPSULE exposes run_group, patch_group, inspect_trace, inspect_variables, append_recovery, and finish. At each execution step, the controller receives the active code group, execution status, and source-grounded feedback. When further diagnosis is required, it can inspect execution errors, API outcomes, and intermediate variables without modifying code or triggering physical actions. Specifically, inspect_trace retrieves structured evidence from primitive calls, while inspect_variables examines selected values in the persistent namespace Γt\Gamma_t. The executor also records API invocation tuples of the form (name, args, return, error, idx) and establishes an execution checkpoint before each group. Events recorded after this checkpoint are attributed to the active group, providing localized feedback for diagnosing execution failures.

In-place modification through patch_group is permitted only when no invocation of an effectful API in Aeff\mathcal{A}_{\mathrm{eff}} has been recorded for the target group. Before allowing patch_group, the runtime checks whether any invocation of an API in Aeff\mathcal{A}_{\mathrm{eff}} has been recorded for the target group. If no such invocation exists, the controller may replace the group's source code while preserving the persistent namespace Γt\Gamma_t. The modified group can then be executed through run_group without replaying preceding groups. Appendix A illustrates this mechanism. Group 6 raises a ValueError when modifying a read-only array before reaching goto_pose. Since no physical action has been executed within this group, the controller replaces lift_pos = grasp_pos with lift_pos = grasp_pos.copy() and subsequently executes the patched group while retaining the results of Groups 1–5. Once an effectful primitive has been recorded, subsequent corrections must use forward recovery. The runtime prohibits in-place patching and replay of groups that have already executed effectful APIs. Instead, the controller uses append_recovery to register new continuation code in the active program PtP_t. This code is conditioned on updated sensory feedback and is scheduled for execution as subsequent groups rather than executed immediately upon appending. In Appendix A, after the original placement fails, the controller appends recovery code that refreshes object poses, resamples the grasp pose, and recalculates the placement height based on updated object dimensions. This allows execution to continue from the current physical state without repeating previously executed physical actions.

The safety criteria are therefore defined by explicit runtime constraints. Inspection does not modify the execution state or produce physical effects. In-place patching is permitted only when the target group has not invoked any effectful API. Once such an invocation is recorded, the group cannot be patched or replayed, and subsequent corrections must proceed through newly appended recovery code using updated environment observations. These constraints are designed to prevent unsafe replay of physical actions rather than guarantee the physical safety of every generated motion. We have clarified these operational criteria in Section 2.3.

Q2: Could the authors more clearly define the boundary between CAPSULE and CaP-X in related work, to show the specific advantage of proposed methods?

Response to Q2:

In line with our response to W1, we have revised the Related Work section to more clearly delineate the boundary between CAPSULE and CaP-X.

Reviewer_rWT1OpenReview ↗
Rating
2
Confidence
4
Informativeness
1
Presentation
3
Soundness
3
Read review
Paper summary

This paper targets the problem in robot policy with code generation. To address the problem that in real executions the generated code may experience error or failures, this work proposes a structured code orchestration and execution. Specifically, the authors propose to partition the generated code into different groups according to their functions and effects. During execution, the control agent monitors the process and errors and properly intervene by patch-based or recover-based repairing.

Critical strengths

This paper is generally well-written and easy to follow.

The targeted problem is well-motivated and the intuition of monitoring the program based on effect groups is also reasonable and valid.

Critical weaknesses

The proposed solution seems targeting the physical effect solely for repairing only. It is unclear whether such solution can be generalized to other problems during physical execution of the generated code-based policy.

Therefore, the overall contribution is quite limited as the proposed method does not establish a new principled method for code generation policy, while it is mostly an marginal improvement modification for code generation.

Empirical studies are performed in simulated environments. There is no real world validation on real robots.

Questions for authors

Nil.

2 comments

W1: The proposed solution seems targeting the physical effect solely for repairing only. It is unclear whether such solution can be generalized to other problems during physical execution of the generated code-based policy.

Response to W1:

Thank you for raising the concerns about the scope and methodological contribution.

Physical effects govern execution control, beyond just serving as repair feedback. Potential physical effects determine execution-group boundaries (Section 2.2), while recorded effectful API calls determine whether a group remains eligible for in-place patching or requires forward recovery from the current environment state (Section 2.3). CAPSULE therefore provides a mechanism for deciding where to intervene and how to continue execution while accounting for physical actions that have already occurred.

The mechanism is not specific to a single failure type. Appendix A demonstrates two different problems within one rollout: a Python exception caused by modifying a read-only array, resolved through local patching, and a subsequent placement failure, resolved by refreshing object poses and generating a recovery continuation. This illustrates CAPSULE’s lightweight ability to correct code errors in model-generated programs by editing only the affected code group while preserving execution state.

Our current work focuses on code-level errors and execution failures, and does not establish generalization to all problems encountered during physical execution. Broader handling of perception errors, action-execution discrepancies, and task-constraint violations would require additional runtime monitoring and validation.

W2: Therefore, the overall contribution is quite limited as the proposed method does not establish a new principled method for code generation policy, while it is mostly an marginal improvement modification for code generation.

Response to W2:

Our main contribution is an effect-aware runtime control mechanism for code-as-policy agents. CAPSULE builds on the existing full-program generation paradigm and addresses how a generated program can be inspected, modified, and continued when earlier actions have already changed the physical environment.

This design addresses a distinction that code modification alone does not capture: CAPSULE provides finer-grained execution feedback, accounts for physical effects that have already occurred, and supports localized code repair within the affected execution group. CAPSULE makes that distinction explicit in the runtime interface and intervention rules, allowing local corrections while preserving execution context and avoiding replay of actions whose physical effects have already occurred. We therefore position the contribution as a runtime execution and repair mechanism for code-based robotic policies. The success-rate improvements provide empirical evidence for its utility, while the methodological contribution is this structured treatment of program state, physical effects, and runtime intervention.

W3: Empirical studies are performed in simulated environments. There is no real world validation on real robots.

Response to W3:

Real-world experiments were beyond the hardware and resource budget available for this study. Our simulation experiments support the effectiveness of the proposed runtime control and code repair mechanisms within the evaluated settings. Across eight backbones, CAPSULE increases macro-averaged success rates over the CaP-X multi-turn baseline from 36.7% to 49.7% on Robosuite and from 8.2% to 16.8% on LIBERO. The component ablations further show that combining local patching and forward recovery outperforms either component alone (Section 3.2). We therefore position CAPSULE as a contribution to runtime execution and repair of generated robotic programs, with CC-GRPO additionally investigating how execution-grounded repair experience can improve standalone program generation (Sections 2.4 and 3.3).

I would like to thank the authors for their explanation. I encourage the authors analyze the proposed solution more in real robot environments, which is essential for a robot learning/embodied AI work. Given the current manuscript, I would like to keep my rating.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.