Skip to content

feat(coderd/x/chatd): allow attach_file in root plan-mode chats - #25388

Merged
ethanndickson merged 1 commit into
mainfrom
planning-tools-e6v2
May 19, 2026
Merged

ethanndickson merged 1 commit into
mainfrom
planning-tools-e6v2

Conversation

@ethanndickson

Copy link
Copy Markdown
Member

attach_file was registered for plan-mode turns but never added to builtinPlanToolAllowed, so the per-turn ActiveTools allowlist filtered it out and calls failed with Tool not active in this turn: attach_file. This was an omission rather than a deliberate block — the tool (#24280) landed shortly after plan mode (#24236) and no subsequent edit to the allowlist picked it up.

Add attach_file under the isRootChat case, matching how other artifact-producing tools (propose_plan, write_file, edit_files) are gated. The tool only reads from the workspace and writes to chat-attachment storage, so it preserves plan mode's invariant of not making implementation changes to the workspace. Subagents in plan mode remain restricted to the minimal read-only surface.

@ethanndickson
ethanndickson marked this pull request as ready for review May 15, 2026 12:16
attach_file lets agents store a workspace file as a durable chat attachment. It was registered for plan turns but excluded from the per-turn ActiveTools allowlist because builtinPlanToolAllowed did not list it, so calls failed with 'Tool not active in this turn: attach_file'.

The tool only reads from the workspace and writes to chat storage, so it preserves plan mode's 'no workspace implementation changes' invariant. Group it with the other artifact-producing tools (propose_plan, write_file, edit_files) under the isRootChat case so root plan chats can attach files while subagents stay restricted to the minimal read-only surface.
@ethanndickson
ethanndickson force-pushed the planning-tools-e6v2 branch from f093b13 to 889748a Compare May 18, 2026 04:07
@ethanndickson
ethanndickson merged commit 9444edd into main May 19, 2026
26 checks passed
@ethanndickson
ethanndickson deleted the planning-tools-e6v2 branch May 19, 2026 07:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants