fix: add TodoWrite to allowed tools in SDK presets#424
fix: add TodoWrite to allowed tools in SDK presets#424webdevcody merged 1 commit intoAutoMaker-Org:mainfrom
Conversation
The TodoWrite tool was missing from the fullAccess and chat tool presets, causing the Claude Agent SDK to crash with exit code 1 when the agent attempted to use it for task tracking. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe change adds the 'TodoWrite' tool permission to two existing TOOL_PRESETS configurations: fullAccess and chat. This expands the available tools in these preset modes without altering existing logic. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/server/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-01-07T15:20:53.127ZApplied to files:
🔇 Additional comments (1)
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 |
Summary of ChangesHello @comzine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the Claude Agent SDK where the agent would crash when trying to use its task tracking feature. By integrating the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a crash by adding the TodoWrite tool to the fullAccess and chat tool presets in the SDK options. The change is straightforward and addresses the problem described. I have added one suggestion to improve maintainability by removing code duplication between the two presets you've modified.
| /** Full tool access for feature implementation */ | ||
| fullAccess: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'WebSearch', 'WebFetch'] as const, | ||
| fullAccess: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'WebSearch', 'WebFetch', 'TodoWrite'] as const, | ||
|
|
||
| /** Tools for chat/interactive mode */ | ||
| chat: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'WebSearch', 'WebFetch'] as const, | ||
| chat: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'WebSearch', 'WebFetch', 'TodoWrite'] as const, |
There was a problem hiding this comment.
The fullAccess and chat tool presets are identical. While this is correct and confirmed by unit tests, duplicating the array literal creates a maintenance risk. If a tool is added to one in the future, it might be missed in the other.
To prevent this, consider defining the array once as a constant and reusing it:
const fullAccessAndChatTools = ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'WebSearch', 'WebFetch', 'TodoWrite'] as const;
export const TOOL_PRESETS = {
//...
/** Full tool access for feature implementation */
fullAccess: fullAccessAndChatTools,
/** Tools for chat/interactive mode */
chat: fullAccessAndChatTools,
} as const;This makes the code more robust and easier to maintain.
Summary
TodoWritetofullAccessandchattool presets insdk-options.tsProblem
The
TodoWritetool was missing from the allowed tools list, causing the Claude Agent SDK to crash with exit code 1 when the agent attempted to use it for task tracking during feature implementation.Error observed:
Solution
Added
TodoWriteto bothfullAccessandchattool presets so the Claude agent can use its built-in task tracking capabilities.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.