Skip to content

fix(progress): reject inconsistent preflight capability output - #554

Open
sylvesterkaczmarek wants to merge 4 commits into
openai:mainfrom
sylvesterkaczmarek:fix/failed-preflight-worker-status
Open

fix(progress): reject inconsistent preflight capability output#554
sylvesterkaczmarek wants to merge 4 commits into
openai:mainfrom
sylvesterkaczmarek:fix/failed-preflight-worker-status

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Do not report worker delegation/capacity from config_preflight.py execution metadata that is explicitly failed or inconsistent with the helper's own evaluated status.

Fixes #553.

Reproduction / evidence

Current upstream main at 37bf87a692fc72d41f7312cc48808d699d204fba parses capability JSON whenever an item.completed command matches config_preflight.py, without reconciling the command execution metadata with the helper result.

A command item marked status: "failed" can therefore carry otherwise valid-looking status: "ready" capability JSON and still be reported as:

{
  kind: "preflight",
  delegation: "available",
  configuredSlots: 8,
}

The helper has deliberate exit semantics that must be preserved: ready exits 0, blocked exits 1, and incomplete exits 2.

Root cause

preflightStatus() validated the command name and JSON structure but treated execution status, exit code and top-level helper status as unrelated fields.

Fix

  • reject an explicitly failed command item;
  • when a numeric exit code and recognized helper status are both present, require the documented mapping (ready 0, blocked 1, incomplete 2);
  • reject unexplained nonzero exits from legacy payloads without a helper status;
  • preserve capability observations from legitimate blocked and incomplete preflights.

Tests / validation

worker-preflight-failure.test.ts covers:

  • explicit command failure;
  • a ready payload paired with exit 2;
  • a blocked payload paired with the wrong exit code;
  • valid ready, blocked and incomplete controls, including the helper's intentional nonzero exit codes.

The branch is based directly on current upstream main at 37bf87a692fc72d41f7312cc48808d699d204fba and is not behind it.

Full repository tests cannot be run in this execution environment because the repository cannot be cloned here. Pushed-head CI remains the authoritative full-suite validation.

Risk

Low. The parser now checks consistency rather than treating every nonzero exit as failure, so valid blocked/incomplete capability evidence remains visible.

@github-actions github-actions Bot added the bug Something isn't working label Aug 18, 2026
@sylvesterkaczmarek sylvesterkaczmarek changed the title fix(progress): ignore failed preflight capability output fix(progress): reject inconsistent preflight capability output Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed or inconsistent config-preflight commands can report worker capacity

1 participant