Skip to content

rebase: reap attempt-scoped test chains and give module tests a real budget - #431

Merged
tzhouam merged 2 commits into
mainfrom
fix/rebase-attempt-cleanup-and-test-budgets
Oct 27, 2026
Merged

tzhouam merged 2 commits into
mainfrom
fix/rebase-attempt-cleanup-and-test-budgets

Conversation

@tzhouam

@tzhouam tzhouam commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Why

The vLLM-Omni v0.33 alignment campaign (run-20261024-235522-d35da7) blocked at the test loop with GpuLockTimeout: GPU lock timeout after 3600s. Two engine defects combined:

  1. Module agents launched pytest chains through setsid. Those chains outlived their harness sessions, kept the run's GPU lock for ~7 hours after wave 1 had finished, and the lock's liveness check (kill -0) also counted an unreaped zombie owner as alive.
  2. The model_executor module could never finish: tests/e2e/offline_inference/ needs ~4 h wall-clock, but the per-command TEST_TIMEOUT_SEC was hard-coded to 7200 s, so the suite was SIGKILLed at ~50 % on every attempt and never produced a terminal result.

What

  • rebase_engine/processes.py (new): cleanup_run_processes() reaps same-user processes that carry both run markers (IMX_RUN_ID and IMX_LOG_DIR), keyed by process birth time so a reused PID can never become a bystander kill. Called when a module or debug attempt ends (including a normal return) and in the checkout-lock finalizer.
  • testing/process_tree._alive(): a Z/X state in /proc/<pid>/stat is dead; gpu_lock reuses it so a zombie can no longer hold the mutex.
  • Module test budget: adapters declare rebase.testing.module_timeout_sec (vllm-omni: 21600). It flows to TEST_TIMEOUT_SEC in the agent shell env, the prompt template ({MODULE_TEST_TIMEOUT_SEC}) and the harness budget note appended to each attempt.
  • Settings.rebase_harness_timeout_sec replaces the hard-coded 7200 s session budget passed to ModuleRunConfig.
  • providers/zcode: writes mcp.servers.*.timeoutMs from the session budget; ZCode's 30 s default abandoned bridge tool calls that were still running.
  • Prompt template: drops the obsolete 30 s-polling / detached-chain guidance and tells agents the attempt's background processes are reaped on return.

Tests

  • test/test_rebase_process_lifecycle.py (new, real processes): an unreaped zombie lock owner is displaced; a detached setsid orphan carrying the run markers is reaped while processes of other runs survive.
  • test_provider_zcode.py::test_bridge_timeout_covers_long_running_module_tools.
  • test_rebase_harness_backend.py stub gains the new test_timeout_sec field.
  • Ran locally: test_adapter_knowledge test_assembly test_provider_zcode test_rebase_harness_backend test_rebase_process_lifecycle test_shell_golden test_testing_substrate → 207 passed, 1 skipped; the vllm-omni module prompt renders with TEST_TIMEOUT_SEC=21600.

Notes

This is the engine fix the restarted v0.33 campaign is running with (target vLLM 0232bb3060, backend cursor-agent / grok-4.7-high). No knowledge files are touched.

…budget

The v0.33 campaign (run-20261024-235522-d35da7) blocked at the test loop
with GpuLockTimeout. Module agents had started pytest chains via setsid;
those outlived their sessions, kept the run's GPU lock for ~7 hours after
the engine finished wave 1, and the lock's liveness check (kill -0) also
treated an unreaped zombie owner as alive.

- rebase_engine/processes.py: cleanup_run_processes() kills same-user
  processes carrying BOTH run markers (IMX_RUN_ID + IMX_LOG_DIR), keyed by
  process birth time so a reused PID is never a bystander kill. Called
  when a module/debug attempt ends (including normal return) and around
  the checkout-lock finalizer.
- testing/process_tree._alive(): a Z/X state in /proc/<pid>/stat is dead;
  gpu_lock reuses it so a zombie can no longer hold the mutex.
- Module test budget: adapters declare rebase.testing.module_timeout_sec
  (vllm-omni: 21600 — the offline inference suite needs ~4h, so the old
  7200s wrapper could never reach a terminal result). The value flows to
  TEST_TIMEOUT_SEC in the agent shell env, the prompt template
  ({MODULE_TEST_TIMEOUT_SEC}) and the harness budget note.
- Settings.rebase_harness_timeout_sec replaces the hard-coded 7200s
  session budget passed to ModuleRunConfig.
- providers/zcode: write mcp.servers.*.timeoutMs from the session budget;
  ZCode's 30s default abandoned bridge tool calls that were still running.
- Prompt template: drop the obsolete 30s-polling / detached-chain guidance
  and tell agents the attempt's background processes are reaped on return.

Tests: test_rebase_process_lifecycle.py (real zombie owner, detached
orphan reaped while other runs' processes survive), zcode timeoutMs test,
harness stub gains the new field.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 ⚠️ Failed 2026-10-27T08:41:25.658345Z
We couldn’t complete this review. Comment @codex review to try again.
7974f7d PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…le test budgets

Co-authored-by: Cursor <cursoragent@cursor.com>
@tzhouam
tzhouam merged commit 04e5ed4 into main Oct 27, 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.

1 participant