Skip to content

Propagate ARAX's status code instead of dropping it - #151

Merged
maximusunc merged 1 commit into
mainfrom
claude/arax-status-code-propagation-ivt3l0
Sep 1, 2026
Merged

Propagate ARAX's status code instead of dropping it#151
maximusunc merged 1 commit into
mainfrom
claude/arax-status-code-propagation-ivt3l0

Conversation

@maximusunc

Copy link
Copy Markdown
Collaborator

The ARAX worker logged the status code of the ARAX service's response and then threw it away: a non-2xx body was parsed and saved as if it were a TRAPI response, and anything that raised on the way (including .json() on an HTML error page) was swallowed into a non-TRAPI {"status": "error"} blob that the workflow reported as a successful query. Nothing downstream -- the span, the query's logs, the response the caller gets -- was left with a status code to report.

Failures now raise ARAXServiceError carrying ARAX's own status code, which puts it on the task span as arax.status_code, in the query's logs via run_task_lifecycle, and in a TRAPI response whose status/description say what happened; run_task_lifecycle then routes the query to finish_query with an ERROR status, matching the same fix already made in arax_pathfinder. Failures with no response at all -- connect errors and timeouts -- report 502 and 504 rather than a made-up code of their own.

Claude-Session: https://claude.ai/code/session_01BmsMzWR6tNbDM2uSxh47n8

The ARAX worker logged the status code of the ARAX service's response and
then threw it away: a non-2xx body was parsed and saved as if it were a
TRAPI response, and anything that raised on the way (including .json() on
an HTML error page) was swallowed into a non-TRAPI {"status": "error"}
blob that the workflow reported as a successful query. Nothing downstream
-- the span, the query's logs, the response the caller gets -- was left
with a status code to report.

Failures now raise ARAXServiceError carrying ARAX's own status code, which
puts it on the task span as arax.status_code, in the query's logs via
run_task_lifecycle, and in a TRAPI response whose status/description say
what happened; run_task_lifecycle then routes the query to finish_query
with an ERROR status, matching the same fix already made in
arax_pathfinder. Failures with no response at all -- connect errors and
timeouts -- report 502 and 504 rather than a made-up code of their own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmsMzWR6tNbDM2uSxh47n8
@maximusunc
maximusunc merged commit 9972261 into main Sep 1, 2026
2 checks passed
@maximusunc
maximusunc deleted the claude/arax-status-code-propagation-ivt3l0 branch September 1, 2026 19:45
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.19608% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.10%. Comparing base (541a94a) to head (58ae35f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
workers/arax/worker.py 90.19% 3 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
workers/arax/worker.py 76.19% <90.19%> (+76.19%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d9879c...58ae35f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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