Skip to content

One default browser profile per workspace; new chats use the workspace's default (GODM-35) - #33

Merged
danielehrhardt merged 2 commits into
mainfrom
agent/c-pro/7894ace6d153
Sep 29, 2026
Merged

danielehrhardt merged 2 commits into
mainfrom
agent/c-pro/7894ace6d153

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

What does this change?

Fixes GODM-35. The Browser page showed two profiles marked Default (the global default and the workspace's default), and a new chat started with Godmode inside a workspace ignored that workspace's default profile.

One default at a time

  • The Default badge now marks the profile that new chats in the workspace picked in the sidebar use: the workspace's default, or the global default when the workspace has none. In "All workspaces" or "Global" that is the global default. The Import sessions "Into" picker and the agent form's profile list follow the same rule.
  • The default is listed first. Its tooltip says where it applies ("New chats in Solakon GmbH browse here").
  • The card menu is scoped to the sidebar workspace:
    • Make default in <workspace> on one of that workspace's profiles makes it the default.
    • On the global default, the same item makes the workspace follow the global default again.
    • On another global profile it reads Move to <workspace> as default, which is the existing move from the workspace settings.
    • Both go through PATCH /api/workspaces/:id { browserProfileId }.
  • Only the global default is protected from deletion and moving (matches the core rule). The labels now say "Global default…".

New chats use the workspace's default

  • conversations.workspace_id (migration 12, deliberately without a FK so backup restores don't drop chats) records the sidebar workspace a global agent's chat was started in. Workspace agents keep using their own workspace. Unknown workspace ids are ignored.
  • resolveProfileForAgent: the chat's own profile → the agent's pinned profile → the default of the agent's workspace (or else the chat's workspace) → the global default. The desktop agentBrowserProfile mirrors it.
  • Every way of starting a chat passes the sidebar workspace: home composer, voice, agent "Start chat", "Run task" (POST /api/agents/:id/run), the automation one-prompt card and "Create an agent". The composer's browser chip shows "Default — daniel@solakon.de · Default of the Solakon GmbH workspace" before and after sending.
  • Delegation keeps the caller's workspace. A chat-picked profile is passed on when it's within the target's reach (global, or the target's or caller's workspace).
  • Deleting a workspace clears workspace_id on its chats, so they go back to the global default.

docs/ARCHITECTURE.md is updated.

How was it tested?

  • pnpm -r typecheck passes for shared, core and desktop. pnpm build:ui builds.
  • bun test in packages/core after merging main: 696 pass, 0 fail.
  • New tests:
    • workspaces.test.ts: a global agent's chat browses with the default of the workspace it was started in; an explicit pick wins; workspace agents and unknown workspaces are ignored; deleting the workspace resets the chat.
    • mcp.test.ts: delegation keeps the caller's workspace and its chat-picked profile.
  • Manual check against a scratch core plus the Vite UI, with a Solakon GmbH workspace and three profiles:
    • The Browser page shows a single Default per scope.
    • "Make default in Solakon GmbH" on the global default moves the badge and clears the workspace default.
    • A new chat's browser chip and an existing workspace chat both resolve to the workspace's profile.

# Conflicts:
#	apps/desktop/src/pages/browser/browser-page.tsx
#	apps/desktop/src/pages/chat/chat-conversation.tsx
@danielehrhardt
danielehrhardt merged commit e3f877d into main Sep 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant