feat(gateway): stop falling back to the legacy gateway - #1221
Open
brandonleung wants to merge 6 commits into
Open
feat(gateway): stop falling back to the legacy gateway#1221brandonleung wants to merge 6 commits into
brandonleung wants to merge 6 commits into
Conversation
A refused mint carried a fixed message per status, so a blocklisted account read "Your access to this project has changed" instead of the server's detail naming the contact address. Prefer the response detail when it is a short string; keep the fixed message otherwise. Generated-By: PostHog Desktop Task-Id: ecbe6b2f-c266-41d5-be54-272f86314c88
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
…detail Dropping the legacy fallback means a 404 is no longer useful here, but the server still owes one to builds that do fall back. The mint now says which this is, so the server can answer a refusal with its reason without breaking every older client. The detail it sends is printed to a terminal, so control characters and the escapes an ANSI sequence is built from are stripped first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
401 and 404 come from layers with no wizard-specific message, so their detail is DRF's "Invalid token." or "Not found.", which replaced the copy naming the upgrade command. A detail that cleans to nothing also falls back now, and a control-only detail pins both the C1 arm and the trim running after the substitution. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Suppressing it on 401 and 404 assumed those carry DRF boilerplate, but the mint answers 404 with the reason a client that does not declare itself gets: the rollout is off, or the program is unrecognised. Dropping that text left the user with generic copy on the refusals that explain themselves best. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
brandonleung
force-pushed
the
brandon/wizard-w1-1-drop-legacy-posture
branch
from
September 8, 2026 20:57
e57e7ef to
2aa1b63
Compare
brandonleung
marked this pull request as ready for review
September 8, 2026 21:14
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.
Problem
When the gateway-token mint answers 404 or 401 the CLI treats it as "this PostHog has no gateway" and quietly runs on the legacy one, caching that decision for ten minutes. That path enforces none of the mint's limits, and the user is never told the wizard changed how it is paying for the run.
Changes
The fallback goes, and a refusal ends the run with the server's reason.
GatewayEdition,legacyAuth, the retry cache, thegateway_editiontag and every legacy branch: the agent interface's per-key header build, the pi harness gateway module, the triage provider, bootstrap, MCP prompt streaming, andHostResolution.gatewayUrl.isMintRefusalcovers 400, 401, 403, 404 and 429, each with a message the user can act on, and the server'sdetailis preferred whenever it sends one.reads_refusal_reason, which is how the server knows it may answer a refusal with its reason rather than the 404 an older build needs.Carries a cherry-pick of #1215, which is closed unmerged.
Test plan
pnpm test. Every deleted symbol is grepped for surviving readers, each refusal status is pinned to its message, and a detail made only of control characters falls back to the fixed copy.pnpm typecheckfails onsrc/wizard.tsfor a yargs alias inference issue that is present onmainand untouched here.