feat(api): request and session IDs from the frontend, client error endpoint and axiom frontend dashboard - #69
Merged
Conversation
…dpoint and axiom frontend dashboard - X-Request-ID / X-Correlation-ID accepted when they are UUIDs (canonicalized to lowercase, anything else dropped) and logged as request_id / correlation_id, also on queued tasks - CORS allows both headers - POST /client-errors/: no auth, bounded body (unknown keys rejected), logs client_error, returns 204; throttle scope client_error 30/min - Tests for the middleware, Celery propagation, CORS preflight and the endpoint (204/400/429) Spec: specs/2026-10-01-obs-01-client-errors-backend.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
| Duplication | 0 |
🟢 Coverage 96.49% diff coverage · +0.01% coverage variation
Metric Results Coverage variation ✅ +0.01% coverage variation (-1.00%) Diff coverage ✅ 96.49% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (22b3f7a) 4735 4525 95.56% Head commit (2a8eb1e) 4791 (+56) 4579 (+54) 95.58% (+0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#69) 57 55 96.49% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
What and why
Frontend and backend logs can't be joined today: the frontend sends no IDs, CORS would reject them, and a response that fails the frontend's Zod check is logged by the backend as a clean 200. This lets the frontend send a request ID and session ID on every call (logged as
request_id/correlation_id, also on the Celery tasks a call queues) and report errors from the browser to a new endpoint, logged asclient_errorfor Axiom.Changes
X-Request-ID/X-Correlation-IDaccepted when they are UUIDs (canonicalized to lowercase, anything else dropped) and logged asrequest_id/correlation_id, also on queued tasksPOST /client-errors/: no auth, bounded body (unknown keys rejected), logsclient_error, returns 204; throttle scopeclient_error30/minThe matching Axiom dashboard (
prunplanner-frontend) lives in the workspace repo'saxiom/builder.How it was verified
QA PASS (2 rounds: full, then scoped to the UUID canonicalization).
uv run ruff check,ruff format --check,ty checkandpytest(798 passed) green. e2e stack: preflight, IDs inrequest_finishedandclient_error, 204 / 400 / 429, expired token still 204, uppercase IDs logged lowercase, invalid IDs replaced.Deploy order
Backward compatible (new endpoint, optional headers); deploy before the frontend change (obs-02) that sends them.
🤖 Generated with Claude Code