Skip to content

feat(chat): resolve org-chat mentions in their owner workspace and let chat tag a whole workspace - #8310

Merged
waleedlatif1 merged 5 commits into
stagingfrom
feat/org-menu-workspace-context
Sep 26, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
feat/org-menu-workspace-context

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Fix: in organization chats, tagged workflows, tables, files, file/table selections, knowledge bases, and folders were silently dropped server-side — every resolver required the chat's own workspace, which an org chat doesn't have. Each workspace-owned context now resolves in the owner workspace it carries, authorized per chat via resolveInvocationWorkspace (once per workspace, however many tags share it), and is prefixed Workspace <id>: like skills and resource tabs already were
  • Workspace-owned kinds share one typed WorkspaceOwned owner field and one isWorkspaceOwnedContext guard (lib/mothership/chat/context-ownership.ts) used by both the prompt editor and the server — replaces the untyped workspaceId spread
  • New workspace context kind: each workspace submenu in the org + menu now opens with the workspace itself as an attachable first row (same pattern as a folder's self-row). The server describes it through the existing readWorkspaceContext discovery use case, so a tag reveals nothing discovery wouldn't; an inaccessible or out-of-org workspace resolves to nothing. No worker contract change — the mention tells the model which workspace id to target; every tool call is still explicitly scoped and re-authorized
  • Org resource menus now order workspaces like the sidebar (pinned, then recently visited) via useOrderedWorkspacesQuery, and show the workspace IdentityTile
  • Workspace chats are unchanged: everything still resolves in the chat's own workspace

Type of Change

  • Bug fix
  • New feature

Testing

Type-check, lint:check, check:audits (49 audits), block registry, and docs manifest pass. New process-contents tests: owner-workspace resolution and the workspace mention fail on the pre-fix code; the unauthorized-owner and unknown-workspace guards fail when authorization is bypassed. Not yet exercised in a running org chat.

Checklist

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

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 25, 2026 11:50pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds workspace tagging to organization chats and cross-workspace resource resolution.

The PR appears safe to merge based on the reviewed changes and resolved prior threads.

Summary

This PR lets organization-chat resource mentions resolve in their authorized owner workspaces and adds a mention for an entire workspace. It also preserves resource ownership through copied chip links and adds coverage for those paths. The changes since the previous review replace mock-call assertions with result assertions and consolidate test mocks.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Organization chat mention] --> B{Mention kind}
  B -->|Workspace-owned resource| C[Authorize owner workspace]
  C --> D[Resolve resource in owner workspace]
  B -->|Workspace| E[Authorized workspace discovery]
  D --> F[Chat context]
  E --> F
Loading

Reviews (4) · Last reviewed commit: "test(mothership): centralize the chat wo..."

Comment thread apps/sim/lib/mothership/chat/process-contents.ts
Comment thread apps/sim/lib/mothership/chat/process-contents.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 16 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Comment thread apps/sim/lib/mothership/chat/process-contents.test.ts Outdated
@waleedlatif1
waleedlatif1 force-pushed the feat/org-menu-workspace-context branch from 65b9955 to fa5a114 Compare September 25, 2026 23:50
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 19 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 6f33c06 into staging Sep 26, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/org-menu-workspace-context branch September 26, 2026 00:03

This branch was previously deployed

1 inactive deployment
Preview — fa5a114b Deployed Sep 25, 2026 by vercel[bot]
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