Skip to content

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

@blimmer

Description

@blimmer

Summary

User-provided disallowedTools passed via _meta.claudeCode.options.disallowedTools are silently overwritten by ACP's internal disallowed tools list, rather than being merged as documented in NewSessionMeta.

Details

This was previously fixed in #295 (commit 7c87fe7), but was inadvertently regressed by #316 (commit be618f5, "Switch over to built-in Claude Code tools"), which restructured createSession and moved disallowedTools inline into the options object literal — losing the post-creation merge logic.

In the current code (src/acp-agent.ts), userProvidedOptions is spread at line 1235, but disallowedTools on line 1254 overwrites any user-provided value. The hooks and mcpServers fields correctly implement merge semantics; disallowedTools is the only one that doesn't.

Expected Behavior

User-provided disallowedTools should be merged with ACP's internal list, consistent with the documented behavior in NewSessionMeta and the patterns used for hooks and mcpServers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions