Skip to content

Add continuous agent research with isolated execution - #77

Merged
Andyyesiyu merged 8 commits into
mainfrom
feat/continuous-research-isolation
Sep 8, 2026
Merged

Add continuous agent research with isolated execution#77
Andyyesiyu merged 8 commits into
mainfrom
feat/continuous-research-isolation

Conversation

@Andyyesiyu

@Andyyesiyu Andyyesiyu commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

An outer researcher needs to change its method and publish candidates without losing its notes, budget history, or recovery state. This adds continuous evolve agent sessions and opt-in container execution for research, operators, and target candidates.

Changes

  • Agent Driven has one continuous lifecycle: require an objective and immutable optimizer bundle; publish a best candidate and continue, or finish research explicitly. Remove batch mode, submit_champion, --mode, --continuous, and controller prompt fallback branches. Fixed recipe drivers remain independent.

  • Rename sealed acceptance to seal-research; evaluate the initial and final candidates after research finishes. Old batch manifests are unsupported and require a fresh research workspace; existing continuous sessions retain their history.

  • Add typed, receipted actions; persistent research notes; immutable method activations; publication without ending the session; cumulative usage and interrupted-action recovery.

  • Export exact target-only candidate packages and run them through a Docker sandbox or an isolated Harbor adapter. Keep evaluator files, private Git state, and host credentials outside the research container; expose an explicit aggregate feedback projection.

  • Add a host-owned model broker, local HTTP bridge, and Codex controller file transport. Unknown usage blocks further work.

  • Enforce bounded tmpfs output, archive validation and log capture. An independent supervisor owns deadlines and removes containers after launcher death. Preserve executable modes in method snapshots and worker downloads; new method identities include executable metadata.

  • Centralize host resource policy and record effective limits in receipts. Use a runtime pin manifest with consistency checks; setup validates and reuses local images by immutable ID and actual tool versions, with explicit --rebuild replacement. Consolidate the existing public artifact/metric allowlists into a versioned host-owned declaration.

  • Include the supporting Harbor cancellation, recovery, runtime-plan and exception-accounting changes, two full Terminal-Bench profiles, and recipe-selected Codex versions. Existing recipes retain mutation Codex 0.146.0 and seed Codex 0.143.0; the new full Codex profile explicitly selects 0.149.0. Setup accepts custom recipe paths and passes their mutation version and image tag to Docker. Target evaluator versions and the outer controller version remain independent. Existing benchmark model settings from current main are preserved.

Review the session/action modules first, then candidate/runtime isolation, then Harbor integration and recipe changes. The implementation is consolidated onto current main; experiment output and the obsolete qualification plan are excluded.

  • Preserve ordinary driver startup evaluation. Add agent prepare for development-only research baselines; continuous sealed acceptance evaluates initial and final candidates after finish.
  • Journal isolated controller file imports before directory swaps, keep backups and content identities, and recover before accepting more actions. Document ownership and interruption recovery.

Validation

  • After simplifying to the continuous lifecycle: 104 related tests passed, including two candidate cycles, method adoption, publish-and-continue, pause/resume, process interruption recovery, the Codex wrapper, and all nine legacy recipe regressions. Runtime code decreased by 143 lines. No real model calls.

  • Nine legacy recipes complete a generation with unchanged recipe/operator configuration and real evaluator scripts; only Harbor execution is substituted with deterministic local artifacts. Linux seccomp blocks network sockets in the CLI and descendants. Assertions cover mutation, analyzer success, GEPA admission, certified evaluation, gate, record, and champion update. Separate native local-Harbor GEPA regression also passed without models. These are execution regressions, not benchmark quality measurements.

  • Five real child-process exit points through directory replacement and enqueueing recover exactly one published action; related slow recovery suite: 37 passed.

  • Existing Codex 0.146 image passed an offline read-only CLI/tool probe without rebuilding.

  • Default suite: 1,542 passed, 17 skipped (nine additional full-generation cases are in the opt-in slow tier).

  • Prior isolation implementation, unchanged by the recipe version update — real Docker regressions: 4 passed (output quota, timeout, broker round trip, launcher SIGKILL cleanup).

  • Built wheel and sdist; release-artifact checks: 2 passed, including policy declarations and the runtime pin manifest.

  • Ruff, formatting, ty, lockfile, diff checks, and strict MkDocs build passed.

A real Docker controller run completed three turns with method adoption and continued research after publication, using the copied framework and a fixture model broker. Earlier integration checks also exercised native Harbor evaluation and recovery after an actual SIGKILL without duplicate evaluation. Model responses were fixtures: these checks establish execution paths, not autonomous research improvement. No paid model calls were made.

Current limits

Version selection is covered by setup command-contract tests and seed override tests; arbitrary Codex releases have not been benchmarked for compatibility. Setup reuses validated local images and builds missing ones; mismatches require explicit --rebuild. Validation checks the tool/version contract, not complete environment equivalence.

Isolation requires explicit configuration; legacy host execution remains available. The candidate adapter currently supports single-step trials, and isolated operators are offline. Candidate usage is adapter-reported rather than independently metered. Isolated controller imports use a flushed host journal with roll-forward directory recovery and idempotent enqueueing. Unknown controller usage still requires reconciliation. Operator output import remains non-transactional. Model budgets are checked between calls, and the HTTP bridge buffers streaming responses.

Sandbox images require /bin/sh, tar, sleep, cat and touch. Output is capped at 64 MiB (32 MiB per file, 4096 handoff entries); logs are bounded and truncated. Snapshot transport adds copying overhead. Cleanup after launcher death requires a surviving supervisor and reachable daemon; simultaneous host/supervisor failure still needs reconciliation. See docs/reference/operators.md for the exact limits.

Ready for review. Deployment and merge are outside this change's delivery scope.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 118 files, which is 18 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: afbab3fc-fdfe-4536-a7e5-fe5af0ca2000

📥 Commits

Reviewing files that changed from the base of the PR and between 20806c7 and 5dbf7a7.

📒 Files selected for processing (118)
  • .github/CONTRIBUTING.md
  • AGENTS.md
  • README.md
  • containers/candidate-worker/Dockerfile
  • containers/mutate-codex/Dockerfile
  • containers/runtime-versions.env
  • docs/ARCHITECTURE.md
  • docs/concepts/design.md
  • docs/guides/recipe-to-experiment.md
  • docs/reference/operators.md
  • docs/reference/operators/mutate.md
  • docs/reference/operators/rollout.md
  • docs/reference/terminology.md
  • library/_shared/harbor/config.py
  • library/_shared/harbor/evidence.py
  • library/_shared/harbor/execution.py
  • library/_shared/harbor/rollout.py
  • library/_shared/harbor/state.py
  • recipes/README.md
  • recipes/hyperagents_codex_tbench_full/README.md
  • recipes/hyperagents_codex_tbench_full/evolve.yaml
  • recipes/hyperagents_tbench_full/README.md
  • recipes/hyperagents_tbench_full/evolve.yaml
  • scaffolds/evaluators/harbor/engine.sh
  • scaffolds/evaluators/harbor/harbor_artifacts.py
  • scripts/codex_agent_controller.py
  • scripts/recipe_runtime.py
  • scripts/run_recipe_demo.sh
  • scripts/setup_terminal_bench.sh
  • seeds/codex/README.md
  • seeds/codex/agent.py
  • seeds/codex/skills/task-execution/SKILL.md
  • skills/evolve-agent/SKILL.md
  • skills/evolve-agent/references/agent-driven.md
  • src/evolve/agent_cli.py
  • src/evolve/agent_driver.py
  • src/evolve/agent_evidence.py
  • src/evolve/agent_handoff.py
  • src/evolve/agent_isolation.py
  • src/evolve/agent_launcher.py
  • src/evolve/agent_observability.py
  • src/evolve/agent_optimizer.py
  • src/evolve/agent_queue.py
  • src/evolve/agent_research.py
  • src/evolve/candidate/execution.py
  • src/evolve/candidate/package.py
  • src/evolve/cli.py
  • src/evolve/driver.py
  • src/evolve/feedback.py
  • src/evolve/frozen/interfaces.py
  • src/evolve/frozen/public_artifacts.py
  • src/evolve/integrations/harbor/_candidate_worker.py
  • src/evolve/integrations/harbor/_recovery.py
  • src/evolve/integrations/harbor/_runtime_plan.py
  • src/evolve/integrations/harbor/_time_budget.py
  • src/evolve/integrations/harbor/_worker_environment.py
  • src/evolve/integrations/harbor/isolated_candidate.py
  • src/evolve/operator_isolation.py
  • src/evolve/operators.py
  • src/evolve/orchestration.py
  • src/evolve/public_feedback.py
  • src/evolve/runtime/files.py
  • src/evolve/runtime/model_bridge.py
  • src/evolve/runtime/model_broker.py
  • src/evolve/runtime/policy.py
  • src/evolve/runtime/sandbox.py
  • src/evolve/runtime/sandbox_io.py
  • src/evolve/runtime/sandbox_supervisor.py
  • src/evolve/workspace.py
  • tests/conftest.py
  • tests/fixtures/normalized_recipe_operator_configs.json
  • tests/fixtures/recipe_cycle/harbor.py
  • tests/fixtures/recipe_cycle/offline.py
  • tests/test_agent_driver.py
  • tests/test_agent_evidence.py
  • tests/test_agent_handoff.py
  • tests/test_agent_isolation.py
  • tests/test_agent_launcher.py
  • tests/test_agent_observability.py
  • tests/test_agent_queue.py
  • tests/test_agent_research.py
  • tests/test_candidate_package.py
  • tests/test_codex_agent_controller.py
  • tests/test_contract_recipe_conformance.py
  • tests/test_evaluation_lifecycle.py
  • tests/test_evolve_agent_skill.py
  • tests/test_fast_flow_timeout.py
  • tests/test_harbor_artifacts.py
  • tests/test_harbor_evaluator_config.py
  • tests/test_harbor_evaluator_template.py
  • tests/test_harbor_mutate.py
  • tests/test_harbor_recovery.py
  • tests/test_harbor_runtime_plan.py
  • tests/test_harbor_time_budget.py
  • tests/test_hyperagents_harbor_recipe.py
  • tests/test_isolated_candidate.py
  • tests/test_m0_init.py
  • tests/test_m7_codex_seed.py
  • tests/test_m7_harbor_rollout.py
  • tests/test_m8_dataset_splits.py
  • tests/test_model_bridge.py
  • tests/test_model_broker.py
  • tests/test_operator_isolation.py
  • tests/test_phase_e_recipes.py
  • tests/test_phase_f_init_binding.py
  • tests/test_public_feedback.py
  • tests/test_recipe_composition.py
  • tests/test_recipe_demo_script.py
  • tests/test_recipe_full_cycle.py
  • tests/test_recipe_inventory.py
  • tests/test_release_artifact.py
  • tests/test_runtime_recipe_conformance.py
  • tests/test_runtime_version_pins.py
  • tests/test_sandbox_docker.py
  • tests/test_sandbox_execution.py
  • tests/test_sandbox_transport.py
  • tests/test_terminal_bench_setup_script.py
  • tests/test_worker_environment.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ctive limits

Remove cache-dependent base substitution, share reviewed public artifact declarations, and add pin consistency checks. Add architecture budgets for the two policy declaration modules.
Keep real operator and evaluator scripts, replacing only Harbor execution with deterministic local artifacts. Block network sockets throughout descendant processes and verify gate, record, champion, analysis and GEPA admission outcomes.
@Andyyesiyu
Andyyesiyu marked this pull request as ready for review September 8, 2026 17:47
@Andyyesiyu
Andyyesiyu merged commit bb8f4dd into main Sep 8, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5dbf7a7d36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/evolve/agent_queue.py
Comment on lines +202 to +205
if receipt.get("status") == "queued" and receipt["action"]["type"] == "finish_research":
drain_action(workspace)
else:
_close_budget(workspace, reasons)

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 Badge Drain the final deferred action before closing the budget

When the last permitted controller attempt queues any action other than finish_research, that attempt immediately makes controller_status(...)["exhausted_reasons"] contain attempts, so this branch calls _close_budget before drain_action. _close_budget then marks the queued request resolved without executing it and finishes research with the previous champion. Thus, with the default finite --max-attempts (or a token/controller-cost limit crossed by the attempt), the controller's final fork, commit, or evaluation decision is silently discarded even though executing it requires no further controller attempt; drain eligible queued work before applying controller-only exhaustion.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T17:55:39.576517Z 5dbf7a7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant