Skip to content

fix: port the final computer use validation from upstream #31895 - #143

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/port-upstream-pr31895-computeruse
Nov 10, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/port-upstream-pr31895-computeruse

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

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 squash 082668fbc1.

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 in chatprovider.ComputerUseProvider into 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 from 082668fbc1.
  • codersdk/chats.go: only upstream's ChatComputerUseProvider doc 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.go already matched upstream.

git diff 082668fbc1 HEAD -- codersdk/chats.go still shows four fork-only hunks, all from fork features that upstream does not have:

Hunk Fork origin
Chat.Children doc comment describes flat descendants #99 (fork-nested-subagents)
Chat.AgentType field #112 (fork-agent-definitions)
ChatContextResource.SubagentName and SubagentDescription #83 (fork-agent-definitions)
ChatModelCallConfig.Aliases field #100 (agent definition model aliases)

The removed helpers (computerUseSentFields, computerUseFieldsSent, anthropicDurationMillis, anthropicMaxDurationSeconds, anthropicMaxKeyRepeat, coordinateFromInt64 in chattool) are unexported, and nothing else in the package uses them. chatopenai/computeruse defines its own coordinateFromInt64. The changed comment is not copied into any generated TypeScript or API docs.

Validation

All runs used golang:1.26.10-bookworm in a throwaway container:

  • go build ./coderd/x/chatd/... ./codersdk/...: ok
  • go vet ./coderd/x/chatd/chattool/ ./coderd/x/chatd/chatprovider/ ./coderd/x/chatd/chatloop/: ok
  • go test -count=1 -run Computer ./coderd/x/chatd/chattool/: ok, 36 top-level tests passed
  • go test -count=1 ./coderd/x/chatd/chatprovider/ ./coderd/x/chatd/chatloop/: ok

Note

Xum opened this PR on Mike's behalf.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T13:40:12.837009Z 5f7cb6d Manual request
ℹ️ 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 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 5f7cb6d592

ℹ️ 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".

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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (77b20734d2) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (77b20734d2), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit ce517a4 into main Nov 10, 2026
21 of 28 checks passed
@ibetitsmike
ibetitsmike deleted the mike/port-upstream-pr31895-computeruse branch November 10, 2026 14:13
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head 5f7cb6d592c2a18686fe0544320b6e77d9651c3e:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant