Skip to content

chore(coderd/x/chatd): clean up the message part buffer comments and implementation - #26508

Merged
hugodutka merged 1 commit into
mainfrom
fix-chatd-messagepartbuffer-review
Jun 18, 2026
Merged

hugodutka merged 1 commit into
mainfrom
fix-chatd-messagepartbuffer-review

Conversation

@hugodutka

@hugodutka hugodutka commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator

Address deferred review feedback for messagepartbuffer by documenting its episode lifecycle, extracting the repeated episode lookup and finalization helpers, and documenting subscriber channel buffering decisions.

Addresses these PR #26109 comments:

@hugodutka
hugodutka force-pushed the fix-chatd-messagepartbuffer-review branch from 80de26c to 042b512 Compare June 18, 2026 11:21
@hugodutka hugodutka changed the title fix: address message part buffer review items chore(coderd/x/chatd): clean up the message part buffer comments and implementation Jun 18, 2026
@hugodutka
hugodutka marked this pull request as ready for review June 18, 2026 11:24
@hugodutka
hugodutka requested a review from mafredri June 18, 2026 11:24

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a focused cleanup of a very new package, and the documentation it adds is mostly the right kind: the out/notifyCh/stopCh channel comments, the AddPart sequence-number rationale, the GetParts detached-slice note, and the CloseEpisode create-on-close note all match the code and answer a real "why". The markCreated/close/notifySubscribers/getEpisodeLocked extractions are behavior-preserving (traced by Pariston and Mafu-san, and Komugi confirmed the package passes go test -race -count=5), and Bisky verified the existing suite already covers every branch of the new helpers.

The panel reviewed the whole package, not just the diff, per the review focus. Findings: 3 P2, 1 P3, 4 Nit, 3 Note. None block on correctness today; all three P2s are documentation-vs-code mismatches in a PR whose stated deliverable is accurate documentation, so they matter more here than the severity label suggests. Since this is the documentation pass, it is also the moment to reconcile the dead SubscriberChannelSize option (CRF-1): the new "out is unbuffered" comment makes that option's continued existence a contradiction rather than a latent knob.

On the #26109 feedback this PR set out to address: the getEpisode helper (r3379915812) and the doc expansion (r3379988015) landed; markCreated (r3380010948) landed but the extraction is half-done (CRF-5, AddPart still inlines the notify loop); the channel-buffering documentation (r3380029684) landed and is accurate for notifyCh/stopCh/done, but it also exposed the dead SubscriberChannelSize option it does not reconcile.

Process note: the new package doc and two method comments describe the removed createdCh early-subscriber wakeup design rather than the current notify-driven path. A documentation pass on a new package is the right time to re-check every comment that mentions early-subscriber timing against the current code, not just the three flagged here.

From Hisoka, who pulled the thread the PR set out to document: "A worthy package. It hides one real face behind a documented one, and the documentation pass is what exposed it."

🤖 This review was automatically generated with Coder Agents.

@hugodutka
hugodutka force-pushed the fix-chatd-messagepartbuffer-review branch from 042b512 to 903f4be Compare June 18, 2026 12:35
@hugodutka
hugodutka merged commit ba86027 into main Jun 18, 2026
29 checks passed
@hugodutka
hugodutka deleted the fix-chatd-messagepartbuffer-review branch June 18, 2026 20:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 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