mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +00:00
fix(coding-agent): prevent duplicate rendering of extension messages on startup, closes #765
This commit is contained in:
commit
0b625b66b7
2 changed files with 9 additions and 1 deletions
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
- Added bash-style argument slicing for prompt templates ([#770](https://github.com/badlogic/pi-mono/pull/770) by [@airtonix](https://github.com/airtonix))
|
||||
|
||||
### Fixed
|
||||
|
||||
- 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))
|
||||
|
||||
## [0.47.0] - 2026-01-16
|
||||
|
||||
### Breaking Changes
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ export class InteractiveMode {
|
|||
private keybindings: KeybindingsManager;
|
||||
private version: string;
|
||||
private isInitialized = false;
|
||||
private hasRenderedInitialMessages = false;
|
||||
private onInputCallback?: (text: string) => void;
|
||||
private loadingAnimation: Loader | undefined = undefined;
|
||||
private readonly defaultWorkingMessage = "Working...";
|
||||
|
|
@ -619,7 +620,9 @@ export class InteractiveMode {
|
|||
this.session
|
||||
.sendCustomMessage(message, options)
|
||||
.then(() => {
|
||||
if (!wasStreaming && message.display) {
|
||||
// Don't rebuild if initial render hasn't happened yet
|
||||
// (renderInitialMessages will handle it)
|
||||
if (!wasStreaming && message.display && this.hasRenderedInitialMessages) {
|
||||
this.rebuildChatFromMessages();
|
||||
}
|
||||
})
|
||||
|
|
@ -2007,6 +2010,7 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
renderInitialMessages(): void {
|
||||
this.hasRenderedInitialMessages = true;
|
||||
// Get aligned messages and entries from session context
|
||||
const context = this.sessionManager.buildSessionContext();
|
||||
this.renderSessionContext(context, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue