Read PR details and code files.
UnderstandChecked linked issues and documentation.
UnderstandReviewed and validated changes.
VerifyMerged PR and commented.
EditYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/765
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
Now let me read the full file to understand the context:
Let me read more of the file to understand the flow, particularly around renderInitialMessages and the initialization:
Let me check if there are any linked issues and verify the documentation files:
Now let me verify the complete fix by looking at the exact code changes:
Now let me check if the README or docs need modification:
PR: https://github.com/badlogic/pi-mono/pull/765
Changelog:
### Fixed in [Unreleased] if you decide to merge. Proposed entry:
- Fixed extension messages rendering twice on startup when `pi.sendMessage({ display: true })` is called during `session_start` ([#765](https://github.com/badlogic/pi-mono/pull/765) by [@dannote](https://github.com/dannote))Good:
renderInitialMessages() is responsible for the first render, subsequent rebuildChatFromMessages() calls handle updates afterwardBad:
pkg:coding-agent label on the PRUgly:
Questions or Assumptions:
renderInitialMessages() is always called after init() completes and before any user interaction. Looking at run(), this is correct: await this.init() → this.renderInitialMessages() in sequence.Change summary:
hasRenderedInitialMessages = false flag to InteractiveMode class (line 148)true at start of renderInitialMessages() (line 2010)sendMessage handler to skip rebuildChatFromMessages() when initial render hasn't occurred yet (line 622)session_start are rendered once by renderInitialMessages(), not twiceTests:
Documentation:
pi.sendMessage({ display: true }) during session_start should display messages once, which is what the fix achieves.ok, merge via gh cli, thank them with "Cheers"
Done. Merged to main and commented on the PR.
- Fixed extension messages rendering twice on startup when `pi.sendMessage({ display: true })` is called during `session_start` ([#765](https://github.com/badlogic/pi-mono/pull/765) by [@dannote](https://github.com/dannote))