Skip to content

fix(seer): extract clean message from coding agent HTTPError bodies#113305

Merged
sehr-m merged 2 commits intomasterfrom
sehr/seer-extract-api-error-message-backend
Apr 17, 2026
Merged

fix(seer): extract clean message from coding agent HTTPError bodies#113305
sehr-m merged 2 commits intomasterfrom
sehr/seer-extract-api-error-message-backend

Conversation

@sehr-m
Copy link
Copy Markdown
Member

@sehr-m sehr-m commented Apr 17, 2026

When a coding agent launch request fails with an HTTPError, surface the human-readable message from the API response body (e.g. Anthropic's {"error": {"type": "...", "message": "..."}} shape) instead of a generic "Failed to launch coding agent: 500 Error: ..." string. Adds extract_api_error_message() in seer.autofix.utils and wires it into both the v2 autofix launch path and the v3 explorer handoff path.

When a coding agent launch request fails with an HTTPError, surface the
human-readable message from the API response body (e.g. Anthropic's
{"error": {"type": "...", "message": "..."}} shape) instead
of a generic "Failed to launch coding agent: 500 Error: ..." string.
Adds extract_api_error_message() in seer.autofix.utils and wires it
into both the v2 autofix launch path and the v3 explorer handoff path.
@sehr-m sehr-m requested a review from a team as a code owner April 17, 2026 16:07
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 17, 2026
Comment on lines 71 to +73


def extract_api_error_message(response: Any) -> str | None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add some tests for this function?

Adds unit tests for the JSON body extraction helper: Anthropic's nested
error.message shape, top-level message, missing/invalid bodies, non-dict
bodies, non-string messages, and DRF-style detail keys (unsupported).
@sehr-m sehr-m merged commit 010cb6e into master Apr 17, 2026
61 checks passed
@sehr-m sehr-m deleted the sehr/seer-extract-api-error-message-backend branch April 17, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants