Skip to content

feat(copilot): identify current workspace in workspace lists - #6227

Open
j15z wants to merge 2 commits into
stagingfrom
feat/accessible-workspaces-context
Open

feat(copilot): identify current workspace in workspace lists#6227
j15z wants to merge 2 commits into
stagingfrom
feat/accessible-workspaces-context

Conversation

@j15z

@j15z j15z commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

list_user_workspaces now identifies the request's current workspace while preserving each accessible workspace's ID, name, and effective role. The handler adds isCurrent by comparing each result with the existing tool execution context; unscoped executions return false for every workspace.

This keeps workspace discovery as an on-demand tool call and adds no runtime-context plumbing.

Related: simstudioai/mothership#393

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • bun --cwd apps/sim test lib/copilot/tools/handlers/workflow/queries.test.ts lib/copilot/tools/tool-display.test.ts — 74 tests passed
  • bun run check:api-validation
  • bun run scripts/sync-tool-catalog.ts --check --input=../mothership/copilot/contracts/tool-catalog-v1.json

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not applicable — tool result only.

Post-Deploy Monitoring & Validation

For the first 24 hours, the Copilot owner should watch list_user_workspaces calls for missing or multiple current-workspace markers. Healthy scoped calls return exactly one isCurrent: true; unscoped calls return none. Roll back the focused handler commit if current-workspace marking is incorrect.


Compound Engineering

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 3, 2026 9:23pm

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small additive change to a Copilot query handler and tests; no auth, persistence, or API contract breakage beyond an extra boolean on tool output.

Overview
The Copilot list_user_workspaces tool now annotates each accessible workspace with isCurrent, set when the workspace ID matches the tool ExecutionContext’s workspaceId. Other fields (ID, name, role) are unchanged; when the context has no workspace, every entry gets isCurrent: false.

Tests cover the handler with a mocked listUserWorkspaces, asserting exactly one current workspace when context is scoped.

Reviewed by Cursor Bugbot for commit debb153. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extends list_user_workspaces results with an isCurrent flag derived from the tool execution context.

  • Preserves each workspace’s existing ID, name, and effective role.
  • Marks the matching workspace as current while leaving all entries false for unscoped execution.
  • Adds a focused test covering a scoped request and preservation of workspace metadata.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The handler performs a non-mutating identifier comparison over the existing user-scoped workspace list, preserves prior output fields, and intentionally yields no marker when execution is unscoped.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/tools/handlers/workflow/queries.ts Adds a derived isCurrent boolean to each accessible workspace without changing access control or workspace selection.
apps/sim/lib/copilot/tools/handlers/workflow/queries.test.ts Adds coverage confirming the current workspace is marked and existing workspace fields remain intact.

Reviews (1): Last reviewed commit: "fix(review): use absolute workspace quer..." | Re-trigger Greptile

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