fix(cli): surface bridge bootstrap HTTP errors instead of a serde failure#164
Draft
tieguy wants to merge 1 commit into
Draft
fix(cli): surface bridge bootstrap HTTP errors instead of a serde failure#164tieguy wants to merge 1 commit into
tieguy wants to merge 1 commit into
Conversation
…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
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.
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 inSP42_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 aDevAuthSessionStatusand surfacingdev 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
errorenvelope with the code, e.g.:All four bootstrap call sites route through one
interpret_bootstrap_responsehelper.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