From c47346cc6237044ecb60ff22c4011d89744af581 Mon Sep 17 00:00:00 2001
From: Adam Malczewski <github@tradam.dev>
Date: Fri, 22 May 2026 20:54:19 +0900
Subject: feat: message queue/interrupt system, CORS fix, mobile fixes, chat
 splitting

- Add message queue allowing users to send messages while agent is running
- Queue messages are injected into tool results as [USER INTERRUPT]
- Retrieve tool interrupted via Promise.race when user message arrives
- Queued messages show with 'queued' badge and cancel button
- Consumed messages repositioned and chat splits at interrupt point
- New assistant message block created after interrupt for clean flow
- Add POST /chat/cancel endpoint for cancelling queued messages
- Fix CORS to allow any origin (Tailscale/LAN access)
- Fix crypto.randomUUID fallback for non-secure contexts (HTTP)
- Fix frontend API URL derivation from page hostname
- Auto-create DB tab if missing on processMessage (foreign key fix)
- Add error logging to processMessage catch block
- Fix working directory input sync on agent switch
- Fix agent mode button to re-apply agent settings
---
 packages/frontend/src/lib/components/ChatInput.svelte | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'packages/frontend/src/lib/components/ChatInput.svelte')

diff --git a/packages/frontend/src/lib/components/ChatInput.svelte b/packages/frontend/src/lib/components/ChatInput.svelte
index 21c85fe..dac7a3a 100644
--- a/packages/frontend/src/lib/components/ChatInput.svelte
+++ b/packages/frontend/src/lib/components/ChatInput.svelte
@@ -3,7 +3,6 @@ import { tabStore } from "../tabs.svelte.js";
 
 let inputEl: HTMLInputElement | undefined;
 let inputValue = $state("");
-const isDisabled = $derived((tabStore.activeTab?.agentStatus ?? "idle") === "running");
 
 $effect(() => {
 	inputEl?.focus();
@@ -18,7 +17,7 @@ function handleKeydown(e: KeyboardEvent) {
 
 function submit() {
 	const text = inputValue.trim();
-	if (!text || isDisabled) return;
+	if (!text) return;
 	inputValue = "";
 	tabStore.sendMessage(text);
 }
@@ -36,7 +35,7 @@ function submit() {
 	<button
 		type="button"
 		class="btn btn-primary"
-		disabled={isDisabled || !inputValue.trim()}
+		disabled={!inputValue.trim()}
 		onclick={submit}
 	>
 		Send
-- 
cgit v1.2.3

