Repository navigation
Fix the easy cloud first-use findings from #435 - #438
Yuge Zhang (ultmaster) wants to merge 10 commits into
Conversation
) A real turn reference is base64url JSON naming the thread's UUID, about 130 characters, but Fastify rejects path parameters longer than 100, so loading historical tool details fell through to the web shell's not-found handler. The reference now travels as a bounded `turnRef` query parameter, like the page `before` cursor, and the route test uses a production-length cursor. Fixes HUABU-CLOUD-14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icrosoft#435) Member model requests hand an Agent from the npm `undici` package to Node's built-in fetch, so the two must share a major version. The Dependabot bump to undici 8 (microsoft#346) broke that: undici 8's Agent rejects the handlers Node 24's fetch passes (`invalid onRequestStart method`), so every personal Built-In Pi request on a cloud deployment failed. Pin undici to ^7.30.2, matching Node 24's bundled major and free of known advisories. Native fetch stays in place, so the realm-aligned FormData the OpenAI SDK needs for multipart uploads is unaffected. The outbound tests only asserted that guarded requests throw, which the dispatcher error also satisfied. They now require the guard's own NON_PUBLIC_ADDRESS refusal and check the undici/Node major pairing. Fixes HUABU-CLOUD-10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icrosoft#435) Returning to a running Bubble tab fires both `focus` and `visibilitychange`, and each one blocked the app and covered it with the near-opaque full-page loading screen while a fresh identity check ran (HUABU-CLOUD-08). - Coalesce foreground checks: an event joins a foreground check that is still the deciding one. A later check or a peer's cookie write supersedes it, so the next event checks again. - While re-verifying, keep the app visible under a clear cover that still catches pointer input (the app root stays inert, as before). A check that outlasts one second shows a small "Checking your session…" notice. The full loading screen is reserved for initial loading. Account-change, sign-out, revocation and draft-replay handling are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#435) HUABU-CLOUD-04. The New conversation button reported a missing Agent as a danger toast with only Dismiss, unlike the question-node and PDF paths that already offered setup. It now uses the same setup toast, and that toast offers the two setup paths by name: - Connect device opens Settings at Devices and Agents. - Configure model records Built-In Pi as the explicit choice, retries the start (no model request is sent), and opens Built-In Pi's provider settings, so the requested Chat is waiting when Settings closes. A retry from a toast that outlived its Space does nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A SQL deployment's first Workspace was named "Workspace", so the header read "Workspace: Workspace", and the UI had no way to rename it even though the server already accepts PATCH /api/workspaces/:workspaceId. - New SQL deployments name their first Workspace "Default". The default is found by recency, not name, so existing deployments keep theirs. - Workspace descriptors from the list, get and rename routes carry `canManage`, decided by the same rules as PATCH and DELETE (manage grant for a Bubble person, localhost outside managed mode otherwise). - The Workspace chooser offers an inline rename for those Workspaces; the new name updates the chooser row and, for the active one, the header. - A named Workspace's header label is its name with a chevron instead of a "Workspace:" prefix. Part of microsoft#435 (HUABU-CLOUD-05). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new account that is signed in but not admitted was told only to ask an administrator, and the administrator's People list had a small unlabeled switch with Workspace roles beside it, so it was not clear which control admits someone. - The "No access yet" screen spells out the administrator's path (Settings → People → Service access), notes that the account is already listed, and that the page opens once access is on. - People settings label the switch "Service access", show each person as Administrator, Has access or Waiting for access, and explain that adding someone to a Workspace does not admit them and starts them as a Viewer. Part of microsoft#435 (HUABU-CLOUD-01). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The persistent toast’s retry can create a Chat in the wrong Workspace after a switch because it checks only the Space ID, not the originating Workspace ID.
4 open issues
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Addresses six first-use issues from #435 across cloud history access, guarded requests, session checks, conversation setup, Workspace management, and admission guidance.
Changes:
- Moves history-turn references into query parameters and aligns the server’s Undici dependency with Node’s built-in fetch.
- Keeps the app visible during session verification and adds actionable conversation-setup choices.
- Adds Workspace renaming, clearer default naming, and explicit service-access guidance, with regression tests.
| File | Description |
|---|---|
pnpm-lock.yaml |
Resolves server Undici to 7.30.2. |
packages/shared/src/types/api/workspace.ts |
Adds optional Workspace management capability. |
packages/shared/src/types/api/agent-history.ts |
Moves bounded turn references into query validation. |
docs/architecture/api-design.md |
Documents the revised history-turn endpoint. |
apps/web/src/store/workspaceStore.ts |
Adds rename requests and local name updates. |
apps/web/src/store/previewWorkspace/actions.ts |
Offers setup actions when Chat creation lacks an Agent. |
apps/web/src/store/canvasStore.postCreateEditing.test.ts |
Tests setup actions and Chat retry behavior. |
apps/web/src/store/acpProfilesStore.ts |
Routes setup choices to model or device settings. |
apps/web/src/store/acpProfilesStore.test.ts |
Tests setup-toast actions. |
apps/web/src/pages/WorkspaceSetupPage.tsx |
Adds inline renaming for manageable Workspaces. |
apps/web/src/pages/WorkspaceSetupPage.test.tsx |
Tests rename visibility and submission. |
apps/web/src/pages/CanvasListPage.tsx |
Simplifies named-Workspace labels and adds a chevron. |
apps/web/src/i18n/resources/zh-CN/common.json |
Adds Chinese setup, rename, and access copy. |
apps/web/src/i18n/resources/en/common.json |
Adds English setup, rename, and access copy. |
apps/web/src/components/Shell/SignInGate.tsx |
Deduplicates pending foreground checks and uses a transparent cover. |
apps/web/src/components/Shell/SignInGate.test.tsx |
Tests verification deduplication and delayed notices. |
apps/web/src/components/Settings/sections/PeopleSettings.tsx |
Labels service access and displays admission badges. |
apps/web/src/components/Settings/sections/PeopleSettings.test.tsx |
Tests access labels, badges, and toggling. |
apps/web/src/api/workspace.ts |
Adds the Workspace rename client helper. |
apps/web/src/api/_routes.ts |
Builds history-turn URLs with query parameters. |
apps/server/src/modules/workspaces.route.ts |
Includes management permissions in Workspace descriptors. |
apps/server/src/modules/workspaces.route.test.ts |
Tests local and managed permission descriptors. |
apps/server/src/modules/workspaces.route.access.test.ts |
Tests owner and Viewer rename permissions. |
apps/server/src/modules/storage/storage.workspaces.remote.test.ts |
Expects “Default” for the first SQL Workspace. |
apps/server/src/modules/storage/storage.ts |
Names new SQL deployments’ first Workspace “Default”. |
apps/server/src/modules/security/space-access.test.ts |
Checks access scoping for the revised history route. |
apps/server/src/modules/security/outbound.ts |
Documents the Undici/native-fetch compatibility requirement. |
apps/server/src/modules/security/outbound.test.ts |
Checks version pairing and guard-specific refusals. |
apps/server/src/modules/agent/agent.route.ts |
Reads history-turn references from the query. |
apps/server/src/modules/agent/agent.history-page.route.test.ts |
Tests long cursors and invalid detail requests. |
apps/server/package.json |
Sets the server’s Undici dependency to ^7.30.2. |
Review effort: Balanced
| "intro": "Who may use this Huabu, and which Workspaces they can open. People appear here after they first sign in. Changes apply on their next request.", | ||
| "administrator": "Administrator", | ||
| "access": "Access", | ||
| "serviceAccess": "Service access", |
There was a problem hiding this comment.
Fixed in 2b85f17: the spec now locates the switch by en.people.serviceAccess. apps/web/e2e/member-settings.spec.ts passes locally (3/3).
Test coverageHead tested: Automated
Real browserPlaywright/Chromium against a local server on this branch: Bubble identity with the real Auth0 and Entra authenticators, Postgres structured storage (
The undici 8 swap and the account-switch reload ran in an earlier pass with Bubble's loopback Not covered
🤖 Generated with Claude Code |
Review of
|
The Postgres Workspace contract still expected a first Workspace named "Workspace" (the CI failure), and the People e2e spec located the switch by the removed people.access label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t#435) Space ids are scoped to a Workspace, so the setup toast's retry also checks the initiating Workspace, before retrying and after the binding loads, as createQuestionNodeAndCompose does. Otherwise a Workspace switch to a Space with the same id would create the Chat there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icrosoft#435) Enter and Escape that confirm or cancel a composition no longer save a partial name or close the editor, matching the inline title editors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…microsoft#435) Listing N Workspaces ran N separate authorization operations, each rereading the principal and building a fresh policy. The checks now go through access.canMany, falling back to per-resource can like readableSpaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Summary
Fixes the six items the #435 triage classed as easy to fix, one commit each:
fix(agent): carry the history turn reference in the queryGET /api/agent/history/:threadId/turnnow takesturnRefas a bounded query parameter (max 4096, like the pagebeforecursor). A real cursor is ~130 characters and Fastify's path-parameter limit is 100, so the request never reached the handler. No global router limit change.fix(server): pair the guarded transport's undici with Node's fetchundicito^7.30.2. The guarded member transport hands an npm-undiciAgentto Node's built-in fetch, and undici 8's Agent rejects Node 24's handlers (invalid onRequestStart method). The major came from the Dependabot bump in #346, not #428. 7.30.2 has no known advisories and keeps native fetch/FormData, so the multipart realm fix insetup-proxy.tsis untouched.fix(web): keep the app visible while re-verifying identity on focusfocus+visibilitychangeon one return share one identity check. While a running session is re-verified, the app stays visible under a clear, input-blocking cover (app root stillinert); a check over 1s shows a small "Checking your session…" notice. The full loading screen is kept for initial load. Account-change, sign-out, revocation and draft-replay handling are unchanged.fix(web): lead an unconfigured New conversation into setupuseSettingsUiStore.open. The requested Chat opens behind Settings, so it is waiting when Settings closes.Name the first Workspace Default and let managers rename WorkspacescanManagedecided by the same rules as PATCH/DELETE. The chooser has inline rename for manageable Workspaces. A named Workspace's header label is its name plus a chevron instead of "Workspace: Workspace".Show waiting people how to be admitted and label service accessNot included: the easy half of 07 (deployed revision, pinned checkout, shell default), which is in its own PR, and all need-discussion or deferred items.
Behaviour changes to review
/turn/:turnRef→/turn?turnRef=). The web client and server ship together; no other caller was found.<display name>'s Workspace, with Workspace capitalized as the product term.Verification
pnpm run lint(0 errors),format:check,typecheck,check:i18n,check-headers, andpnpm run testacross all packages pass.turnRef(400), malformed (400), stale (409), missing turn (404), and Space-access scoping.NON_PUBLIC_ADDRESSrefusal and check that the npm undici major matchesprocess.versions.undici. With undici 8 restored, 4 of these tests fail; with 7.30.2 all pass. Live check on Node 24.16.0 (the Dockerfile's base): a guarded GET to a public host and a guarded multipart POST both return 200, and169.254.169.254is still refused withNON_PUBLIC_ADDRESS.canManageand rename for Bubble owner vs. Viewer, the chooser rename, and People badges and switch.Browser verification
Real browser (Playwright/Chromium) against a local Bubble-mode server on this branch, using the deployment's real Auth0 and Entra authenticators from
.env, Postgres structured storage in a disposable container, and an isolated data dir. Test accounts were created for this: an Entra owner in the tenant (viaaz, with an authenticator-app MFA registration) and an Auth0 member (via the Management API). Each signed in through the real provider login in its own browser context. An earlier pass with Bubble's loopbackdefaultdriver gave the same results.Service access: Huabu 435 Member). Turning on the member's access opened the member's waiting tab into the app without a reload, in a new personal Workspace namedHuabu 435 Member's Workspace.canManage: truefor the owner, and the header shows the name with a chevron. The member renamed their Workspace from the chooser; it survived reload. After the owner added the member to "Default" (Viewer) from People, the member's chooser showed "Default" without a rename control, the API reportedcanManage: false, and a directPATCHreturned 404.gpt-6.2-sol. "Reply with exactly: pong 435" got the model's replypong 435. With a deliberately invalid Azure OpenAI key the member got Azure's own 401, so failures surface from the provider rather than from the transport. In the earlier pass, with undici 8 temporarily restored, a member request failed with the audit's exact error ("Connection error. This may be caused by passing an undici dispatcher … incompatible with the fetch implementation"); restoring undici 7 brought the provider's response back.?turnRef=. The old path form reproduces the audit'sRoute GET:… not found404. The owner, whose current Workspace does not hold that Space, gotCanvas not found404.focus+visibilitychange+pageshowmade one identity request. With identity delayed by 2.5s, the app and the open Settings dialog stayed visible under the clear cover, with no full-page Loading screen; a click during the check did not close Settings; "Checking your session…" appeared after 1s; the cover cleared when the check finished. In the earlier pass, switching the tab's session cookie to another principal still did the existing full reload into the new account.Review follow-ups
test:storage-backends, 562 tests) now passes locally against containers.canManagein onecanManybatch (41c8742); the People e2e spec uses the new Service access label (2b85f17).Not verified
Refs #435
🤖 Generated with Claude Code