Repository navigation
fix: port the final computer use validation from upstream #31895 - #143
Conversation
Bring coderd/x/chatd/chattool/computeruse.go, computeruse_test.go, chatprovider/chatprovider.go and chatloop/chatloop.go to upstream 082668f, which adds a7cf3c4 (validate per-call computer actions the same way for every flavor) on top of the commits fork PR #3 already ported. Take the matching ChatComputerUseProvider doc comment in codersdk/chats.go and keep the fork-only fields there.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Closing and reopening only to make GitHub recompute the merge ref against current main ( |
The merge ref now points at current main ( |
Merge evidence for head
|
Fork PR #3 ported 10 of the 11 commits of upstream coder/coder#31895 from PR head
84e305522f. This PR brings in the last one,a7cf3c4057"fix: validate per-call computer actions the same way for every flavor", so the fork matches the merged squash082668fbc1.The upstream commit gives the Anthropic and OpenAI-compatible computer use flavors one shared per-call input type (
computerUseInput.validate) and one action list, so both reject the same malformed actions, off-screen coordinates, durations and key repeats. It also moves the openai-compat case inchatprovider.ComputerUseProviderinto the client switch and updates the related doc comments.Changes
coderd/x/chatd/chattool/computeruse.go,computeruse_test.go,coderd/x/chatd/chatprovider/chatprovider.go,coderd/x/chatd/chatloop/chatloop.go: taken verbatim from082668fbc1.codersdk/chats.go: only upstream'sChatComputerUseProviderdoc comment hunk. The fork-only fields stay.The line counts match the upstream commit file for file (computeruse.go +148/-123, computeruse_test.go +114/-91, chatprovider.go +14/-14, chatloop.go +2/-1, chats.go +3/-2).
Upstream parity
$ git diff 082668fbc1 HEAD -- coderd/x/chatd/chattool/computeruse.go coderd/x/chatd/chattool/computeruse_test.go coderd/x/chatd/chatprovider/chatprovider.go coderd/x/chatd/chatloop/chatloop.go $The output is empty. No fork hunk had to stay in those four files.
chatprovider_test.goalready matched upstream.git diff 082668fbc1 HEAD -- codersdk/chats.gostill shows four fork-only hunks, all from fork features that upstream does not have:Chat.Childrendoc comment describes flat descendantsChat.AgentTypefieldChatContextResource.SubagentNameandSubagentDescriptionChatModelCallConfig.AliasesfieldThe removed helpers (
computerUseSentFields,computerUseFieldsSent,anthropicDurationMillis,anthropicMaxDurationSeconds,anthropicMaxKeyRepeat,coordinateFromInt64in chattool) are unexported, and nothing else in the package uses them.chatopenai/computerusedefines its owncoordinateFromInt64. The changed comment is not copied into any generated TypeScript or API docs.Validation
All runs used
golang:1.26.10-bookwormin a throwaway container:go build ./coderd/x/chatd/... ./codersdk/...: okgo vet ./coderd/x/chatd/chattool/ ./coderd/x/chatd/chatprovider/ ./coderd/x/chatd/chatloop/: okgo test -count=1 -run Computer ./coderd/x/chatd/chattool/: ok, 36 top-level tests passedgo test -count=1 ./coderd/x/chatd/chatprovider/ ./coderd/x/chatd/chatloop/: okNote
Xum opened this PR on Mike's behalf.