Skip to content

fix: message queue on disconnect + no-watch mode + reconnect all tasks#66

Open
kovtcharov-amd wants to merge 8 commits into
extropolis:mainfrom
kovtcharov-amd:fix/message-queue-on-disconnect
Open

fix: message queue on disconnect + no-watch mode + reconnect all tasks#66
kovtcharov-amd wants to merge 8 commits into
extropolis:mainfrom
kovtcharov-amd:fix/message-queue-on-disconnect

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Summary

Three stability fixes addressing the most disruptive user-facing issues.

1. Queue messages during WebSocket disconnect

When WebSocket is not open (server restarting, reconnecting), messages typed in the input bar were silently dropped. Now queues the message and retries every 500ms until WebSocket reconnects, then sends automatically.

2. Switch start scripts to no-watch mode

Both start.ps1 and start.sh now use dev:no-watch (plain tsx, no file watching) instead of dev (tsx watch). This eliminates server restarts triggered by:

  • Claude Code tasks editing source files in backend/src/
  • Antivirus/Windows Defender scanning .ts files
  • NTFS indexer touching file metadata

The UI "Restart Server" button still works for manual restarts.

3. Auto-reconnect all recently-active tasks on restart

Previously only mid-turn tasks (shouldContinue=true) auto-reconnected, leaving all idle tasks disconnected. Now reconnects ALL tasks active within the last 2 hours. Mid-turn tasks get priority. Batched 2 at a time to prevent resource spike.

4. CLAUDE.md updates

  • No push to main without explicit approval
  • No attribution comments in PRs/code
  • Architecture overview and known gotchas

Test plan

  • Type "continue" while backend is restarting — message should queue and send after reconnect
  • Restart server — all recently-active tasks should auto-reconnect
  • Verify no random tsx watch restarts during normal usage

Ovtcharov and others added 8 commits May 11, 2026 15:40
showBrowseButton was hardcoded to false, preventing users from using
the native folder picker. Set to true so the Browse button appears
and opens the OS folder dialog via the existing WebSocket handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add drag-and-drop support on the workspace panel: drop a folder from
  the OS file explorer to add it as a workspace. In Electron, the full
  path is extracted directly. In the browser, opens the path input modal.
- Fix Browse button: use REST endpoint instead of blocking WebSocket
  execFileSync which froze the server. Only show Browse in Electron mode
  where the native dialog works reliably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: syncWorkspaceMcpConfigs wrote .mcp.json to the claudia
project root on every startup, triggering tsx watch to restart the
server in an infinite loop. Now skips syncing to Claudia's own
workspace directory.

Also:
- Fix Browse button: add -STA flag for Windows PowerShell folder dialog,
  remember last browsed path across sessions, kdialog fallback on Linux
- Re-enable Browse button in Add Workspace dialog
- Fix drag-and-drop: only activate for external OS drops (Files type),
  internal workspace reordering drags pass through unaffected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 512KB caps were too aggressive — users lost scrollback history
after rotation. Disk files now cap at 10MB (rotate keeping 5MB tail),
and clients receive up to 2MB of history for scrollback. Memory loading
on reconnect remains capped at 512KB to prevent OOM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a scrollbar appears/disappears during active output, the container
width changes by ~15px, flipping cols by 1-2. This caused Claude Code's
TUI to re-render at alternating widths, producing overlapping garbled
text.

Fix:
- Skip resize events where cols changed by <= 2 (scrollbar noise)
- Track last sent cols/rows to deduplicate
- Increase ResizeObserver debounce from 50ms to 150ms
- Use fitTerminal() (fit + refresh) to clear artifacts after resize

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
References extropolis#59

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d-turn

The previous policy only reconnected tasks with shouldContinue=true
(busy/starting at time of shutdown). This meant every tsx watch restart
disconnected all idle tasks (34 tasks showing 'disconnected'), requiring
manual clicks to reconnect each one.

Now reconnects ALL tasks that were active within the last 2 hours and
have a sessionId. Mid-turn tasks still get priority in reconnect order.
Batching (2 at a time with delays) prevents resource exhaustion.
1. TaskInputBar: queue messages when WebSocket is not open instead of
   silently dropping them. Retries every 500ms until WebSocket reconnects.
   Previously typing 'continue' while disconnected did nothing — the
   message stayed in the input but was never sent.

2. Start scripts: switch from 'dev' (tsx watch) to 'dev:no-watch' to
   prevent spurious server restarts from file changes (Claude Code tasks
   editing source files, antivirus, Windows indexer). The UI restart
   button still works for manual restarts.

3. CLAUDE.md: updated with current architecture, no-push-to-main rule,
   no attribution comments rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant