generated from nhcarrigan/template
fix: resolve message submission and stuck processing bugs (#199)
## Summary - **Fix `isProcessing` tracking**: The `isProcessing` store field was initialised as `false` and never set to `true` in production, making all submission guards no-ops. Now `setProcessing(true)` is called after `send_prompt` succeeds in both `handleSubmit` and `handleQuickAction`, and `setProcessingForConversation(id, false)` is called when the backend emits an idle/success/error state. - **Fix auto-granted tools dropped on permission reconnect** (closes #198): `PermissionModal.svelte` was passing only session-granted tools when reconnecting after a permission approval, silently dropping `config.auto_granted_tools`. Fixed to merge both sets, matching the behaviour of every other `start_claude` call site. - **Add mid-session watchdog**: A watchdog thread now kills the Claude Code process if a user message is sent but no `Result` arrives within 5 minutes. This triggers the existing disconnect/error flow so the user is notified and can reconnect. A generation counter ensures watchdogs from previous sessions exit cleanly when a new session starts. ## Test plan - [ ] Send a message and verify the textarea is disabled and the stop button is visible while Claude is processing - [ ] Verify the textarea re-enables after Claude finishes responding - [ ] Enable a tool in default permissions (e.g. Read), start a session, trigger a permission approval for another tool, approve it — verify the previously auto-granted tool is no longer re-prompted - [ ] Verify all existing tests pass (`./check-all.sh`) ✨ This PR was created with help from Hikari~ 🌸 Reviewed-on: #199 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #199.
This commit is contained in:
+10
-1
@@ -236,9 +236,10 @@ export async function initializeTauriListeners() {
|
||||
);
|
||||
}
|
||||
|
||||
// Update character state for this conversation
|
||||
// Update character state and processing state for this conversation
|
||||
if (targetConversationId) {
|
||||
claudeStore.setCharacterStateForConversation(targetConversationId, "idle");
|
||||
claudeStore.setProcessingForConversation(targetConversationId, false);
|
||||
}
|
||||
} else if (status === "error") {
|
||||
const targetConversationId = conversation_id || get(claudeStore.activeConversationId);
|
||||
@@ -333,13 +334,21 @@ export async function initializeTauriListeners() {
|
||||
}
|
||||
|
||||
// Always update the conversation's state
|
||||
const isTerminalState =
|
||||
mappedState === "idle" || mappedState === "success" || mappedState === "error";
|
||||
if (conversation_id) {
|
||||
claudeStore.setCharacterStateForConversation(conversation_id, mappedState);
|
||||
if (isTerminalState) {
|
||||
claudeStore.setProcessingForConversation(conversation_id, false);
|
||||
}
|
||||
} else {
|
||||
// Fallback to active conversation if no conversation_id
|
||||
const activeConversationId = get(claudeStore.activeConversationId);
|
||||
if (activeConversationId) {
|
||||
claudeStore.setCharacterStateForConversation(activeConversationId, mappedState);
|
||||
if (isTerminalState) {
|
||||
claudeStore.setProcessingForConversation(activeConversationId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user