Skip to content

fix: merge user-provided disallowedTools instead of overwriting#335

Merged
benbrandt merged 1 commit intozed-industries:mainfrom
blimmer:fix/merge-user-disallowed-tools
Feb 20, 2026
Merged

fix: merge user-provided disallowedTools instead of overwriting#335
benbrandt merged 1 commit intozed-industries:mainfrom
blimmer:fix/merge-user-disallowed-tools

Conversation

@blimmer
Copy link
Contributor

@blimmer blimmer commented Feb 20, 2026

The disallowedTools merge fix from #295 was regressed by #316 when the options object was restructured. Restore the merge behavior and add regression tests for all three documented merge fields (disallowedTools, hooks, mcpServers).

Fixes #334

@cla-bot cla-bot bot added the cla-signed label Feb 20, 2026
import type { ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";

let capturedOptions: Options | undefined;
vi.mock("@anthropic-ai/claude-agent-sdk", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid this regression again in the future, I wanted to add some tests for this behavior.

I took the approach of a more integration-style test. However, if you prefer a more unit-style approach, we could also extract a utility method to build this object and test that.

I definitely don't feel strongly on the approach, so feel free to guide in the direction you'd prefer!

@blimmer blimmer marked this pull request as ready for review February 20, 2026 16:38
@blimmer blimmer force-pushed the fix/merge-user-disallowed-tools branch from f57e3af to 95b4e9d Compare February 20, 2026 16:39
The disallowedTools merge fix from zed-industries#295 was regressed by zed-industries#316 when
the options object was restructured. Restore the merge behavior and
add regression tests for all three documented merge fields
(disallowedTools, hooks, mcpServers).

Fixes zed-industries#334
@blimmer blimmer force-pushed the fix/merge-user-disallowed-tools branch from 95b4e9d to 5ca946c Compare February 20, 2026 17:28
@benbrandt benbrandt merged commit b57a429 into zed-industries:main Feb 20, 2026
2 checks passed
@blimmer blimmer deleted the fix/merge-user-disallowed-tools branch February 20, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disallowedTools from user-provided options are silently overwritten instead of merged

2 participants