feat(action-engine): add execution runtime and ActionAgent - #537
feat(action-engine): add execution runtime and ActionAgent#537skywhite1024 wants to merge 1 commit into
Conversation
Greptile SummaryThe PR adds an ActionAgent, an executable action runtime with recovery and recording, and offline/A-B CLI orchestration.
Confidence Score: 4/5The 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
|
| Filename | Overview |
|---|---|
| embodichain/gen_sim/action_engine/agent.py | Adds plan compilation and execution reporting, but successful runs can raise when post-execution trajectory persistence fails. |
| embodichain/gen_sim/action_engine/cli/run_agent.py | Adds 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.py | Implements vectorized execution, retry, recovery, and result production with per-environment masking. |
| embodichain/gen_sim/action_engine/runtime/recovery.py | Adds per-environment retry and recovery decision tracking. |
| embodichain/gen_sim/action_engine/runtime/recording.py | Adds runtime graph, checkpoint, and revision artifact recording. |
| embodichain/gen_sim/action_engine/runtime/reporting.py | Adds strict execution-report validation and atomic report publication. |
| embodichain/gen_sim/action_engine/evaluation/ab.py | Adds strict offline-versus-online branch execution and comparison artifact generation. |
| embodichain/gen_sim/action_engine/environment/agent_env.py | Integrates 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
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, |
There was a problem hiding this 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.
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.| self._process.join(timeout=self._SHUTDOWN_TIMEOUT_SECONDS) | ||
| if self._process.is_alive(): | ||
| self._process.terminate() | ||
| self._process.join(timeout=self._SHUTDOWN_TIMEOUT_SECONDS) |
There was a problem hiding this comment.
_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.5cef032 to
07267bd
Compare
35eb002 to
7a3b388
Compare
Description
Stack
ljd/gen-sim-refactor-05-runtime-groundingAdd ProgramExecutor scheduling, per-environment state transitions, bounded retries and graph recovery, runtime recording/reporting, ActionAgent execution, isolated A/B evaluation, and the execution CLI.
Runtime plans consume main's endpoint-owned command sequences and retained joint trajectories while keeping SeedGraph execution reports tensor-free and auditable.
Refs #531
Type of change
Validation
git diff --check- passedChecklist