Skip to content

fix(cli): surface bridge bootstrap HTTP errors instead of a serde failure#164

Draft
tieguy wants to merge 1 commit into
mainfrom
claude/cli-bootstrap-error-surface
Draft

fix(cli): surface bridge bootstrap HTTP errors instead of a serde failure#164
tieguy wants to merge 1 commit into
mainfrom
claude/cli-bootstrap-error-surface

Conversation

@tieguy

@tieguy tieguy commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Every verify-page (and bridge action/review) run bootstraps a dev-auth session first. When that bootstrap gets a non-2xx response — 403 because the server isn't in SP42_DEPLOYMENT_MODE=local, or 412 because the Wikimedia token is missing or registered on the wrong wiki — the CLI was parsing the error body as a DevAuthSessionStatus and surfacing dev auth payload is invalid: missing field \authenticated``. The server's real explanation was thrown away. These are first-run setup failures, so it's the worst place to lose the message.

Now the CLI checks the status first and surfaces the server's error envelope with the code, e.g.:

bridge bootstrap failed (HTTP 412): profile probe failed: ... mwoauth-invalid-authorization-wrong-wiki ...

All four bootstrap call sites route through one interpret_bootstrap_response helper.

Tests

Four unit tests over the helper: wrong-wiki 412, disabled-mode 403, body-less status fallback, and the 2xx success path. Verified end-to-end against a live server returning the 412.

🤖 Generated with Claude Code

https://claude.ai/code/session_012yes3h6JUyxkiyxjjS86ai

…lure

The four verify-page/action/review bridge callers fed the bootstrap
response body straight into parse_dev_auth_status without checking the
HTTP status. On any non-2xx bootstrap — 403 (wrong deployment mode),
412 (missing or wrong-wiki token) — the server's `error` envelope failed
to deserialize into DevAuthSessionStatus, so the user saw a cryptic
"missing field authenticated" instead of the server's actual
explanation. These are exactly the failures a dev hits on first setup.

Add interpret_bootstrap_response, which surfaces the `error` envelope
(with status code) on non-2xx and only parses a session status on 2xx.
Route all four bootstrap sites through it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yes3h6JUyxkiyxjjS86ai
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