Repository navigation
feat(builder): add connect-your-agent card and default first workspace - #1577
Merged
Merged
Conversation
New users with no membership get a default workspace on `/` so MCP/CLI setup does not wait on connecting a channel. Super admins see a "Connect your AI agent" card on the contacts dashboard that mints an MCP token and shows hosted-server snippets (NEXT_PUBLIC_MCP_SERVER_URL). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tion - connect-agent snippets pass the token via x-workspace-token instead of the URL query string - extract mintWorkspaceToken shared by the MCP and workspace token actions - serialize ensureFirstForOwner with a transaction-scoped advisory lock so a caller-owned tx is fenced too - fall back to the email for the default workspace name when the user name is empty
…pace creation Remove the "Connect your AI agent" card, the MCP token action, and the NEXT_PUBLIC_MCP_SERVER_URL env; only the first-workspace default remains. Workspace token creation inlines minting again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ify first-workspace flow Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…e (#1577) * feat(builder): add connect-your-agent card and default first workspace New users with no membership get a default workspace on `/` so MCP/CLI setup does not wait on connecting a channel. Super admins see a "Connect your AI agent" card on the contacts dashboard that mints an MCP token and shows hosted-server snippets (NEXT_PUBLIC_MCP_SERVER_URL). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * fix(builder): send MCP token as header and fence first-workspace creation - connect-agent snippets pass the token via x-workspace-token instead of the URL query string - extract mintWorkspaceToken shared by the MCP and workspace token actions - serialize ensureFirstForOwner with a transaction-scoped advisory lock so a caller-owned tx is fenced too - fall back to the email for the default workspace name when the user name is empty * refactor(builder): drop connect-agent MCP card and keep default workspace creation Remove the "Connect your AI agent" card, the MCP token action, and the NEXT_PUBLIC_MCP_SERVER_URL env; only the first-workspace default remains. Workspace token creation inlines minting again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * refactor(workspace): move findActiveByOwner into repository and simplify first-workspace flow Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Summary
/, so MCP/CLI setup no longer waits on connecting a channel. Invited users are not given an extra one.pg_advisory_xact_lock, so two tabs opening/cannot create duplicates./falls through to the workspace list instead of failing.Changes
packages/database/src/repositories/workspace/repository.ts:lockFirstWorkspace(advisory lock) andfindActiveByOwner(live workspace, excludes soft-deleted, ordered byid).packages/business/src/workspace/service.ts:ensureFirstForOwnerlocks, reads through the repository, and creates when the owner has none.findActiveByOwnerdelegates to the repository.apps/builder/src/lib/workspace/create-first-workspace.ts: sharedcallEnsure; new non-redirectingensureFirstWorkspace(returnsnullon a known create error);createFirstWorkspaceredirects to/channels/create?error=….apps/builder/src/app/page.tsx: auto-create and redirect for users without membership.docs/tenancy.md: "Default workspace" section.workspaces.defaultName("{name}'s workspace") in all 20 locales.workspace-ensure-first-for-owner,main-page-default-workspace, updated workspace service and channel route mocks.Test plan
/at once create a single workspaceAgent-first note (invariant 23): no new operation or feature surface. This is sign-in landing plumbing only, so no public API procedure is added.
🤖 Generated with Claude Code