This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(console): split the agent-key generator's two failure modes (objectui#8782) - #8787
Merged
Merged
Conversation
…ctui#8782)
The key mint guarded both failure modes behind one disjunction, so a response
that was `ok` but carried no key reached the same `throw` and the same template.
With no `error.message` in the body the real status got interpolated: a 200
whose body simply carried no key was reported as `Request failed (200)` —
naming the one layer known to have worked and sending the reader to the
transport, which is the wrong layer.
The `!res.ok` arm is unchanged, including its `json?.error?.message` read. The
keyless-success arm gets its own sentence and quotes no status.
Reachability measured rather than assumed: the mint route cannot emit a keyless
success (its only success is 201 and it always carries `data.key`). The arm is
where `res.json().catch(() => ({}))` lands every 2xx whose body is not that
envelope — a proxy or sign-in interstitial answering 200 with HTML, an empty
body, a gateway page.
Both arms pinned, the keyless-success case with a control that fires on the same
command shape so its absence assertions are a reading, not a vacuous pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
os-zhuang
marked this pull request as ready for review
September 9, 2026 07:23
os-zhuang
enabled auto-merge
September 9, 2026 07:23
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This was referenced Sep 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8782
What changed
apps/console/src/pages/developer/AgentConnectSection.tsxguarded the key mint behind one disjunction, so both failure modes reached onethrow:The second arm fires on a response that was
ok, and with noerror.messagein the body the template interpolated the real status — a200whose body simply carried no key was reported asRequest failed (200). The request did not fail; the sentence named the one layer known to have worked. That string lands insetError(...)and is the entire report the developer gets.The two arms are now separate:
!res.ok— unchanged, byte for byte, including itsjson?.error?.messageread.Request failed (503)is correct there: 503 is a real failure and the status is real evidence of it.okbut no key — its own sentence, quoting no status: "The request succeeded but the response carried no API key. Nothing failed in transit — inspect the response body of POST /api/v1/keys."Reachability was measured, not assumed
The dispatch flagged its own premise as read-off-the-source rather than observed, so it was established before the wording was written. The result refines the mechanism while confirming the arm is real:
The mint route cannot emit a keyless success. Its only success is
201, and it always setsdata.key(objectstackpackages/runtime/src/domains/keys.ts; pinned atexpect(res.response.status).toBe(201)inhttp-dispatcher.keys.test.ts). So this is not the route misbehaving.The arm is reachable through this consumer:
await res.json().catch(() => ({})), three lines above, turns every 2xx whose body is not that envelope into{}— an SSO or proxy interstitial answering200with HTML, an empty body, a gateway page.!data?.keyis the designated landing site for all of them, and those are exactly the responses for which "request failed" misdirects hardest. That is why the new sentence carries no status at all: quoting a 2xx is what made the old string read as a transport failure that never happened.Tests
New pin
apps/console/src/pages/developer/AgentConnectSection.keylessSuccess-8782.test.tsx, four sections over one shared command shape (errorTextFor), so the control really is a control.Section 3's load-bearing assertions are absences (no
Request failed, no three-digit status), and an absence passes vacuously on a harness that produced no error at all — a dead selector, a click that missed. So section 3 re-runs the same helper on a!res.okresponse inside the same test and requires/Request failed \(\d{3}\)/to fire. With the control lit, the zero is a reading. Section 2 is that same control standing alone as a regression pin for the untouched arm.Ablation (mutate to the pre-fix disjunction, run, restore), from commit
a5852d65b:!res.ok || !data?.key= 1 occurrence; new sentence = 0; blob2099805…differs from HEAD2a1fa4d…Received: "Request failed (200)"(the defect itself, reproduced)git diff HEADempty; blob back to2a1fa4d…, byte-identicalGreen runs (all via the shared verify lock, quoting its own
VERDICTline, on a shared box):pnpm exec vitest run …keylessSuccess-8782.test.tsxVERDICT command-exit 0— 4 passedpnpm exec vitest run --project @object-ui/consoleVERDICT command-exit 0— 95 files, 1116 tests, all passedpnpm --workspace-concurrency=2 --filter @object-ui/console type-checkVERDICT command-exit 0pnpm --workspace-concurrency=2 --filter '@object-ui/console^...' buildVERDICT command-exit 0The typecheck is a real reading over both changed files, not an assumption:
tsc --noEmit --listFilesputs the new test file in the program (subject 1, control 1, 59 console test files total). Its first run was red purely because the workspacedist/*.d.tswere absent; it went green on the same source once the dependency closure was built.Lint is the complete CI unit, not a narrowing.
turbo run lintrunseslint .per package; the wholeapps/consoleunit ran in 15s: 197 files, exit 0, 212 warnings all pre-existing. The two changed files contribute 0 errors and 0 warnings (targeted--format jsonrun, 2 files linted).Gates:
check:control-bytes,check:vi-mock-specifiers,check:vi-mock-inherit,check:shell-escape-residue,check-changeset-presence,check-changeset-no-major— all exit 0.check-governed-queue-guard --teston the three changed paths:NOT GOVERNED.Changeset
apps/consoleis not private and is in the versioned fixed group (@object-ui/console,17.6.0, listed in.changeset/config.json), so a real bump was owed rather than an empty declaration..changeset/8782-agent-key-keyless-success-sentence.mddeclarespatch; the presence gate confirms it: "1 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)".Scope
Held to the fence.
error.userMessageanderror.codeare untouched — that is objectui#7980 and it is gated. Nothing was imported, exported, or hand-rolled fromreadEnvelopeFailureText; thejson?.error?.messageread is preserved exactly and pinned that way by section 1. No published surface moves, so this stays outside Clause-②.The two sibling
Request failed (sites (PackagesPage.tsx,PackageFormDialog.tsxinapp-shell) were checked against the card's own re-check command: both sit inside a!res.ok-only guard and carry no keyless-success disjunction. Nothing else in the repo has this defect — objectui#7980 is referenced here for context only and is not addressed by this pull request.Drafted by the
domain:uidev seat; sessionhttps://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH(written as prose so it survives a later body edit). Landing is the PM seat's — left as draft, no auto-merge.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code