feat(slack): add web search to Slack bot agent#1100
Conversation
Use Claude's built-in web_search_20250305 server tool to give the Slack bot web search capability. The API handles search execution server-side, so no external API keys or dependencies are needed. Also handle the pause_turn stop reason for long-running server-side tool execution.
📝 WalkthroughWalkthroughThis change adds a web_search tool to the Slack agent workflow and introduces pause_turn handling to support pausing and resuming long-running server-side turns. The tool type signature was updated from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
web_search_20250305server tool to the Slack bot agent, giving it the ability to search the web when answering questionspause_turnstop reason in the agent loop for long-running server-side tool executionDetails
Uses Claude's native server-side web search — the Anthropic API executes searches automatically. No external API keys, no new dependencies, no new files. Just 26 lines added to
run-agent.ts.The tool is capped at
max_uses: 3per request to control costs ($10/1000 searches).Prerequisite
Web search must be enabled in the Anthropic Console organization settings (Settings > Privacy).
Test plan
bun run typecheck --filter=@superset/api)bun run lint)bun test)pause_turnhandling works by testing with a query that triggers multiple searchesSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.