Skip to content

fix(preflight): timeout hung adapter auth checks (OPS-002) - #147

Merged
cursor[bot] merged 1 commit into
cursor/adversarial-review-base-256afrom
cursor/ops-002-preflight-timeout-256a
Jul 8, 2026
Merged

fix(preflight): timeout hung adapter auth checks (OPS-002)#147
cursor[bot] merged 1 commit into
cursor/adversarial-review-base-256afrom
cursor/ops-002-preflight-timeout-256a

Conversation

@ravidsrk

@ravidsrk ravidsrk commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes OPS-002 from the adversarial review (c6c486).

adapter_preflight.check() ran auth probes with no timeout, so a hung check could block headless/campaign startup indefinitely.

Changes

  • Default timeout=30 (override via FLEET_ADAPTER_AUTH_TIMEOUT_S)
  • Clear TimeoutExpired failure message
  • Sync substrate + injected-run timeout tests

Base

Merges into cursor/adversarial-review-base-256a (mission BASE).

Open in Web Open in Cursor 

Greptile Summary

This PR adds a timeout for adapter auth preflight checks. The main changes are:

  • Default 30-second timeout for auth probe commands.
  • FLEET_ADAPTER_AUTH_TIMEOUT_S override with fallback for invalid or non-positive values.
  • Clear timeout failure message when an auth command hangs.
  • Synchronized substrate asset and manifest hash update.
  • Tests for timeout reporting, override handling, and invalid env fallback.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is narrowly scoped, preserves existing skip and aggregation behavior, handles invalid overrides, and includes focused tests for the new timeout paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the adapter preflight timeout tests with PyTest to verify timeout handling; three tests passed and the process exited with code 0.
  • Conducted a substrate synchronization check by comparing SHA-256 hashes and timeout markers and then corrected the needle from timeout=auth_timeout to timeout_s; the final sync artifact shows a passing check.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
scripts/lib/adapter_preflight.py Adds a configurable auth probe timeout and reports timed-out checks as preflight failures without blocking startup.
skills/autonomous-fleet-core/assets/substrate/lib/adapter_preflight.py Keeps the substrate copy of adapter preflight logic in sync with the new configurable timeout behavior.
skills/autonomous-fleet-core/assets/substrate/substrate-manifest.json Updates the substrate manifest hash for the synchronized adapter preflight asset.
tests/test_adapter_preflight.py Extends injected-run tests to assert timeout propagation, timeout failure messaging, and invalid env fallback behavior.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Caller
participant Preflight as adapter_preflight.check()
participant Env as FLEET_ADAPTER_AUTH_TIMEOUT_S
participant Auth as Auth command

Caller->>Preflight: check(requires, intent, environ)
Preflight->>Env: read timeout override
Env-->>Preflight: positive float or default 30s
Preflight->>Auth: "subprocess.run(..., timeout=timeout_s)"
alt command completes
    Auth-->>Preflight: returncode
    Preflight-->>Caller: "auth failure if returncode != 0"
else command exceeds timeout
    Auth-->>Preflight: TimeoutExpired
    Preflight-->>Caller: timed-out auth failure message
end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Caller
participant Preflight as adapter_preflight.check()
participant Env as FLEET_ADAPTER_AUTH_TIMEOUT_S
participant Auth as Auth command

Caller->>Preflight: check(requires, intent, environ)
Preflight->>Env: read timeout override
Env-->>Preflight: positive float or default 30s
Preflight->>Auth: "subprocess.run(..., timeout=timeout_s)"
alt command completes
    Auth-->>Preflight: returncode
    Preflight-->>Caller: "auth failure if returncode != 0"
else command exceeds timeout
    Auth-->>Preflight: TimeoutExpired
    Preflight-->>Caller: timed-out auth failure message
end
Loading

Reviews (1): Last reviewed commit: "fix(preflight): timeout hung adapter aut..." | Re-trigger Greptile

Co-authored-by: Ravindra Kumar <ravidsrk@gmail.com>
@cursor
cursor Bot merged commit 1eb4dd6 into cursor/adversarial-review-base-256a Jul 8, 2026
1 of 2 checks passed
@cursor cursor Bot mentioned this pull request Jul 8, 2026
5 tasks
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.

2 participants