Skip to content

feat(async-http): 200-as-kickoff + poll_pending_codes for Archon-shaped APIs#6

Merged
Velascat merged 1 commit intomainfrom
feat/async-http-archon-quirks
May 8, 2026
Merged

feat(async-http): 200-as-kickoff + poll_pending_codes for Archon-shaped APIs#6
Velascat merged 1 commit intomainfrom
feat/async-http-archon-quirks

Conversation

@Velascat
Copy link
Copy Markdown
Owner

@Velascat Velascat commented May 8, 2026

Summary

Two AsyncHttpRunner upgrades plus a small runtime-facade ergonomics add, driven by the Archon real-workflow integration in OperationsCenter (Velascat/OperationsCenter#TBD).

  • 200-as-kickoff fall-through. Some backends ack async dispatch with HTTP 200 + a non-terminal status (Archon's {accepted: true, status: "started"}). Previously 200 was unconditionally treated as a synchronous terminal result, mapping such acks to immediate failure. Now: 200 + status-in-terminal_states keeps the existing sync-terminal path; otherwise fall through to poll. Backward compatible (existing tests still cover 200 + completed/failed).
  • http.poll_pending_codes metadata. Comma-separated list of HTTP codes that mean "still pending, keep polling". Default empty (preserves the strict 200-only success). Lets callers tolerate Archon's by-worker 404s during pre-registration without modifying the runner per backend.
  • ExecutorRuntime.is_registered(kind). Public helper so callers can register-if-missing idempotently without touching the private _runners mapping.

Test plan

  • 10 new tests covering both kickoff modes, the new pending-codes flag (success path, sleep cadence, integer validation, non-pending non-200 still fails), and is_registered().
  • Full ExecutorRuntime suite: 65 passing.
  • Downstream proven against the OC archon dispatcher with httpx.MockTransport scripting Archon's actual response shapes.

🤖 Generated with Claude Code

…ed APIs

Two AsyncHttpRunner upgrades driven by the Archon real-workflow
integration design (WorkStation/docs/architecture/adapters/archon-real-workflow-integration.md):

1. **200-as-kickoff fall-through.** Some backends ack async dispatch
   with 200 + a non-terminal status (e.g. Archon's
   `{accepted: true, status: "started"}`). The previous behavior
   treated 200 as synchronous-terminal unconditionally, which mapped
   such acks to immediate failure. Now: if the response carries a
   status at `poll_status_path` whose value is in `terminal_states`,
   keep the existing sync-terminal behavior; otherwise fall through
   to the poll loop. Backward-compatible with the existing tests
   (200 + status:"completed"/"failed" still goes the sync path).

2. **`http.poll_pending_codes` metadata.** New comma-separated list
   of HTTP codes that mean "still pending, keep polling" rather than
   "fail the run". Default empty (preserves existing strict 200-only
   poll-success behavior). Archon's by-worker endpoint 404s during
   the worker pre-registration window; this lets the dispatcher set
   `http.poll_pending_codes = "404"` and tolerate the race.

Plus a tiny ergonomics add on the runtime facade:

3. **`ExecutorRuntime.is_registered(kind)`.** Public helper so
   callers can register-if-missing idempotently without touching
   the private `_runners` mapping.

10 new tests cover the 200-ack path (with and without 404 grace),
the new pending-codes flag (success, sleep cadence, integer
validation, non-pending non-200 still fails), and `is_registered()`.
ExecutorRuntime suite: 65 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Velascat Velascat merged commit 03768cd into main May 8, 2026
6 checks passed
@Velascat Velascat deleted the feat/async-http-archon-quirks branch May 8, 2026 01:39
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