Skip to content

fix(api): answer Linear questions from the task mirror when Linear is not connected - #7612

Open
AviPeltz wants to merge 3 commits into
mainfrom
slack-linear-fallback
Open

AviPeltz wants to merge 3 commits into
mainfrom
slack-linear-fallback

Conversation

@AviPeltz

@AviPeltz AviPeltz commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

From live testing after #7585: "what linear tickets are there for cloud/sandboxes" used to be answered from Superset tasks, which mirror the organization's Linear issues. With the plugin bridge in, an unconnected user got told Linear is not connected instead.

Fix

The context line for an unconnected Linear now says Superset tasks mirror the org's Linear issues and to answer read questions from the task tools, noting the source. "Not connected" is reserved for anything that needs Linear itself, such as filing or commenting. GitHub has no mirror, so its line is unchanged.

Testing

  • bun test src/app/api/integrations/slack (120 pass)
  • bunx tsc --noEmit --pretty false in apps/api (exit 0)
  • bunx biome check apps packages

https://claude.ai/code/session_01BRrjyTLHZbdYSM5JYkff4B


Summary by cubic

Fixes the Slack agent's response when Linear is not connected so it can still answer read questions from Superset tasks (which mirror Linear issues) instead of refusing with "Linear is not connected". The "not connected" message is now reserved for actions that actually require Linear, like filing or commenting. GitHub is unchanged since it has no mirror.

Written for commit a8ba9b7. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • When Linear is disconnected, Slack can direct Linear issue questions to available Superset task information and identify it as a copy.
    • For requests that require a disconnected integration, the assistant indicates that the integration is unavailable.
  • Tests
    • Added coverage verifying that the assistant mentions Superset task information and reports Linear as disconnected when answering a Linear-related question.

… not connected

Since #7585 the Slack context told the model to say Linear is not
connected rather than guess, which also stopped it answering read
questions it used to answer from Superset tasks, the organization's
synced copy of its Linear issues. The line now names the mirror as the
source for reads and reserves "not connected" for anything that needs
Linear itself.

Claude-Session: https://claude.ai/code/session_01BRrjyTLHZbdYSM5JYkff4B
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b8901c5c-5d55-4d34-a8d0-b72786cecd0c

📥 Commits

Reviewing files that changed from the base of the PR and between bc54392 and a8ba9b7.

📒 Files selected for processing (2)
  • apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.test.ts
  • apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.ts

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


📝 Walkthrough

Walkthrough

The Slack agent now supports fallback descriptions for disconnected integrations. Linear directs issue questions to Superset task tools when unconnected. A test checks the agent context for the fallback and Linear’s disconnected status.

Changes

Linear fallback context

Layer / File(s) Summary
Fallback capability contract
apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.ts
SlackPlugin now accepts an optional fallback description. Linear defines guidance for using Superset task tools and attributing answers to Superset’s copy.
Disconnected Linear behavior
apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.ts, apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.test.ts
Disconnected-plugin context appends configured fallback text while retaining the instruction to report Linear as disconnected when the request requires it. A test checks the fallback and disconnected status.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: saddlepaddle

Merge Risk: ⚪ Minimal · up to a8ba9

Slack can use Superset task tools when Linear is disconnected, and the fallback identifies the task mirror as the source. No merge-blocking issue was established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a8ba9

The fallback uses task tools already available to the Slack agent and does not connect Linear or grant new Linear actions. No introduced security issue was established, but the task service’s authorization was not independently verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed guidance affects Slack requests mentioning Linear when its disconnected state is resolved; it can steer those reads to the existing Superset task path without expanding the offered tool set.

Trust Boundaries and Controls

  • observed — Superset task tools remain allowlisted and use the request’s user- and organization-scoped client; disconnected Linear does not supply Linear plugin tools. Authorization inside the task service was not independently inspected.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the problem, the fix, and the testing performed. It does not include the repository checklist section, but the required change and validation details are otherwise complete.
Title check ✅ Passed The title uses conventional commit format and clearly describes the main change: answering Linear questions from the task mirror when Linear is disconnected.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ✅ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Admin (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

This branch was previously deployed

1 inactive deployment
preview — a8ba9b70 Deployed Sep 25, 2026 by AviPeltz via Deploy Admin #10421
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