Skip to content

refactor(coderd/x/chatd): remove the no-op allowedBehaviorToolNames filter - #30864

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/chatd-turn-env-split/remove-noop-tool-filter
Oct 16, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/chatd-turn-env-split/remove-noop-tool-filter

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Removes allowedBehaviorToolNames, allToolNames, and TestAllowedBehaviorToolNames, and the active-name check they fed in appendDynamicTools.

The check never skipped a tool. appendDynamicTools returns early for Explore mode and plan mode, so at the check, allowedBehaviorToolNames always returned every tool name. A dynamic tool that shares a built-in tool's name is still dropped with a warning.

Validation: go test ./coderd/x/chatd/ -run 'Dynamic|AllowedExplore|StopAfterPlan' passes, and the pre-commit hook (build, lint/go, lint/go/new-code) passed.

Stack

This stack splits #28757, as requested in review. It moves the code that prepares a chat turn into one file, turn_environment.go, and moves the tool policy tests from full turns to a table test. chatd behaves as on main, except for the debug log in #30865.

  1. refactor(coderd/x/chatd): remove the no-op allowedBehaviorToolNames filter #30864 Remove the no-op allowedBehaviorToolNames filter
  2. chore(coderd/x/chatd): log workspace agent lookup errors in turn preparation #30865 Log workspace agent lookup errors in turn preparation
  3. refactor: rename prepareGeneration to buildTurnEnvironment #30866 Rename prepareGeneration to buildTurnEnvironment
  4. test(coderd): cover the turn tool policy at buildTurnEnvironment #30867 Cover the turn tool policy at buildTurnEnvironment
  5. test(coderd/x/chatd): remove end-to-end tool policy tests #30868 Remove seven end-to-end tool policy tests
  6. refactor(coderd/x/chatd): name the Server receiver p in turn_environment.go #30869 Name the *Server receiver p in turn_environment.go
  7. refactor(coderd/x/chatd): move turn preparation helpers into turn_environment.go #30870 Move the turn preparation helpers into turn_environment.go

Xum, an AI agent, opened this PR for @ibetitsmike and wrote this description.

…ilter

appendDynamicTools returns early for Explore mode and plan mode, so
allowedBehaviorToolNames always returned every tool name and the
active-name filter in front of the collision check skipped nothing.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T17:44:53.457905Z 6605838 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike
ibetitsmike merged commit 5ccbef0 into main Oct 16, 2026
60 of 62 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chatd-turn-env-split/remove-noop-tool-filter branch October 16, 2026 20:44
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 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