Skip to content

fix(coderd/x/chatd): make OpenAI computer use stateless#25624

Draft
ibetitsmike wants to merge 2 commits into
mainfrom
mike/openai-computer-use-stateless
Draft

fix(coderd/x/chatd): make OpenAI computer use stateless#25624
ibetitsmike wants to merge 2 commits into
mainfrom
mike/openai-computer-use-stateless

Conversation

@ibetitsmike
Copy link
Copy Markdown
Collaborator

Mux opened this PR on behalf of Mike.

OpenAI computer-use chats now run stateless against OpenAI by forcing store=false and clearing previous_response_id before chain-mode selection. This avoids invalid OpenAI Responses requests that combine store=false with previous_response_id.

This also preserves empty OpenAI reasoning items that carry response item IDs, so stateless replay keeps the reasoning item required before provider computer calls.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review
Copy link
Copy Markdown

coder-agents-review Bot commented May 22, 2026

Review posted | Chat
Requested: 2026-05-22 15:20 UTC by @ibetitsmike

Review history
  • R1 (2026-05-22): 13 reviewers, 3 Nit, 1 P2, 6 P3, COMMENT. Review
  • R2 (2026-05-22): 13 reviewers, 5 Nit, 1 P2, 7 P3, APPROVE. Review
  • R3 (2026-05-22): 10 reviewers, 5 Nit, 1 P2, 7 P3, APPROVE. Review

deep-review v0.5.0 | Round 3 | 0d9718e..df1da85

Last posted: Round 3, 13 findings (1 P2, 7 P3, 5 Nit), APPROVE. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Author fixed (b92e676) responses.go:181 WithStorageDisabled silently no-ops for unrecognized type at OpenAI key R1 Hisoka P3, Chopper P3, Meruem P3, Knov P3, Bisky Note, Ryosuke Note Yes
CRF-2 P2 Author fixed (b92e676) responses.go:151 WithStorageDisabled doc comment narrates implementation mechanism R1 Gon Yes
CRF-3 P3 Author fixed (b92e676) responses.go:154 WithStorageDisabled uses "storage" while file vocabulary uses "store" R1 Gon Yes
CRF-4 P3 Author fixed (b92e676) chatd.go:7937 Ordering constraint (storage disable before chain-mode selection) undocumented R1 Ryosuke P3, Leorio Nit, Chopper Note, Meruem Note Yes
CRF-5 P3 Author fixed (b92e676) chatprompt.go:66 HasReasoningReplayState boundary (empty ItemID) untested R1 Bisky Yes
CRF-6 P3 Author fixed (b92e676) chatd_internal_test.go:228 requireOpenAIStoreFalse duplicates requireOpenAIStoreDisabled; chattest available R1 Robin P3, Bisky Nit, Gon Nit Yes
CRF-7 Nit Author fixed (b92e676) responses_test.go:385 TestWithStorageDisabledAddsOptionsForOpenAIModel exercises Responses path, not isOpenAIModel fallback R1 Hisoka, Chopper, Knov Yes
CRF-8 P3 Author fixed (b92e676) responses_test.go:337 No test for WithStorageDisabled with non-OpenAI model (no-op path) R1 Bisky Yes
CRF-9 Nit Author fixed (b92e676) computer_use.go:109 providerOptionsForComputerUseTurn has no doc comment R1 Leorio Yes
CRF-10 Nit Author fixed (b92e676) (commit) Commit body is empty; reasoning not preserved in git log R1 Leorio Yes
CRF-11 P3 Author fixed (df1da85) responses.go:158 storeDisabled := false is a double negative; Go 1.26 allows new(false) R2 Gon P3, Ging-Go Nit Yes
CRF-12 Nit Author fixed (df1da85) computer_use.go:109 providerOptionsForComputerUseTurn doc comment restates function name R2 Gon Yes
CRF-13 Nit Author fixed (df1da85) chatd_internal_test.go:169 Test names use "Storage" while codebase vocabulary is "Store" R2 Gon Yes
CRF-14 Nit Dropped by orchestrator (assertion targets key "new" that no code path could add) responses_test.go:360 Tautological require.NotContains assertion R2 Bisky No

Contested and acknowledged

(none)

Round log

Round 1

Panel (13 reviewers). 0 P0-P1, 1 P2, 5 P3, 3 Nit, 0 dropped. Netero clean. Reviewed against 0d9718e..a914786.

Round 2

Panel (13 reviewers). 0 P0-P2, 1 P3, 2 Nit new. 1 dropped. All 10 R1 findings fixed. Netero clean. Reviewed against 0d9718e..b92e676.

Round 3

Panel (10 reviewers). No new findings. All 13 R1-R2 findings fixed. Netero clean. Reviewed against 0d9718e..df1da85.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean Netero pass. The design is well-reasoned: disabling storage before chain-mode selection is the right causal fix, and the reasoning preservation is the necessary companion. Test ratio is strong at 1:3.2. Six reviewers independently flagged the same silent no-op in WithStorageDisabled (CRF-1), which is the strongest signal from this round.

Severity count: 1 P2, 5 P3, 3 Nit. No blockers.

"A function named WithStorageDisabled that doesn't disable storage in all code paths is a dishonest contract." (Knov)

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chatopenai/responses.go
Comment thread coderd/x/chatd/chatopenai/responses.go Outdated
Comment thread coderd/x/chatd/chatopenai/responses.go Outdated
Comment thread coderd/x/chatd/chatd.go
Comment thread coderd/x/chatd/chatprompt/chatprompt.go
Comment thread coderd/x/chatd/chatd_internal_test.go Outdated
Comment thread coderd/x/chatd/chatopenai/responses_test.go Outdated
Comment thread coderd/x/chatd/chatopenai/responses_test.go Outdated
Comment thread coderd/x/chatd/computer_use.go
Comment thread coderd/x/chatd/chatd.go
OpenAI computer-use turns must not combine store=false with previous_response_id. Force OpenAI computer-use provider options to disable store and clear previous_response_id before chain-mode selection.

Preserve OpenAI reasoning replay metadata even when the visible reasoning text is empty so stateless manual replay keeps the required reasoning item before provider computer calls.
@ibetitsmike ibetitsmike force-pushed the mike/openai-computer-use-stateless branch from a914786 to b92e676 Compare May 22, 2026 16:04
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 10 R1 findings fixed. Every fix verified by the panel (13 reviewers, unanimous confirmation). The CRF-1 fix is particularly well done: removing the !ok guard so unknown types fall through to model-based option creation, rather than just logging a warning.

R2 found 1 P3 and 2 Nits (plus 1 dropped). All minor polish.

"Boring, correct code. Silence earned." (Hisoka)

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chatopenai/responses.go Outdated
Comment thread coderd/x/chatd/computer_use.go Outdated
Comment thread coderd/x/chatd/chatd_internal_test.go
Tighten OpenAI-only store option creation, rename tests to use Store terminology, and simplify the computer-use provider options comment.
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 13 prior findings (10 from R1, 3 from R2) fixed and verified. R3 panel (10 reviewers) found no new issues. Netero clean across all 3 rounds.

14 findings total across 3 rounds: 1 P2, 6 P3, 4 Nit, 2 dropped, 1 non-postable. All addressed. The code is clean, well-tested (1:4.2 test-to-code ratio), and correctly structured.

"I tried to build a case against this change and couldn't. The problem is correctly understood, the solution is proportional, and the fix is at the right causal level." (Pariston, R3)

🤖 This review was automatically generated with Coder Agents.

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