Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two AsyncHttpRunner upgrades plus a small runtime-facade ergonomics add, driven by the Archon real-workflow integration in OperationsCenter (
Velascat/OperationsCenter#TBD).{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_stateskeeps the existing sync-terminal path; otherwise fall through to poll. Backward compatible (existing tests still cover 200 +completed/failed).http.poll_pending_codesmetadata. 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_runnersmapping.Test plan
is_registered().httpx.MockTransportscripting Archon's actual response shapes.🤖 Generated with Claude Code