Skip to content

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

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

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.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 12, 2026 3:22am

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small read-only enrichment of an existing Copilot tool response with no auth, permission, or data-mutation changes.

Overview
The Copilot list_user_workspaces tool now marks which workspace is current in its response.

executeListUserWorkspaces adds an isCurrent flag by comparing each accessible workspace to context.workspaceId, leaving ID, name, and role unchanged. Unscoped requests get false for every workspace.

Reviewed by Cursor Bugbot for commit 6194745. 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

@j15z
j15z force-pushed the feat/accessible-workspaces-context branch from debb153 to d99c740 Compare August 12, 2026 00:45
@j15z
j15z requested a review from a team as a code owner August 12, 2026 00:45
@j15z
j15z changed the base branch from staging to feat/platform-agent August 12, 2026 00:45
@j15z
j15z force-pushed the feat/accessible-workspaces-context branch from d99c740 to 0954cfe Compare August 12, 2026 01:56
@j15z
j15z changed the base branch from feat/platform-agent to staging August 12, 2026 01:56
@j15z

j15z commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #6389. The only retained changes from this layer (the workspace query projection and its test) are now folded into the docs/search ground-floor branch. Closing this PR without deleting its branch.

@j15z j15z closed this Aug 13, 2026
@waleedlatif1
waleedlatif1 deleted the feat/accessible-workspaces-context branch August 14, 2026 06:29
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