Skip to content

fix: preserve agent task run metadata across Lab offload#7894

Merged
chubes4 merged 1 commit into
mainfrom
fix/7887-agent-task-run-metadata
Jul 13, 2026
Merged

fix: preserve agent task run metadata across Lab offload#7894
chubes4 merged 1 commit into
mainfrom
fix/7887-agent-task-run-metadata

Conversation

@chubes4

@chubes4 chubes4 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Closes #7887

Root cause

The controller created a typed agent_task_run observation record under the durable cook run ID. Lab evidence mirroring later reused that same ID for a generic runner-exec upsert, replacing metadata_json and deleting the typed lifecycle payload required by status and finalization.

Fix

When a mirror target is an existing typed agent-task run, bind the accepted Lab job through the lifecycle handoff operation and merge Lab evidence into the existing observation metadata. Generic runner mirrors retain their prior behavior.

Regression tests

  1. Run cargo test --lib core::runner::evidence::tests::mirroring_lab_job_preserves_agent_task_lifecycle_metadata. It creates the persisted controller proxy, mirrors both running and successful Lab job evidence under its durable ID, then verifies lifecycle rehydration, runner/job identity, typed metadata, and Lab evidence.
  2. Run cargo test --lib core::agent_task_lifecycle::tests::controller_proxy_is_queued_before_handoff_then_binds_runner_child. It verifies the existing proxy-to-runner handoff contract.
  3. Run cargo test --lib core::runner::evidence::tests to exercise the complete evidence-mirroring module.

Backwards compatibility

No schema or CLI contract changes. Existing generic runner-exec mirroring is unchanged. Existing typed agent-task records now retain their lifecycle metadata and gain merged Lab evidence instead of being converted to generic runner records.

Test results

  • cargo fmt --check: passed.
  • cargo test --lib core::runner::evidence::tests: passed, 15 passed; 0 failed; 7,205 filtered out.
  • cargo test --lib core::runner::evidence::tests::mirroring_lab_job_preserves_agent_task_lifecycle_metadata: passed, 1 passed; 0 failed; 7,219 filtered out.
  • cargo test --lib core::agent_task_lifecycle::tests::controller_proxy_is_queued_before_handoff_then_binds_runner_child: passed, 1 passed; 0 failed; 7,219 filtered out.
  • cargo test --lib: started 7,220 tests but exceeded the 600-second command limit after unrelated release tests reported failures.
  • RUST_TEST_THREADS=1 cargo test --lib: exceeded the 1,200-second command limit; unrelated rig-install lint tests reported failures before timeout.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode with openai/gpt-5.6-terra
  • Used for: Investigation, implementation, and regression coverage.

@chubes4 chubes4 merged commit c62305b into main Jul 13, 2026
3 checks passed
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.

agent-task cook: Lab-offloaded persisted run loses agent_task_run metadata

1 participant