Skip to content

feat: post Linear issue link to Slack thread on MCP issue creation (CYPACK-1048)#1075

Open
cyrusagent wants to merge 2 commits into
mainfrom
cypack-1048
Open

feat: post Linear issue link to Slack thread on MCP issue creation (CYPACK-1048)#1075
cyrusagent wants to merge 2 commits into
mainfrom
cypack-1048

Conversation

@cyrusagent
Copy link
Copy Markdown
Contributor

Assignee: @PaytonWebber (payton)

Summary

When Cyrus creates a Linear issue via mcp__linear__save_issue during a Slack session, a notification message with the issue link is now automatically posted to the Slack thread.

Changes:

  • Added a ToolResultCallback mechanism to AgentSessionManager that fires when any tool result is processed, allowing consumers to react to specific tool completions
  • Added optional postThreadMessage method to ChatPlatformAdapter interface for mid-session thread notifications
  • ChatSessionHandler registers a tool result listener that detects mcp__linear__save_issue results and posts the issue link (with identifier) to the thread
  • SlackChatAdapter implements postThreadMessage using the existing SlackMessageService

Design decisions:

  • The callback mechanism is generic (not Slack-specific), so other platforms can use it too
  • URL and identifier extraction handles both JSON responses and plain text via fallback regex
  • Error results are silently skipped (no notification on failed issue creation)
  • Callbacks are fire-and-forget with error logging to avoid blocking the main message flow

Resolves CYPACK-1048

Test plan

  • Unit tests for extractLinearIssueUrl (JSON, plain text, empty, no URL)
  • Unit tests for extractLinearIssueIdentifier (JSON, plain text, no identifier)
  • Unit tests for handleToolResultNotification (happy path, wrong tool, error result, missing session, missing adapter method, no URL in result)
  • Unit tests for AgentSessionManager.onToolResult callback mechanism (fires on tool result, multiple callbacks, error results marked, callback errors don't break processing)
  • All 560 package tests pass
  • TypeScript type checking passes
  • Manual validation via F1 test drive with Slack session creating a Linear issue

Tip: I will respond to comments that @ mention @cyrus-ceedar on this PR. You can also submit a review with all your feedback at once, and I will automatically wake up to address each comment.

…YPACK-1048)

When Cyrus creates a Linear issue via `mcp__linear__save_issue` during a
Slack session, a notification message with the issue link is now posted
to the Slack thread automatically.

- Add `ToolResultCallback` mechanism to `AgentSessionManager` for
  reacting to tool results
- Add `postThreadMessage` to `ChatPlatformAdapter` interface for
  mid-session thread notifications
- Implement the hook in `ChatSessionHandler` to detect Linear issue
  creation and post the link
- Add `postThreadMessage` to `SlackChatAdapter`
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