Skip to content

Check the output budget when a CAD worker exits before polling - #25

Draft
bhupendrafire-ai wants to merge 1 commit into
stevecad:mainfrom
bhupendrafire-ai:codex/completed-worker-output
Draft

bhupendrafire-ai wants to merge 1 commit into
stevecad:mainfrom
bhupendrafire-ai:codex/completed-worker-output

Conversation

@bhupendrafire-ai

@bhupendrafire-ai bhupendrafire-ai commented Nov 9, 2026 •

Copy link
Copy Markdown

What doesn't work

A CAD worker can write more than output_limit and finish before the first polling interval. Both process-wait paths return its exit code without checking the completed log, so a successful fast exit bypasses the configured output budget.

The regression waits for a short-lived worker to complete before the polling loop observes it. With 32 output bytes and a 16-byte budget, the original implementation returns success instead of raising the output-limit error.

The change

Extract the existing log-size check and also run it after process completion on Windows and POSIX. Cancellation and deadline checks keep their existing timing; the completion check only enforces the output budget.

Tests

python -m unittest tests.test_cad_process tests.test_worker_failure tests.test_cad_strategy

Windows: 20 tests ran with no failures (one Linux-only skip). The added regression covers over-budget output, an exact-budget result, and output_limit=None. The over-budget case failed before the fix. POSIX execution was not available on this machine.

The documented Windows test setup also needed keyring for the existing test-vault guard; that setup correction is separate from this PR.

  • This pull request makes one change.
  • It changes at most ~400 lines in at most 25 files (not counting lockfiles, vendored or generated files).
  • It contains text files only.

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