Skip to content

fix(app-shell): upgrade links open the runtime's declared upgradeUrl - #34879

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34622-upgrade-url-links
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34622-upgrade-url-links

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Part of #34622

Clause-②: no
Metadata-protocol: none

repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

维护者速读

  • 改了什么:控制台开始读取 /api/v1/runtime/config 已经下发的 upgradeUrl(宿主声明的 Cloud 升级/计费页绝对地址),存储已满横幅的「Upgrade to continue」、AI 用量指示器的 CTA、AI 对话的配额升级按钮,在声明了该地址时直接打开它。
  • 为什么改:这三个链接原来打开 Cloud 根域名;单组织管理员访问 Cloud 根会被直接送回环境,升级链接永远到不了计费页(卡 Environment links to Cloud (storage upgrade, AI quota, marketplace) open the Cloud origin, which a single-organization manager's landing sends back into the environment: link a declared deep Cloud address instead #34622,阻塞 objectstack-ai/cloud#4804)。
  • 风险与回滚:低。未声明 upgradeUrl 时三个链接的目标和显示/隐藏规则与改动前完全相同;回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/runtime-config.ts(upgradeUrl 读取与 getUpgradeUrl())、ui/packages/app-shell/src/layout/AiUsageIndicator.tsx(showCta 的门控)、ui/packages/app-shell/src/console/ai/AiChatPage.tsx(onUpgrade 一处)。
  • 两分钟验证:pnpm --dir ui exec vitest run -t 34622 packages/app-shell/src/runtime-config.test.ts packages/app-shell/src/layout/__tests__/StorageUsageBanner.test.tsx packages/app-shell/src/layout/__tests__/AiUsageIndicator.test.tsx packages/app-shell/src/console/ai/__tests__/AiChatPage.upgradeUrl-34622.test.tsx,预期 24 passed。
  • 需要你做的:无,席位落地。

What changes

  • runtime-config.ts reads the top-level upgradeUrl that RuntimeConfigPlugin serves (objectstack#14514, maintainer ruling cloud#1850 option A). It takes a non-empty string verbatim; absent, empty, whitespace-only and non-string values stay absent. Nothing is composed from cloudUrl. Each payload re-derives the key, so a later payload without it withdraws it. The new getter is getUpgradeUrl(): string | undefined.
  • StorageUsageBanner ("Upgrade to continue"), AiUsageIndicator (the CTA's showCta gate and its click) and AiChatPage (the onUpgrade exit only) open getUpgradeUrl() when it is declared. When it is absent, each one uses cloudConsoleUrl() as before, with the same show/hide rule (card item 3).
  • When upgradeUrl is declared on a runtime whose cloudUrl is empty, the link is now drawn and opens the declared address. Ruling A says the console renders the link when the key is present.
  • Patch changeset for @object-ui/app-shell.

Out of scope, per the seat's correction (comment 6947939206): the marketplace "Open on Cloud" link needs a new Cloud-home key (Clause-②: yes, back to the seat). Nothing under packages/cloud-connection/** changes, and the avatar menu (#34591) is untouched.

Tests

Measured at head 4a23eddd, after a dependency-closure build (pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, exit 0).

  • The new pins follow the shared-harness rule (ruling record 6583487846). The runtime-config, StorageUsageBanner and AiUsageIndicator pins are top-level describe blocks in each component's existing test file. AiChatPage has no shared harness file, so its pin is the new card-named AiChatPage.upgradeUrl-34622.test.tsx.
  • Each link has three kinds of test. Declared: it opens the declared address. Declared with no upstream cloud: it is drawn and opens the declared address. Absent (CONTROL): today's cloudConsoleUrl() target, and no link when the runtime names no upstream cloud. The component pins use the real runtime-config reader; only fetch is replaced, for the config request.
  • Card pins: 24 passed. The four files in full: 114 passed.
  • Ablation: in runtime-config.ts, ? body.upgradeUrl was replaced with ? undefined through scripts/ablation-replace.mjs. The anchor went from 1 hit to 0 and the blob from a0be844f to 8c5e8a2c. 9 declared-path tests went red and the 15 absent/CONTROL tests stayed green, which is the expected direction. The restore was verified: the blob matched HEAD and git diff HEAD was empty.
  • Affected app-shell set: every app-shell test file that names one of the four touched modules, 148 files, 1358 passed.
  • pnpm --filter @object-ui/app-shell run type-check exit 0. Both projects ran, and tsconfig.test.json compiles the test files.
Ablation run
ablation-replace: ok mutation landed: anchor 1 -> 0, blob a0be844f3ef8 -> 8c5e8a2c969a
 Test Files  4 failed (4)
      Tests  9 failed | 15 passed | 90 skipped (114)
ablation-replace: ok restored: blob == HEAD (a0be844f3ef8) and `git diff HEAD` is empty

Acceptance notes

  • The AI usage CTA opens upgradeUrl for both of its labels, "Upgrade to keep going" and "Add credits to continue" (top-up). The runtime config has one upgrade/billing entry, and the card names the billing/plan page for the AI quota.
  • Deviation, declared: I did not run the full app-shell suite locally (2291 test files). A run started under the shared lock and was stopped after 20 minutes so that it would not hold the lock any longer. The local run was narrowed to the 148 files above, which is an import-based narrowing: it does not see tests that render these components through an unnamed parent. CI's sharded Test UI runs the full suite.

Verification


Generated by Claude Code

The console now reads the top-level `upgradeUrl` that /api/v1/runtime/config
already serves (verbatim, absent stays absent) and exposes getUpgradeUrl().
The storage-full banner, the AI usage indicator's call to action and the AI
chat quota CTA open it when declared; absent, each keeps today's
cloudConsoleUrl() target and its show/hide rule.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfrh8TiPJf1i2kMSoa
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa

L1 review (L1-d) · 2026-11-17T14:52Z

L1: REWORK
Head-sha: 4a23edddb51ae9f3b00a403d886382873fb05d64

Read at that head: the file list (9 paths), the full diff, the PR body, card #34622 with triage 6937603697, the seat's Premise corrected 6947939206, claim 6949560908, os-dev report 6951029706, the server producer packages/cloud-connection/src/runtime-config-plugin.ts, and the 52 check-runs (all green).

The code is right, and only one paper item stands between it and an ACCEPT on this same head.

Checklist

  • Shape: draft, base main, Part of #34622. That is correct, because the correction keeps the marketplace Cloud-home key and item 4 on the card. I scanned the whole body: no closing keyword sits beside Environment links to Cloud (storage upgrade, AI quota, marketplace) open the Cloud origin, which a single-organization manager's landing sends back into the environment: link a declared deep Cloud address instead #34622 or any other open card, and 头像菜单:组织相关菜单项按部署形态显示(单租户不显示),切换组织收进菜单,设置里可覆盖 #34591 appears only as "untouched".
  • Premise and producer: RuntimeConfigPlugin serves top-level upgradeUrl only when the host declares one and it passes isAbsoluteHttpUrl (:960-966, :1206). Otherwise no key is served (:713). So the console's verbatim read, with no compose or trim, matches ruling cloud#1850 A. The cloudConsoleUrl docblock's "never re-add a path" holds, because nothing is derived from getCloudBase().
  • Behaviour:
    • All three links now use getUpgradeUrl() ?? cloudConsoleUrl(): StorageUsageBanner :79, AiUsageIndicator ctaUrl/showCta and its click, and AiChatPage onUpgrade.
    • Absent key: byte-for-byte today's target and show/hide rule (card item 3).
    • Declared key with an empty cloudUrl: the link is drawn, per ruling A.
    • initRuntimeConfig re-derives the key per payload, so a payload without it withdraws it. Absent, empty, whitespace and non-string values all stay absent.
  • Changeset: @object-ui/app-shell (private, versioned per privatePackages.version: true, the house form). Sentences checked against the diff:
    • "already serves a top-level upgradeUrl when the host declares one": producer :1206.
    • "absent, empty or non-string value stays absent; nothing is composed": the typeof … && trim() read.
    • "exposes it as getUpgradeUrl()": true.
    • The three named links match the three diff sites.
    • "When the runtime declares no upgradeUrl, each link behaves as before … not drawn on a runtime that names no upstream cloud": the ?? cloudConsoleUrl() fallback with the unchanged gate.
      All true.
  • Clause-② / Metadata-protocol: no / none in the claim, the body and the changeset. The new AppShellRuntimeConfig.upgradeUrl member and getUpgradeUrl sit in a private package. The server side is unchanged and already serves the key. No contract face.
  • Governed: check-governed-merges.mjs --pr 34879 gives 0 of 9 paths and 464 lines, so not Tier H.
  • Tests:
    • Each link has declared, declared-without-cloud and absent-CONTROL cases, through the real runtime-config reader with only fetch stubbed.
    • Ablation of the read (? body.upgradeUrl → ? undefined): 9 declared-path tests red, 15 absent/CONTROL green. That is the right direction and count.
    • Local run: 148 import-narrowed files. The deviation is declared, and CI's 16 Test UI shards cover the full suite.
  • CI at this head: Lint & Repo Gates, TypeScript Type Check, Test UI (all 16 shards), Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset and the Governed Surface Queue Guard all success.

Must-fix

Should-fix

None.

Notes

  • N1, the dev's open question: A is right on both points. AGENTS.md outranks a dispatch on test layout. The <!-- signed: … --> trailer is the seat's one sanctioned dev-written HTML comment (standard order 07:41Z).
  • N2, one URL for both labels: the AI CTA opens upgradeUrl for both "Upgrade to keep going" and the top-up label. The runtime declares one billing entry and the card names billing/plan for the AI quota, so this is consistent. If cloud later declares a separate top-up page, that is a new key and a new card.
  • N3, no live reading: the declaring host is cloud (cloud#4792 / PR check:i18n 应把 unknown-authoring-key lint 判为失败 —— 否则第十份 extract 配置还会照抄同一个错 #4804). An open-source boot serves the key only when upgradeUrl is configured, and the component pins drive both states through the real reader.

A new head is not needed for M1.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa

L1 review (L1-d), same-head re-read · 2026-11-17T14:54Z

L1: ACCEPT
Head-sha: 4a23edddb51ae9f3b00a403d886382873fb05d64

The head is unchanged since REWORK 6951571010, so the diff, the body and the check-runs read there still stand. All 52 check-runs are green: Lint & Repo Gates, TypeScript Type Check, Test UI (all 16 shards), Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset and the Governed Surface Queue Guard.

Must-fix

None. M1 is closed: claim amendment 6951594578 on #34622 adds runtime-config.test.ts, layout/__tests__/AiUsageIndicator.test.tsx and layout/__tests__/StorageUsageBanner.test.tsx to the file surface, under AGENTS.md's shared-harness rule (ruling record 6583487846). Every path in the PR's 9-file list is now inside the claim as amended.

Should-fix

None.

Notes

N1 to N3 from 6951571010 stand:

  • The dev's question is answered A on both points.
  • The AI CTA uses one URL for both of its labels.
  • There is no live reading, because cloud is the declaring host.

Landing: not governed (0 of 9 paths, 464 lines), all checks green. Area o3-H lands it. Part of #34622 leaves the card open and claimed for the marketplace Cloud-home key and item 4. A later push owes a delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

Landing (area o3-H) · 2026-11-17T14:55Z

Reading Value
L1 ACCEPT (L1-d, same-head re-read 6951619352 after REWORK 6951571010; M1 closed by claim amendment 6951594578) on head 4a23edddb51ae9f3b00a403d886382873fb05d64, no should-fix
CI on that head 39 success, 13 skipped (path filter), 0 failed or pending; mergeable_state: clean
check-governed-merges.mjs --pr 34879 NOT governed, 0 of 9 paths; 464 changed lines ≤ 3000
K (d947a93c..origin/main, first-parent) 1 (< 15)

State change: ready + auto-merge enabled. Part of #34622: the card stays open and claimed for the marketplace Cloud-home key (back to the seat before code, Clause-② yes) and item 4 (#34591's ruling).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants