Skip to content

fix(organization-search): hide the block where Search is off, isolate the Slack identity sweep in the People cron - #10589

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/organization-block-visibility
Dec 1, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/organization-block-visibility

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Two release-readiness fixes from the infra audit.

1. Hide the Organization Search block where it can't run

  • getBlockVisibility now disables the organization block, the same way the block-visibility kill switch does, for a personal workspace (no organization) or an organization without Search. It uses the same check that refuses the block's runs (isKnowledgeMemberAccessAvailable).
  • That function is the single source every block-discovery surface reads, so the block disappears from all of them: the client overlay (toolbar, ⌘K search, mentions, tool pickers), the Assistant's workflow authoring, and the catalog.
  • As with the kill switch, a block already placed in a workflow still executes, and its runs still refuse an organization without Search.
  • The client integration-access rule added in fix(organization-search): refuse runs resumed by someone else, single-source operations, surface-neutral shared tools #10562 stays as is.

Not done: hiding list_my_activity while the my-activity flag is off. Block visibility is keyed by block type, and dropdown options have no per-organization or per-flag gate: option functions are evaluated without workspace context. The closest supported behavior is already in place:

  • the Search MCP and the Assistant only list the tool when the flag is on
  • a block run refuses with "Activity listing is not enabled for this organization"

Hiding the option would need a new options gate, e.g. a host-context feature that dropdown option functions can read; that should get its own design.

2. Isolate the Slack identity sweep in the People cron

Before, a Slack identity sweep error made /api/cron/people-directory-sync return 500 even though the directory sync had committed. Now each sweep is settled on its own:

  • a failed sweep is logged and named in a new optional failed field
  • the other sweep's count is still reported
  • the invocation returns 500 only when the directory sweep fails, since the Slack refresh retries on its own schedule

The route contract gains the optional failed array. No generated or Assistant contract file changes; no migration.

Type of Change

  • Bug fix

Testing

  • block-visibility.test.ts: the block is hidden for an organization without Search and for a workspace outside any organization, and offered where Search is on.
  • people-directory-sync/route.test.ts: a Slack sweep failure returns 200 with the directory count and failed: ['slackIdentities']; a directory failure returns 500 that still reports the Slack count.
  • Each test fails on the previous code.
  • Related suites pass: 11,319 tests across core, catalog, mothership, credentials, workflows, blocks, integrations and cron. Audits: boundaries, client-boundary, tool-registry-boundary, unused-exports, test-patterns, test-types, comment-hygiene, api-validation:strict.

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)

… Search; isolate the Slack identity sweep in the People cron

- getBlockVisibility disables the Organization Search block, as a kill switch does, for a personal workspace or an organization without Search, so every discovery surface (toolbar, search, mentions, tool pickers, the Assistant's workflow authoring, the catalog) stops offering a block that always fails there. Execution of placed blocks is not gated.
- The People cron logs and names a failed sweep in failed, reports the other sweep's count, and fails the invocation only when the directory sweep fails.
@vercel

vercel Bot commented Dec 1, 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 Dec 1, 2026 6:19pm 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 5 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issues were found.

Summary

Hides Organization Search where Search is unavailable and reports the two People cron sweeps separately.

  • Organization Search only appears where its organization has Search.
  • The People cron reports directory and Slack failures separately.

Reviews (2) · Last reviewed commit: "fix(organization-search): hide only the ..." · Reviewed by Greptile

@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 Dec 1, 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 5 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 4c6fde5 into staging Dec 1, 2026
143 of 154 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/organization-block-visibility branch December 1, 2026 19:01

This branch was previously deployed

1 inactive deployment
Preview — 851d269a Deployed Dec 1, 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