feat(pipeline-run): surface API HTTP failures as clean errors#38
Open
arseniy-pplx wants to merge 1 commit into
Open
feat(pipeline-run): surface API HTTP failures as clean errors#38arseniy-pplx wants to merge 1 commit into
arseniy-pplx wants to merge 1 commit into
Conversation
Pipeline-run SDK commands leaked raw requests tracebacks whenever the API answered non-2xx. Manager and annotation methods that call the client now run under a shared error-surfacing context manager that re-raises requests.HTTPError as PipelineRunError with the status, reason, method, URL and a single-line, trimmed response body, so sdk pipeline-runs commands (including submit and annotations) exit non-zero with a one-line message. Client-internal recovery such as the 404 run-id to execution-id fallback and post-submit run recovery keeps handling the statuses it can; per-run graph-state failures reuse the formatted message in each result's error field. on_poll_error and on_submit_error hooks now receive PipelineRunError with the original HTTPError chained as __cause__.
arseniy-pplx
marked this pull request as ready for review
July 20, 2026 18:11
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
surface_http_errorscontext manager for SDK commandserrorfieldContext
Pipeline-run SDK commands currently leak raw
requeststracebacks when the API returns a non-2xx response. The command layer already convertsPipelineRunErrorto a clean non-zero exit; this change makes HTTP failures onsdk pipeline-runscommands cross that boundary instead. Client-internal recovery (the 404 run-id -> execution-id fallback, submission-id run recovery after a failed submit) keeps handling the statuses it can; only unrecovered errors are formatted.Behavior note for downstream hook subclasses:
on_poll_errorandon_submit_errornow receivePipelineRunError(with the originalrequests.HTTPErrorchained as__cause__) instead of the rawHTTPErrorwhen an API call fails with an HTTP status error. Non-HTTP submit errors reachon_submit_errorunchanged.Testing
uv run pytest tests/test_sdk_http_errors.py tests/test_pipeline_runs_cli.pyuvx ruff checkon the touched source filesuv lock --checkgit diff --check