Repository navigation
fix: remove false allowedTools/disallowedTools warning and correct tool permission docs (#212) [v6] - #214
Conversation
…ol permission docs (#212)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @ben-vargas's task in 13s —— View job Review of PR #214Verdict: looks good. I found no blocking issues. I reviewed the Code (
Tests
Docs and JSDoc
Example (
Minor suggestions (optional)
No security or performance concerns. This change only removes a warning and edits docs, tests and an example. |
Refs #212
What changed
Warning removed:
validateSettingsno longer warns "Both allowedTools and disallowedTools are specified. Only allowedTools will be used." That was never true. The provider forwards both lists unchanged, and the CLI applies both, with matching deny rules taking precedence. Runtime forwarding is unchanged.Tests:
src/validation.test.tspins that both lists are accepted with no warning, whether set as top-level settings, throughsdkOptions, or mixed.src/claude-code-language-model.test.tspins that both lists are forwarded unchanged to the SDK in each of those three configurations.Docs:
src/types.tsJSDoc and example, a new short README section,docs/ai-sdk-v5/GUIDE.mdand the historicaldocs/ai-sdk-v4/GUIDE.md(Tool Management sections and tables), andexamples/README.mdnow say:allowedToolsonly pre-approves tools (no prompt); it is not an allowlist;toolsrestricts which built-in tools exist (tools: []= none), and MCP tools are controlled separately.The guide tables also no longer say an empty list sends an empty flag; empty lists aren't passed at all. The rewritten Tool Management examples now use
defaultSettings. The v5 guide notes that a scoped Bash deny rule matches the command as written.Example:
examples/tool-management.tsusestools: []for the "no tools" case, and adds a combined case (allowedTools: ['Bash','Read']+disallowedTools: ['Read']) that shows deny wins.CHANGELOG entry under Unreleased → Fixed. No version bump.
Commands run
npm run lint,npm run typecheck,npm test(1156 tests passed),npm run format:check,npm run build,git diff --check. All passed (lint has 2 pre-existing warnings in claude-code-language-model.ts).I ran
examples/tool-management.tslive from a scratch cwd outside the repo, withCLAUDE_CODE_DISABLE_AUTO_MEMORY=1set through the providerenvsetting:tools: [], Claude made no tool calls and reported having no tools.Independent review (Codex gpt-6-astra, xhigh)
defaultSettings;Bash(git log:*)was;Bash(rm:*)protects.