Skip to content

chore(coderd/x/chatd): log workspace agent lookup errors in turn preparation - #30865

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/chatd-turn-env-split/log-agent-lookup-error
Oct 16, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/chatd-turn-env-split/log-agent-lookup-error

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Logs the error from getWorkspaceAgent at debug level in turn preparation. prepareGeneration discarded it.

The turn still goes on without the agent, as before. The agent only adds its OS and working directory to the instruction header.

Validation: build and vet pass, and the pre-commit hook 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.

@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:50.507043Z cbe18cf 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.

Base automatically changed from mike/chatd-turn-env-split/remove-noop-tool-filter to main October 16, 2026 20:44
ibetitsmike added a commit that referenced this pull request Oct 16, 2026
…ilter (#30864)

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. #30864 Remove the no-op `allowedBehaviorToolNames` filter
2. #30865 Log workspace agent lookup errors in turn preparation
3. #30866 Rename `prepareGeneration` to `buildTurnEnvironment`
4. #30867 Cover the turn tool policy at `buildTurnEnvironment`
5. #30868 Remove seven end-to-end tool policy tests
6. #30869 Name the `*Server` receiver `p` in `turn_environment.go`
7. #30870 Move the turn preparation helpers into `turn_environment.go`

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

prepareGeneration discarded the error from getWorkspaceAgent. The turn
still continues without the agent, which only decorates the instruction
header, but the error is now logged at debug level.
@ibetitsmike
ibetitsmike force-pushed the mike/chatd-turn-env-split/log-agent-lookup-error branch from cbe18cf to 978e16f Compare October 16, 2026 20:44
@ibetitsmike
ibetitsmike merged commit 2088618 into main Oct 16, 2026
29 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chatd-turn-env-split/log-agent-lookup-error branch October 16, 2026 20:59
@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