Skip to content

Commit 2e69985

Browse files
bloveclaude
andauthored
fix(cockpit): stop c-input demo double-submitting the user message (#727)
The chat-input primitive submits to its bound [agent] inside onSubmit() and emits (submitted) purely as a post-submit notification. The c-input demo also handled (submitted) by calling agent.submit() again, so every turn produced two user messages — surfacing as a phantom third chat-message in the list (the c-input e2e count assertion caught it). Drop the redundant (submitted) handler and the submitMessage method; the [agent] binding is the single submit path. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 971d645 commit 2e69985

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

cockpit/chat/input/angular/src/app/input.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ import { injectAgent } from '@threadplane/langgraph';
6262
</chat-message-list>
6363
</div>
6464
<div class="px-4 py-2" style="background: var(--ngaf-chat-bg);">
65-
<chat-input [agent]="agent" placeholder="Try typing here..." (submitted)="submitMessage($event)" />
65+
<!-- chat-input submits to [agent] itself; (submitted) is a
66+
notification only — re-submitting it here would double the
67+
user message. -->
68+
<chat-input [agent]="agent" placeholder="Try typing here..." />
6669
</div>
6770
</div>
6871
<div sidebar class="p-4 space-y-4" style="background: var(--ngaf-chat-bg); color: var(--ngaf-chat-text);">
@@ -94,8 +97,4 @@ export class InputComponent {
9497
protected readonly streamStatus = computed(() => this.agent.status());
9598
protected readonly isLoading = computed(() => this.agent.isLoading());
9699
protected readonly messageContent = messageContent;
97-
98-
submitMessage(content: string) {
99-
this.agent.submit({ message: content });
100-
}
101100
}

0 commit comments

Comments
 (0)