Skip to content

feat(action-engine): add execution runtime and ActionAgent - #537

Draft
skywhite1024 wants to merge 1 commit into
ljd/gen-sim-refactor-05-runtime-groundingfrom
ljd/gen-sim-refactor-06-execution-agent
Draft

feat(action-engine): add execution runtime and ActionAgent#537
skywhite1024 wants to merge 1 commit into
ljd/gen-sim-refactor-05-runtime-groundingfrom
ljd/gen-sim-refactor-06-execution-agent

Conversation

@skywhite1024

@skywhite1024skywhite1024 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Stack

Description

This PR adds the execution half of Action Engine: DAG scheduling, vectorized execution state, retries and recovery, recording and reports, ActionAgent, runtime environment integration, CLI runner, A/B evaluation, and video archival.

The runtime consumes the coordinate-free bundles from #535 and grounds each action through #536 immediately before execution.

Type of change

  • Bug fix
  • Enhancement
  • New feature
  • Breaking change
  • Documentation update

Validation

  • black --check --diff --color ./
  • python docs/scripts/check_api_docs.py
  • Focused CLI, evaluation, executor, recovery, runtime contract, ActionAgent, architecture, motion policy, unbound-plan, and video tests (276 passed)

Checklist

  • Code is formatted with Black 26.3.1
  • Public API documentation is aligned
  • Focused tests cover execution and recovery
  • Reports and artifacts remain tensor-free and reproducible

@skywhite1024skywhite1024 added agent Features related to agentic system atomic action atomic action related functionality enhancement New feature or request labels Aug 20, 2026
@greptile-apps

Copy link
Copy Markdown

Greptile Summary

The PR adds an ActionAgent, an executable action runtime with recovery and recording, and offline/A-B CLI orchestration.

  • Compiles grounded or unbound plans into executable seed graphs.
  • Executes vectorized simulator actions with retries, recovery, and per-environment reporting.
  • Adds process-isolated A/B evaluation and runtime artifact publication.
  • Adds contract, recovery, agent, CLI, architecture, and evaluation tests.

Confidence Score: 4/5

The persistence failure path should be fixed before merging because a completed simulator execution can escape without the promised report; worker force-cleanup is also worth hardening.

Post-execution filesystem or serialization failures are outside ActionAgent.execute's handled exception set, so successful motion can end in a caller-visible exception rather than an execution report.

Files Needing Attention: embodichain/gen_sim/action_engine/agent.py; embodichain/gen_sim/action_engine/cli/run_agent.py

Important Files Changed

FilenameOverview
embodichain/gen_sim/action_engine/agent.pyAdds plan compilation and execution reporting, but successful runs can raise when post-execution trajectory persistence fails.
embodichain/gen_sim/action_engine/cli/run_agent.pyAdds offline and process-isolated A/B orchestration; worker cleanup lacks a final response for children that survive termination.
embodichain/gen_sim/action_engine/runtime/executor.pyImplements vectorized execution, retry, recovery, and result production with per-environment masking.
embodichain/gen_sim/action_engine/runtime/recovery.pyAdds per-environment retry and recovery decision tracking.
embodichain/gen_sim/action_engine/runtime/recording.pyAdds runtime graph, checkpoint, and revision artifact recording.
embodichain/gen_sim/action_engine/runtime/reporting.pyAdds strict execution-report validation and atomic report publication.
embodichain/gen_sim/action_engine/evaluation/ab.pyAdds strict offline-versus-online branch execution and comparison artifact generation.
embodichain/gen_sim/action_engine/environment/agent_env.pyIntegrates the new execution runtime with the generated simulator environment.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Grounded task plan] --> B[ActionAgent plan and preflight]
B --> C[ExecutionProgram]
C --> D[ProgramExecutor]
D --> E{Action outcome}
E -->|Retryable| F[Retry and recovery]
F --> D
E -->|Complete| G[ExecutionResult]
G --> H[Trajectory persistence]
H --> I[ExecutionReport]
I --> J[Runtime and Task Engine artifacts]
C --> K[A/B branch workers]
K --> L[Offline branch]
K --> M[Online branch]
L --> N[A/B comparison]
M --> N
Loading

Fix all with GreploopFix All in CodexFix All in Claude Code

Prompt To Fix All With AI
### Issue 1
embodichain/gen_sim/action_engine/agent.py:414
**Persistence errors escape reporting**
When a successful execution cannot persist its trajectory because the record directory is unwritable, full, or otherwise unavailable, `_persist_executed_trajectory` raises an uncaught filesystem or serialization error, causing `ActionAgent.execute` to exit without the promised aborted `ExecutionReport`.
### Issue 2
embodichain/gen_sim/action_engine/cli/run_agent.py:531-534
**Stuck workers survive cleanup**`_ABBranchWorker.close` stops after `terminate()` and a timed join without killing or reporting a child that remains alive, leaving a stuck simulator process able to retain GPU, shared-memory, and other runtime resources after the CLI exits.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(action-engine): add execution runti..." | Re-trigger Greptile

)

def _result_report(
self,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1Persistence errors escape reporting

When a successful execution cannot persist its trajectory because the record directory is unwritable, full, or otherwise unavailable, _persist_executed_trajectory raises an uncaught filesystem or serialization error, causing ActionAgent.execute to exit without the promised aborted ExecutionReport.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/gen_sim/action_engine/agent.py
Line: 414
Comment:
**Persistence errors escape reporting**
When a successful execution cannot persist its trajectory because the record directory is unwritable, full, or otherwise unavailable, `_persist_executed_trajectory` raises an uncaught filesystem or serialization error, causing `ActionAgent.execute` to exit without the promised aborted `ExecutionReport`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in CodexFix in Claude Code

Comment on lines +531 to +534
self._process.join(timeout=self._SHUTDOWN_TIMEOUT_SECONDS)
if self._process.is_alive():
self._process.terminate()
self._process.join(timeout=self._SHUTDOWN_TIMEOUT_SECONDS)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2Stuck workers survive cleanup

_ABBranchWorker.close stops after terminate() and a timed join without killing or reporting a child that remains alive, leaving a stuck simulator process able to retain GPU, shared-memory, and other runtime resources after the CLI exits.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/gen_sim/action_engine/cli/run_agent.py
Line: 531-534
Comment:
**Stuck workers survive cleanup**`_ABBranchWorker.close` stops after `terminate()` and a timed join without killing or reporting a child that remains alive, leaving a stuck simulator process able to retain GPU, shared-memory, and other runtime resources after the CLI exits.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in CodexFix in Claude Code

@skywhite1024
skywhite1024 marked this pull request as draft August 21, 2026 07:30
@skywhite1024
skywhite1024force-pushed the ljd/gen-sim-refactor-06-execution-agent branch from 5cef032 to 07267bdCompareAugust 21, 2026 09:56
@skywhite1024
skywhite1024force-pushed the ljd/gen-sim-refactor-06-execution-agent branch 2 times, most recently from 35eb002 to 7a3b388CompareAugust 21, 2026 10:19
@skywhite1024
skywhite1024force-pushed the ljd/gen-sim-refactor-06-execution-agent branch from 0b2de65 to caa6951CompareAugust 27, 2026 06:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentFeatures related to agentic systematomic actionatomic action related functionalityenhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@skywhite1024