Skip to content

Assign browser profiles to workspaces (GODM-25) - #23

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

danielehrhardt merged 2 commits into
mainfrom
agent/c-pro/9290926c8f8b

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

What does this change?

You can now assign a browser profile to a workspace after the profile has been created (GODM-25). Before this, a profile's workspace could only be set when creating it.

  • Browser → profile menu → "Assign to workspace…" opens a picker listing Global and every workspace. Each row shows which profile that workspace's agents browse with today.
    • A "Use for ⟨workspace⟩'s agents" switch decides whether the profile becomes that workspace's default. It is forced on when the workspace has no profile yet.
    • When the profile you're moving is the default of its current workspace, a note says which profile that workspace falls back to.
  • Workspace settings → "Browser profile" picks the profile the workspace's agents use. The options are the global default, this workspace's own profiles, and global profiles (picking one moves it into the workspace).
  • Core.
    • PATCH /api/browser/profiles/:id accepts workspaceId.
    • Workspace gets a derived browserProfileId (its default profile), and WorkspaceInput.browserProfileId sets it (null = use the global default).
    • Rules:
      • The global default can't be moved.
      • A profile moved into a workspace with no default becomes its default.
      • The workspace it leaves falls back to the global default, the same as when a profile is deleted.
      • Cookies and sessions stay with the profile, and agents that pinned it keep it.
    • Workspace create and update run the assignment in the same transaction, so a rejected profile leaves nothing half-saved.
  • Agents still can't change browser profile assignments through MCP tools; this stays a human-only setting.

How was it tested?

  • pnpm -r typecheck; pnpm --filter @godmode/desktop build.
  • bun test in packages/core after merging the latest main: 643 pass, 9 skip, 0 fail.
  • New tests:
    • browser-profiles.test.ts: moving a profile into and out of workspaces, how the default is decided in each scope, isDefault together with a move, the fallback for the workspace a profile leaves, and the 400 (global default) and 404 (unknown workspace) cases.
    • workspaces.test.ts: browserProfileId on create and update, clearing it, and rollback on a rejected profile.
  • Ran the web dashboard against an isolated data dir and drove it with Playwright: assign from the Browser page, assign from workspace settings, and the leaving-default note. No console errors. Screenshots are on GODM-25.

Checklist

  • pnpm typecheck and pnpm test pass
  • cargo clippy / cargo test pass (if apps/desktop/src-tauri changed) — not changed
  • API changes are reflected in packages/shared and apps/desktop/src/lib/api.ts
  • No secrets, tokens or personal data in code, fixtures, logs or screenshots
  • Docs updated where behaviour changed (docs/ARCHITECTURE.md, README)

# Conflicts:
#	README.md
#	apps/desktop/src/components/workspaces/workspace-dialog.tsx
#	packages/core/src/server/routes/workspaces.ts
#	packages/core/src/services/workspaces.ts
#	packages/shared/src/api.ts
#	packages/shared/src/models.ts
@danielehrhardt
danielehrhardt merged commit 5033ed1 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