Skip to content

fix(slack): explain read access refusals - #47257

Merged
brennanb2025 merged 13 commits into
mainfrom
brennanb2025/fix-high-priority-issues-6
Nov 24, 2026
Merged

brennanb2025 merged 13 commits into
mainfrom
brennanb2025/fix-high-priority-issues-6

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Before, when a bot couldn't read a Slack channel, thread or file, its error didn't say exactly which access condition failed. Now it keeps the cloud's explanation and Update link word for word, and adds the exact reason: missing permission, not in the channel, channel not visible, thread missing, or file missing. Reads from other services don't change.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​176 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​176
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40

What Changed

  • A refused orca slack read keeps Orca Cloud's message unchanged and appends the typed reason (and the missing permission, if any). In --json output the reason and permission also appear as error data.
  • A missing thread also points to orca slack read <channel> for a current ref. A channel the bot can't see also asks to check that the channel or link is in this bot's Slack workspace.
  • A read with no reason (older cloud), a malformed reason, or a non-Slack ref keeps the original message.

Why

Each Slack access condition needs a different fix. A typed reason lets a bot, or the person helping it, tell which one applies without losing the cloud's own next step. This makes failures easier to diagnose; it doesn't fix them. A release bot's read of a thread it was allowed to see, with attachments, came back empty, and that still needs checking after the next desktop release (see Notes).

Linked Issue

Tracked internally (item 383).

Visual Proof

N/A: this changes CLI error text only; there is no rendered interface.

Testing

  • I manually tested these changes locally (covered by tests that run the real CLI read handler against a fake Slack service)
  • Automated tests added/updated: slack-read.test.ts covers an allowed thread read with attachments, a streamed attachment download, every typed refusal, the thread hint, and the unchanged cases
  • Every added refusal test fails if the cloud's message is replaced or the reason is dropped

Performance

None, because the only new work is a few string checks after a failed read.

Risk

Level: Low. The worst case is an extra sentence on a refused read. A plain revert restores the old text.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

After the next desktop release, repeat the release bot's original thread and attachment read. If it is refused, the new reason names the fix. If it still comes back empty with no refusal, the problem is in the cloud's thread fetch, not access. Security, cross-platform, SSH, mobile, and backward compatibility: no impact (CLI-only text, optional response fields).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk
  • N/A screenshots, with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm check:changed passes; CI covers the full suite

@brennanb2025
brennanb2025 marked this pull request as ready for review November 23, 2026 03:02
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

A shared helper maps recognized Slack read refusal reasons to specific guidance. The CLI and runtime use that guidance when handling read failures. Other verbs and unrecognized refusal reasons retain the existing error handling. Tests cover mapped Slack refusals and cases where the original message remains unchanged.

Merge Risk: Low · up to 6a603

Slack read refusals now explain the missing permission or access condition. The mapping is applied to all connectors' read refusals rather than only Slack, so a non-Slack refusal that happens to use a mapped code could show Slack guidance. The risk is minor and limited to message wording.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(slack): explain read access refusals" matches the main change: failed Slack read refusals for history scope, channel membership, channel visibility, and missing threads/files now produc…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is mostly complete and follows the repository template. It has a clear ELI5, a What Changed section with before/after behavior, a Why section that explains the trade-off, a Testing sec…
Full details: Title check

Explanation

The title "fix(slack): explain read access refusals" matches the main change: failed Slack read refusals for history scope, channel membership, channel visibility, and missing threads/files now produce actionable CLI error messages. It is concise, specific, and follows a conventional-commit style. The title does not mention the non-Slack preservation or tests, which is acceptable.

Full details: Description check

Explanation

The description is mostly complete and follows the repository template. It has a clear ELI5, a What Changed section with before/after behavior, a Why section that explains the trade-off, a Testing section that lists the test file and cases, a Performance line, a Risk section with level and revert path, N/A visual proof with reason, and a Notes section with post-release verification steps. Minor gaps: the Linked Issue section cites an internal item (383) rather than a linked GitHub issue, the Testing checkbox for manual testing is unchecked and the 'Fails without this change' item is checked without a clear statement of the manual run, the AI Disclosure section is empty, and the Review section is empty. The description also references a test file (slack-read.test.ts) that does not appear in the raw summary, which lists slack-read-refusal.test.ts, so the test reference should be confirmed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f43b3473-1e2a-44fb-a6ae-85ad1549a3f0
Commits

Reviewing files that changed from the base of the PR and between 5d3e8f9 and 6a60359.

Files selected for processing: 4

  • src/cli/slack/slack-read-refusal.test.ts
  • src/cli/slack/slack.ts
  • src/shared/connector-action-contract.ts
  • src/shared/connectors/slack-read-refusal.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f441f5d-d1a7-4f12-8137-fbfa25b24231
Commits

Reviewing files that changed from the base of the PR and between ffe30cb and 82ae8cf.

Files selected for processing: 4

  • src/cli/slack/slack.ts
  • src/main/runtime/rpc/methods/connector-act-failure.test.ts
  • src/main/runtime/rpc/methods/connector-act.ts
  • src/shared/connectors/slack-read-refusal.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f01f4c2f-9347-4594-825d-425fb6801cb4
Commits

Reviewing files that changed from the base of the PR and between 2c8a1a7 and 801df6a.

Files selected for processing: 3

  • src/cli/slack/slack-read-refusal.test.ts
  • src/main/runtime/rpc/methods/connector-act-failure.test.ts
  • src/shared/connectors/slack-read-refusal.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-high-priority-issues-6 branch from 1299dba to 85706af Compare November 24, 2026 00:27
@brennanb2025

brennanb2025 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Perf scan — #47257 @ e410178 (base 1e04496)

Result: PASS — no findings (no P0/P1).

Scope: src/cli/slack/slack-read-refusal.ts (new), src/cli/slack/slack.ts (callAct failure branch), src/shared/connector-action-contract.ts (two optional fields on the refusal variant), plus the main-process consumers of ConnectorActionResponse (src/main/connector-cloud/connector-actions.ts:44, connector-replies.ts:126). Test file not runtime.

New or changed work

Work Trigger / frequency Process Population × work Bound
slackRead classification in callAct (slack.ts:89-91): verb === 'read', ref.trim(), one OTHER_SOURCE regex test Only when a connector.act answer is ok: false — once per refused CLI call short-lived orca CLI process 1 call × 1 anchored regex over the ref string (the same regex refuseOtherSource already runs on the ref) O(ref length), one per refused call; no loop, no fleet dimension
slackReadRefusal (slack-read-refusal.ts:11): two anchored regexes, one constant-map lookup, join of ≤3 strings Same refused Slack read only CLI process 1 × constant REASON caps at 64 chars, SCOPE at 128; patterns are linear with no nested quantifiers; message is the existing cloud text
Zod schema: reason/scope optional strings on the refusal variant Each cloud action response parsed in main (existing parse, per act call) Electron main +2 optional key checks per response Constant; no new parse, call or payload; success variant unchanged
callAct made export none (test access) — — —

No new timers, polls, subscriptions, IPC, listeners, subprocesses, fs/SQLite, store writes, renderer code or startup imports (new module is a tiny pure CLI-side import, no SDK).

Regression classes touched

  • Re-reading / hot-path rescans: matched (regex on ref) — disproved: one test per refused call, anchored, linear, the input is a single user-supplied ref.
  • Fixed-cadence poll / new idle wakeups: no matching code; idle wakeups/s unchanged (0 → 0) on main, renderer and daemon.
  • Eager startup imports: matched (new import into slack.ts) — disproved: dependency-free 30-line module on the CLI's slack command graph only.
  • All other classes: no matching code.

Six questions

  1. Unused work before gate — reviewed: refusal formatting runs only after ok: false and only for Slack reads; success path untouched.
  2. Ownership multiplication — N/A: no owners/resources; one CLI invocation, one call.
  3. Thread/storage — reviewed: CLI process; main pays only two optional-field zod checks inside an existing parse.
  4. Growth/progress — reviewed: no state, no retries added; the existing host retry for unavailable cloud is unchanged.
  5. Execution host — N/A: pure string work, same on local/SSH/Windows; no extra round trips.
  6. Obsolete work/release — N/A: nothing retained; it throws synchronously.

Evidence: diff and caller trace read at the head (no runtime measurement needed; the costs are constant per refused call). Residual risk: none identified.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: ready for review

Problem: a refused Slack read didn't say which access condition failed, so a bot couldn't tell what to do next.

Change: a refused orca slack read keeps Orca Cloud's message word for word, including any Update link. It then adds the typed reason and the missing permission, and --json output includes them as error data. A missing thread, or a channel the bot can't see, also gets a short next step. Reads from other connectors, an older cloud that sends no reason, and malformed reasons are unchanged.

Fixed during review: an earlier version replaced the cloud's message, which dropped the Update link and gave the wrong advice for deleted files; it also had a host-side mapping that never ran. The current version keeps the cloud's message and adds to it.

Deferred: the thread-hint test still matches part of the hint's wording; some test cases send a permission with every reason.

Verified: CI green, the changed-file checks pass on Linux, slack-read.test.ts (12 tests, fake Slack service), regression audit SAFE, and the perf scan found no regressions.

Still open: this change explains failures; it doesn't fix the original report, where a release bot's read of a thread it was allowed to see came back empty. After the next desktop release, repeat that read. If it is refused, the reason names the fix. If it is still empty with no refusal, the problem is in the cloud's thread fetch.

@brennanb2025
brennanb2025 merged commit 7ebb8cf into main Nov 24, 2026
62 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