This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(app-shell,plugin-chatbot): repair the three breaks at the AI paywall moment - #7273
Merged
hotlong merged 1 commit intoSep 2, 2026
Merged
Conversation
…all moment The upgrade CTA opened a client-composed control-plane path that guessed the console mount, the app slug and the route, and landed on the API's ENDPOINT_NOT_FOUND JSON. Replace both deep-link helpers with cloudConsoleUrl(): the runtime-supplied cloud origin, no path appended, empty when the runtime named no upstream cloud (callers then render no link at all, instead of the old hardcoded vendor host). On a quota refusal the confirm card now holds an explicit blocked state carrying the server's own next step plus the upgrade action, rather than rolling back to "Confirm / Adjust" as though nothing had happened; transient failures keep the rollback, since retrying is the right next step there. Restoring composer text is now limited to text the user actually typed. Card buttons send canned messages, so the previous handler left the "restore" slot pointing at the user's earlier, already-answered prompt and refilled it.
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
|
hotlong
marked this pull request as ready for review
September 2, 2026 09:29
hotlong
deleted the
claude/issue-7253-paywall-upgrade-link-and-failure-state
branch
September 2, 2026 09:43
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 #7253
A free plan's second build iteration clicks 确认修改, the cloud guardrail refuses with 429
AI_DESIGN_QUOTA_EXHAUSTED, and three things go wrong on top of the refusal. All three are fixed here.1. The upgrade CTA opened a 404
cloudPricingDeepLink()composed${cloudBase}/apps/cloud-control/sys_environment. That guesses three facts owned by whoever deploys the CONTROL PLANE, and misses all three: the console mount (/_console/, injected by that host), the app slug (cloud_control, notcloud-control) and the route (the plan entry is a Page, not thesys_environmentlist). The button landed on the control plane's API 404,{"success":false,"error":{"code":"ENDPOINT_NOT_FOUND"}}.Per the dispatch ruling, the destination is not composed client-side. I checked whether the cloud already publishes one and it does not:
/api/v1/runtime/configcarriescloudUrland nothing else about the console;/api/v1/auth/configis the auth feature/provider payload; the 429 envelope carriesmessageEn/upgrade/topUp/resetsTonightand no URL. So this PR ships the consumer half at the most specific target we are entitled to name, and the producer half is filed as objectstack-ai/cloud#1850 (which also records that the control plane's own two call sites currently spell this URL two different ways).cloudInstallDeepLink+cloudPricingDeepLink→ onecloudConsoleUrl(): the runtime-supplied origin, no path appended. The console mount claims/and redirects to/_console/(mountConsoleStatic,rootRedirectdefault on), landing the user in the Cloud app whose nav carries Billing.|| 'https://cloud.objectos.app'default is gone. A runtime with no upstream cloud has no control plane, and its callers now render no link at all rather than bouncing a self-hosted or air-gapped user to the vendor's SaaS. Three call sites gained that guard: the chat'sonUpgrade, the AI usage ring's CTA, and the marketplace "Open on Cloud" fallback (anhref=""would have reloaded the page).Bounded in-place fix, declared: the issue asks to check line 420's identical composition (
.../sys_package/<id>, the marketplace "Open on Cloud" fallback). It is the same defect in the same helper — verified dead the same way — so it is repaired in the same change rather than left pointing at the same 404. Same file, same gate family; the call site is an error fallback, so nothing else moves.2. The confirm card had no failure state
The 429 rolled the card straight back to 确认修改 / 调整方案 — indistinguishable from a card still waiting for the user, so nothing said the click had failed, and clicking again bought the same refusal.
A quota refusal now parks the card on an explicit blocked state: the existing "not applied" badge, the server's own sentence (which names both exits — tomorrow's reset and the upgrade), and the upgrade action when the host wired one. Ranked BELOW the three server verdicts (published / failed / drafted), so a real outcome always outranks a client-side refusal.
The rollback itself stays for transient failures (offline, per-minute rate limit) — retrying is the right next step there, and that split is pinned. Copy comes from the shared
useAiQuotaCopyhelper the composer banner now also uses, so one 429 cannot be described by two different sentences on the same screen. No new i18n keys — it reuseschatbotQuota.*.3. The composer was refilled with an already-delivered message
The generic "restore my typing" path, not a quota-specific one, as the dispatch asked me to determine.
handleSubmitwriteslastSubmittedRef; the card buttons send canned text and never touched it, so a failed card send restored the user's PREVIOUS prompt — one the agent had already answered — reading as "resend this".Fixed at the general behaviour rather than by branching on the error code: only text the user typed into the composer is restorable now.
handleChangesConfirm,handlePlanApproveandhandleSuggestionClickclear the slot. Restoring genuinely unsent typing is untouched, and is pinned.Tests
New:
packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.quotaBlockedConfirm.test.tsx— the 429 (real ADR-0112 envelope +notSent/statustags) blocks the card, does not refill the composer, and the CTA firesonUpgrade; plus the no-onUpgradeshape and the transient-failure control.packages/app-shell/src/console/marketplace/__tests__/cloudConsoleUrl-7253.test.ts— the URL is the origin verbatim and carries no/apps/, no slug, no object route. The assertions pin the ABSENCE of a composed path, so a later "improvement" that appends one turns red.Both ablated from the committed state, mutation confirmed on disk by blob hash and marker counts, restore confirmed byte-identical (
git diff HEADempty):origin/main(markersquotaBlockedChanges/QuotaBlockedNextStepcounted 0) → 4 of 5 red; the 5th is the unchanged-behaviour control and is correctly green both ways.cloudConsoleUrlmutated to append the old path → 4 of 4 red.Green at
2d5e311ac:pnpm exec vitest run packages/app-shell/→ 596 passed, 1 failed. The failure isanonSeedScope-5746.enumeration.test.tsx, and it is NOT from this change: with all five source files this PR touches checked out atorigin/mainthe same 7 tests fail identically, and they pass on Node 22.22.3 (what CI pins) while failing on this container's Node 26.7.0. Filed as finding(test-env): the 7 anonSeedScope-5746 enumeration assertions all go RED on Node 26 — the localStorage probe sees zero writes #7271.pnpm exec vitest run packages/plugin-chatbot/(inside a 72-file run with the marketplace + layout suites) → 672 passed, 0 failed.pnpm --filter @object-ui/app-shell type-checkand... plugin-chatbot type-check→ both exit 0 with the script name echoed.pnpm --filter @object-ui/app-shell build(dist completeness: 898 emitted files verified) and... plugin-chatbot build→ 0.check:vi-mock-specifiers,check:vi-mock-inherit,check:control-bytes,check:i18n-keys→ all print their own OK line.check-changeset-presence→✅ 11 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s);check-changeset-no-major→✅.Declared narrowing on lint. Both packages the diff touches were linted in full via their own
lintscript (eslint .): app-shell 1046 files, 0 errors; plugin-chatbot 62 files, 0 errors — counts read from--format json, not from my sense of what should be in scope. Untouched packages were not linted locally; that is safe here becauseeslint.config.jsconfigures noparserOptions.project(no type-aware linting), so this diff cannot move a verdict on a file it does not contain. CI runsturbo run lintover all of them regardless.Not measured locally:
check:readme-exportsneeds every package built. After building app-shell and plugin-chatbot it reports zero unjudged self-imports for both; the 61 remaining lines are other packages' unbuiltdist, i.e. a prerequisite of my local run, not a finding.Generated by Claude Code