Repository navigation
fix(console): show the platform-managed state on hosted storage and AI provider settings - #34327
Merged
Merged
Conversation
…I provider settings Claude-Session: https://claude.ai/code/session_01ADHkmSWkWcHBfKEZ8RmTrv Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSWkWcHBfKEZ8RmTrv Co-authored-by: Claude <noreply@anthropic.com>
…control Claude-Session: https://claude.ai/code/session_01ADHkmSWkWcHBfKEZ8RmTrv Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见按拒绝的结构而不是文字识别,并且 AI 行要求两个服务端事实同时成立,避免在仍显示提供商字段的页面上写「由平台托管」。开发提出的开放问题(控制台里保留 席位核对 — ACCEPT · domain:ui#2 · head febd90e · 2026-11-16T07:26Z |
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.
Requested by Steve · project thread
Fixes #34149
Clause-②: no
Metadata-protocol: none
维护者速读
ui/apps/console/src/pages/settings/platformManaged.ts(拒绝与 AI 投影的判定)、SettingsView.tsx的error?.managed分支与aiProviderManaged行、api.ts的runSettingsAction新增一行。ui/下跑pnpm exec vitest run apps/console/src/pages/settings/__tests__/SettingsView.platformManaged-34149.test.tsx,预期 9 例全绿。What changes
The console half of #33891 (server contract landed in #34254).
GET /api/settings/storageanswers409 RESOURCE_CONFLICTwitherror.details.managedBy: 'platform'on a cloud-managed environment.SettingsViewnow reads that refusal by its declared shape (status, code anddetails.managedBy, never the message, viaisPlatformManagedRefusalin the newplatformManaged.ts) and draws a "Managed by the platform" card: no form, no save bar, no retry. A409withoutmanagedBy: 'platform'keeps today's error card.features.cloudManaged === true(plugin-auth answers it from the sameisCloudManaged()the settings projection reads, andFirstRunChecklistalready reads it throughgetAuthConfig, which asks no new request) and the servedaimanifest carries noproviderkey (the projection actually ran). No served field was added.runSettingsActionnow throws the managed refusal like a failed read (status + raw body onpayload) instead of folding it into{ ok: false, message };onActionandonSavetoast "Managed by the platform" for that shape. Read from the code before this change: such a refusal fell to the last branch ofrunSettingsActionand a staleai.testclick toasted the server's English sentence.console.settingsViewin every pack (platformManagedTitle,platformManagedBody,aiProviderManaged);zh-Hantregenerated withnode scripts/gen-zh-hant.mjs.SettingsHub.tsxis untouched: it reads the list (GET /api/settings), which already leavesstorageout on a hosted environment.Tests
New:
__tests__/SettingsView.platformManaged-34149.test.tsx(9 cases) andplatformManaged.test.ts(5 cases).GET storage409 +managedBy: 'platform'→ managed card, no input, no retry, one read;RESOURCE_CONFLICTwithoutmanagedBy→ today's error card with the server's sentence;runSettingsAction: the managed 409 throws with status and raw body; another 409 stays{ ok: false, message }.No existing test was edited.
Ablations (each landed on disk through scripts/ablation-replace.mjs, restored to the HEAD blob)
isPlatformManagedRefusalreturns false → 5 red (storage managed state, stale action, stale save, the helper, the api throw).features.cloudManagedcheck dropped → red: the helper case and the view CONTROL "a page served without a provider on a self-hosted environment draws no line".runSettingsActionthrow line deleted → red: "throws the refusal with its status and raw body".Each run:
ok mutation landedthenok restored: blob == HEAD and git diff HEAD is empty.Acceptance notes
ainamespace and itsproviderkey as constants (platformManaged.ts); the server's table isCLOUD_MANAGED_HIDDEN_SETTINGS. If a later server stops withholding the provider, the line disappears by itself (the manifest check); if it starts projecting another namespace partially, that page draws no line until the console learns it. A served marker on the projected manifest would remove the console constant, but it is a served field (Clause-②, server), so it was not added here.onClearSaved(clear a value beneath an env pin) on a stale page still toasts the server's sentence for a managed refusal; on a hosted environment the managed keys are not served, so the row is not reachable without a stale page.Verification
All on head
febd90e8, run after the last commit.pnpm --filter @object-ui/console type-check: exit 0.cd ui && pnpm exec vitest run packages/i18n/ apps/console/src/pages/settings/: 145 files, 2313 passed, 13 skipped, exit 0 (includes the zh-Hant generated-pack pin and the settings-page bare-literal pin).node scripts/pm/dispatch-gates.mjs --commands): 40 commands, all exit 0;--ranreconciliation: 40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN.pnpm check:new-line-citations(ui): 0 new citations.apps/console/src/pages/settings/andpackages/i18n/, the modules that import the changed files; CI's Test UI shards run the whole tree. No dogfood battery: no!in the title and no(narrowing)arm.Generated by Claude Code