From 5de19e24316efb32551911fbbf9281cfc518e411 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Mon, 22 Jun 2026 18:29:58 -0700 Subject: [PATCH] fix(cockpit): stop c-input demo double-submitting the user message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- cockpit/chat/input/angular/src/app/input.component.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cockpit/chat/input/angular/src/app/input.component.ts b/cockpit/chat/input/angular/src/app/input.component.ts index 434938bda..58e212840 100644 --- a/cockpit/chat/input/angular/src/app/input.component.ts +++ b/cockpit/chat/input/angular/src/app/input.component.ts @@ -62,7 +62,10 @@ import { injectAgent } from '@threadplane/langgraph';
- + +
@@ -94,8 +97,4 @@ export class InputComponent { protected readonly streamStatus = computed(() => this.agent.status()); protected readonly isLoading = computed(() => this.agent.isLoading()); protected readonly messageContent = messageContent; - - submitMessage(content: string) { - this.agent.submit({ message: content }); - } }