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

@skywhite1024 skywhite1024 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Stack

Add 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

  • New feature (non-breaking change which adds functionality)

Validation

  • Focused executor/agent/evaluation coverage - 176 passed
  • Stack-tip GenSim regression - 706 passed, 9 warnings
  • Stack-tip related AtomicAction coverage - 120 passed
  • Black 26.3.1 - 855 Python files unchanged at the stack tip
  • git diff --check - passed

Checklist

  • Code passes Black 26.3.1.
  • Tests cover the affected behavior.
  • Stack-level architecture documentation is included by layer 7.
  • No new third-party dependency is required.

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

greptile-apps Bot commented Aug 20, 2026

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

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
Loading

Fix all with Greploop Fix All in Codex Fix 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.

P1 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.

Fix in Codex Fix 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.

P2 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.

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 Codex Fix in Claude Code

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

Labels

agent Features related to agentic system atomic action atomic action related functionality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant