Repository navigation
chore(coderd/x/chatd): address generation review items - #26517
Conversation
45ef169 to
3af342c
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.9.0 | Round 1 | Last posted: Round 1, 10 findings (4 P3, 3 Nit, 3 Note), COMMENT. Review Finding inventoryFindings
Round logRound 1Panel. 4 P3, 3 Nit, 3 Note. Reviewed against b21e071..3af342c. Netero: no findings. Panel: Bisky, Chopper, Ging-Go, Gon, Hisoka, Komugi, Leorio, Mafu-san, Mafuuu, Meruem, Pariston, Robin, Ryosuke, Knov. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
Clean refactoring that delivers on all six review items from #26109. loadChatForTask eliminates a whole class of "forgot the fence check" bugs. The generationAttemptSession struct is a nice improvement over the 5-return-value function. recordGenerationFinishFailure fills a real gap in debug signal quality.
Severity counts: 4 P3, 3 Nit, 3 Note.
The main gap is that the nil-server-at-construction invariant is enforced at newTaskStarter but not at newChatWorker, while the archive path now dereferences w.server unconditionally. Six reviewers converged on this independently.
"The invariant 'server is always present' should be enforced at newChatWorker, not just at newTaskStarter." — Ryosuke
coderd/x/chatd/tasks_test.go:1074
Nit [CRF-7] taskRecordingPubsub still wraps an inner dbpubsub.Pubsub field and manually delegates Publish and SubscribeWithErr. This PR updated recordingPubsub in helpers_test.go to embed dbpubsub.Pubsub directly and drop the explicit delegation. Both types serve the same purpose in the same package. Embedding would match the convention the PR established.
(Robin Nit)
🤖
coderd/x/chatd/tasks.go:458
Note [CRF-10] StartAbandon is the only task entry point that does not use loadChatForTask. The divergence is justified: it needs the mismatch side-channel for cleanup routing and uses ownedByTask + verifyTaskFence with allowArchived: true and input.Status, which is structurally different from the standard pattern. If the fence check logic changes, this path must be updated separately.
(Chopper Nit, Ryosuke Note)
🤖
🤖 This review was automatically generated with Coder Agents.
3af342c to
2238996
Compare
mafredri
left a comment
There was a problem hiding this comment.
Writing critique: three findings on prose in this PR (two on description/commit, one inline on a code comment). Full enumeration of 20 units in the diff; 17 passed.
Commit headline (chore(coderd/x/chatd): code cleanup): "Code cleanup" is a label, not a description. The PR makes three named structural changes and two feature removals. The headline tells a git-blame reader nothing and is inconsistent with the PR title ("address generation review items"). Suggested replacement: match the PR title.
PR body summary: The second paragraph lists three structural changes but omits two operational removals: (1) InsertChatMessages no longer populates provider_response_id (and the ClearChatMessageProviderResponseIDsByChatID query is deleted); (2) the chain_broken label is removed from coderd_chatd_stream_retries_total. Both affect data consumers and monitoring. Suggested addition: "It also stops populating provider_response_id on new chat messages and removes the chain_broken label from the coderd_chatd_stream_retries_total metric."
🤖 This review was automatically generated with Coder Agents.
mafredri
left a comment
There was a problem hiding this comment.
Nice cleanup! One minor suggestion, dealers choice.
2238996 to
cba93af
Compare
Addresses the deferred
coderd/x/chatd/generation.goreview comments from PR #26109: required generation dependencies, scoped chat variables, generation state error handling, generation attempt return values, generation fence verification, and chatdebug outcome recording.This makes generation task dependencies explicit, packages generation attempt episode state into a struct, and centralizes generation task fence checks for generation transitions.
Generated by Coder Agents, closely reviewed by Hugo.