docs(ai-chat): document the chat.agent tools option#3791
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (8)
🚧 Files skipped from review as they are similar to previous changes (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
WalkthroughThis PR adds a dedicated "Tools" guide and updates AI chat docs to document a config-level Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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 deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/ai-chat/tools.mdx`:
- Around line 173-184: The snippet calls anthropic(...) but doesn’t import it,
causing copy/paste to fail; update the example to import anthropic from the ai
package (e.g., include anthropic in the import alongside convertToModelMessages
and streamText or add a separate import for anthropic) so the symbols anthropic,
convertToModelMessages, and streamText are all explicitly imported and the
snippet is runnable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4737fad4-5b2e-4eec-b30c-fa946184dbcf
📒 Files selected for processing (12)
docs/ai-chat/backend.mdxdocs/ai-chat/changelog.mdxdocs/ai-chat/overview.mdxdocs/ai-chat/patterns/human-in-the-loop.mdxdocs/ai-chat/patterns/skills.mdxdocs/ai-chat/patterns/sub-agents.mdxdocs/ai-chat/patterns/tool-result-auditing.mdxdocs/ai-chat/quick-start.mdxdocs/ai-chat/reference.mdxdocs/ai-chat/tools.mdxdocs/ai-chat/types.mdxdocs/docs.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*.mdx
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/*.mdx: MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format
Use Mintlify components for structured content: , , , , , , /, /
Always import from@trigger.dev/sdkin code examples (never from@trigger.dev/sdk/v3)
Code examples must be complete and runnable where possible
Use language tags in code fences:typescript,bash,json
Files:
docs/ai-chat/patterns/tool-result-auditing.mdxdocs/ai-chat/overview.mdxdocs/ai-chat/patterns/sub-agents.mdxdocs/ai-chat/quick-start.mdxdocs/ai-chat/patterns/skills.mdxdocs/ai-chat/reference.mdxdocs/ai-chat/patterns/human-in-the-loop.mdxdocs/ai-chat/types.mdxdocs/ai-chat/tools.mdxdocs/ai-chat/backend.mdxdocs/ai-chat/changelog.mdx
docs/**/docs.json
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/docs.json: Main documentation config must be defined indocs.jsonwhich includes navigation structure, theme, and metadata
Navigation structure indocs.jsonshould be organized usingnavigation.dropdownswith groups and pages
Files:
docs/docs.json
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (AGENTS.md)
Code formatting must be enforced using Prettier before committing
Files:
docs/docs.json
🧠 Learnings (2)
📚 Learning: 2026-03-10T12:44:14.176Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3200
File: docs/config/config-file.mdx:353-368
Timestamp: 2026-03-10T12:44:14.176Z
Learning: In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations. This ensures docs stay in sync with code changes across related PRs.
Applied to files:
docs/ai-chat/patterns/tool-result-auditing.mdxdocs/ai-chat/overview.mdxdocs/ai-chat/patterns/sub-agents.mdxdocs/ai-chat/quick-start.mdxdocs/ai-chat/patterns/skills.mdxdocs/ai-chat/reference.mdxdocs/ai-chat/patterns/human-in-the-loop.mdxdocs/ai-chat/types.mdxdocs/ai-chat/tools.mdxdocs/ai-chat/backend.mdxdocs/ai-chat/changelog.mdx
📚 Learning: 2026-04-30T20:30:29.458Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3226
File: docs/ai-chat/quick-start.mdx:13-13
Timestamp: 2026-04-30T20:30:29.458Z
Learning: In this repo’s documentation MDX files (`docs/**/*.mdx`), use `ts` and `tsx` (not `typescript`) as the code-fence language tags for TypeScript/TSX snippets. Do not flag `ts`/`tsx` code-fence language tags as incorrect in any docs MDX file, since this is the site-wide Mintlify-compatible convention.
Applied to files:
docs/ai-chat/patterns/tool-result-auditing.mdxdocs/ai-chat/overview.mdxdocs/ai-chat/patterns/sub-agents.mdxdocs/ai-chat/quick-start.mdxdocs/ai-chat/patterns/skills.mdxdocs/ai-chat/reference.mdxdocs/ai-chat/patterns/human-in-the-loop.mdxdocs/ai-chat/types.mdxdocs/ai-chat/tools.mdxdocs/ai-chat/backend.mdxdocs/ai-chat/changelog.mdx
🔇 Additional comments (11)
docs/ai-chat/changelog.mdx (1)
7-29: LGTM!docs/ai-chat/overview.mdx (1)
81-83: LGTM!docs/ai-chat/quick-start.mdx (1)
154-154: LGTM!docs/ai-chat/patterns/tool-result-auditing.mdx (1)
11-11: LGTM!docs/docs.json (1)
110-110: LGTM!docs/ai-chat/reference.mdx (1)
48-49: LGTM!Also applies to: 91-92, 196-206, 548-560
docs/ai-chat/patterns/human-in-the-loop.mdx (1)
72-73: LGTM!Also applies to: 77-77, 85-86
docs/ai-chat/patterns/sub-agents.mdx (1)
208-210: LGTM!Also applies to: 244-254, 261-262
docs/ai-chat/patterns/skills.mdx (1)
188-189: LGTM!docs/ai-chat/backend.mdx (1)
28-41: LGTM!Also applies to: 154-180
docs/ai-chat/types.mdx (1)
51-53: LGTM!Also applies to: 89-89, 97-99, 102-102
Document declaring tools on chat.agent: why it matters for toModelOutput across turns, static vs per-turn tools, the typed tools handed back on the run payload, typing messages via InferChatUIMessageFromTools, how config tools relate to skills and toStreamTextOptions, and the manual convertToModelMessages path for customAgent loops.
Three callouts (Tip, Info, Warning) were stacked back-to-back right under the chat.agent() header before any content. Lead with the intro and first example instead: the toStreamTextOptions warning now sits with the example it's about, and the durable-Session note moved to its own short section.
Adds a tools row to ChatAgentOptions and a tools field to the run payload in the reference, plus ResolveToolsEvent and InferChatUIMessageFromTools. Corrects the sub-agents guide so the toModelOutput compression survives across turns (declare tools on the config; convertToModelMessages with tools in customAgent loops). Adds a happy-path Tools section to the backend page, collapses the manual UIMessage triple in types, aligns the HITL and skills examples, and adds a changelog entry plus Tools links from overview and quick start.
6f6fe0a to
61dffcb
Compare
Summary
Documents the new
toolsoption onchat.agent(companion to #3790).Adds a dedicated Tools guide: the three places tools show up (config,
toStreamTextOptions,streamText), why declaring them on the config matters fortoModelOutputacross turns, static vs per-turn tools, the typedrun()payload,InferChatUIMessageFromTools, the relationship to skills, and the manualconvertToModelMessagespath forcustomAgentloops.Threads the option through the rest of the guide: the reference tables, a happy-path section on the backend page, the types page, and the HITL / skills / tool-result-auditing patterns. Corrects the sub-agents guide, where the
toModelOutputcompression was implied to work across turns but silently degraded from turn 2 without config tools.Also unstacks the three callouts that were piled under the
chat.agent()header on the backend page, and adds a changelog entry.