Skip to content

perf(slack): skip redundant bot lookups for ordinary replies - #49450

Merged
brennanb2025 merged 5 commits into
mainfrom
fix/slack-reply-html-eligibility
Nov 26, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
fix/slack-reply-html-eligibility

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A bot could do extra work to find its chat again before sending an ordinary Slack reply. Orca now checks whether the reply can become an attachment first.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​201 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​189
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9

What Changed

The CLI requests automatic attachments only when the reply contains a possible HTML fence. The host checks cloud capabilities before looking up the bot’s session, and checks the session before parsing the fence.

Why

An ordinary reply or a reply to a cloud without attachment support has no use for this second lookup.

Linked Issue

STA-18542. Original change tracked in #49288.

Visual Proof

N/A. Slack replies and HTML attachments look the same.

Testing

  • I manually tested these changes locally.
  • Nine Linux tests passed across bot-reply-html-pages, connector-reply-html-page, connector-turn-for-caller, and html-document-fences. The Bun typecheck command used by CI passed on Linux.
  • The CLI prose and older-cloud lookup assertions guard against redundant lookups. The tests also cover the existing HTML staging retry, caller checks, and fence parsing.

Performance

One lightweight text check in the CLI replaces the second host roster and session lookup for ordinary replies. The host performs full HTML parsing only for a file-capable destination and a bot session.

Risk

Level: Low. The precheck must admit every opener the full parser accepts. An older CLI keeps its existing lookup cost on capable destinations. A newer CLI still works with older hosts. A plain revert restores the previous behavior.

AI Disclosure

Review

The host checks conversation ownership before evaluating attachment eligibility.

Agent skill upstream boundary

  • Not applicable.

Notes

The changed RPC code is shared across host platforms and remote connections.

Checklist

  • Small, focused change with the user impact, implementation and rationale explained.
  • Risk, rollback, platform, remote compatibility and performance reviewed.
  • Visual proof addressed above.
  • CI on this commit.

@brennanb2025
brennanb2025 marked this pull request as ready for review November 26, 2026 07:22
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI now requests HTML-page-as-file handling only when a session exists and the reply text has an HTML fence candidate. The connector checks for a session before evaluating cloud feature flags in its rejection condition. Tests cover connector and CLI replies, HTML-file staging, and unlinked replies.

Merge Risk: Minimal · up to 705ee

This change avoids redundant bot lookups for ordinary Slack replies and only requests HTML attachments when the reply contains a possible HTML fence. The examined paths show no regression and the HTML-attachment fallback is preserved, so merge risk is minimal pending normal CI.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a perf fix in the Slack connector that skips redundant bot lookups for ordinary replies. The diff matches this. The CLI requests HTML-page-as-file handling only when a sess…
Description check Passed The description follows the template sections, and the ELI5, What Changed, Why, Testing, Performance, Risk, and Checklist sections have content. The Visual Proof section gives N/A with a reason. Gaps:…
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.
Full details: Title check

Explanation

The title names the change: a perf fix in the Slack connector that skips redundant bot lookups for ordinary replies. The diff matches this. The CLI requests HTML-page-as-file handling only when a session exists and an HTML fence candidate is present, and the host checks cloud features before the bot session. The title uses the conventional commit format and stays within a single line.

Full details: Description check

Explanation

The description follows the template sections, and the ELI5, What Changed, Why, Testing, Performance, Risk, and Checklist sections have content. The Visual Proof section gives N/A with a reason. Gaps: the Linked Issue section cites STA-18542 and #49288 but does not use the required 'Fixes #' form, and the description does not say how the change was verified across platforms beyond Linux. The Testing items are checked but the manual testing box is unchecked, and the AI Disclosure and Review sections are blank or unclear. The Risk level is given as Low but the rollback wording is brief. The Performance section gives a clear one-line reason. Most required content is present, so the check passes.

  • 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: a7d9cf11-0b1b-4e5a-90a6-595dc7fbdad6
Commits

Reviewing files that changed from the base of the PR and between e7389ad and 705eeaf.

Files selected for processing: 2

  • src/cli/bots/bot-reply-html-pages.test.ts
  • src/main/runtime/rpc/methods/connectors/connector-reply-html-page.test.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.

@brennanb2025
brennanb2025 marked this pull request as draft November 26, 2026 07:33
@brennanb2025
brennanb2025 marked this pull request as ready for review November 26, 2026 07:47
@brennanb2025
brennanb2025 merged commit 58b7280 into main Nov 26, 2026
95 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