fix: resolve message submission and stuck processing bugs #199

Merged
naomi merged 4 commits from fix/bugs-again into main 2026-03-09 16:53:09 -07:00

4 Commits

Author SHA1 Message Date
hikari c597e8933a fix: add mid-session watchdog to kill stuck Claude Code processes
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m11s
CI / Lint & Test (pull_request) Successful in 16m59s
CI / Build Linux (pull_request) Successful in 20m59s
CI / Build Windows (cross-compile) (pull_request) Successful in 31m42s
Adds pending_since and watchdog_generation fields to WslBridge. When
send_message is called, pending_since is set to the current instant.
When a Result message arrives, it is cleared. A watchdog thread spawned
per session polls every 30 seconds and kills the process if pending_since
has been set for 5 minutes with no Result, triggering the existing
disconnect flow so the user gets an error message and can reconnect.
A generation counter ensures old watchdogs exit cleanly when start() is
called again for a new session.
2026-03-09 14:32:47 -07:00
hikari 0f3ad0dbee fix: properly track isProcessing state to block duplicate message submission
The isProcessing field existed on conversations but was never set to true
in production code, making all submission guards effectively no-ops.

- Add setProcessingForConversation to conversations store and claude.ts
- Set isProcessing=true after send_prompt succeeds in handleSubmit and handleQuickAction
- Set isProcessing=false when claude:state emits idle, success, or error
- Add tests for the new setProcessingForConversation logic
2026-03-09 14:20:33 -07:00
hikari 9ad88fda2d fix: include auto_granted_tools when reconnecting after permission approval
Closes #198 — default permissions were lost after the first permission
modal reconnect because PermissionModal only passed session-granted tools
to start_claude. Now merges auto_granted_tools from config, matching the
behaviour of every other start_claude call site.
2026-03-09 13:18:47 -07:00
hikari dd79ed5ab9 fix: block message submission whilst Claude is processing
Prevents the race condition where sending a message before the previous
turn's result message arrives caused both to be processed together,
making it appear the first message was ignored.
2026-03-09 13:05:26 -07:00