Skip to content

fix: connection feedback and dropped session.list race - #6

Merged
MakeBlackSheepGreat merged 11 commits into
masterfrom
claude/vigilant-engelbart-8eb079
Jun 25, 2026
Merged

MakeBlackSheepGreat merged 11 commits into
masterfrom
claude/vigilant-engelbart-8eb079

Conversation

@MakeBlackSheepGreat

Copy link
Copy Markdown
Owner

修复"点击连接没反应"

根本原因

  1. 竞态条件(会话不加载): connectHost 中 runtimes[hostId] 在 client.connect() 之后才注册。如果 socket 快速打开,onOpen 触发的 listSessions() 会找不到 runtime,导致 session.list 请求被静默丢弃。现在改为先注册 runtime 再连接。
  2. 无连接反馈: host.connected 只在 onOpen 时翻转为 true。连接失败或挂起时 UI 没有任何提示,按钮看起来像坏了。新增每主机 ConnectionStatus(连接中/已连接/错误)和 12 秒超时。
  3. 静默失败: 失败现在显示为 ERROR 状态并提供"重试"按钮。

UI 改进

  • 状态芯片显示连接中(带 spinner)/连接失败
  • 连接按钮在连接时显示进度 spinner,失败后显示"重试"

其他

  • 停止跟踪 app-debug.apk 构建产物

MakeBlackSheepGreat and others added 11 commits June 26, 2026 00:49
Major Features:
- Add Markdown rendering support for chat messages with syntax highlighting
- Add WebSocket auto-reconnect with exponential backoff
- Add VPN support for network scanning (auto-detect all interfaces)
- Add GitHub Actions workflow for automatic APK building

UI Improvements:
- Optimize tool call display with smart expand/collapse
- Improve session card visual design with active status highlighting
- Add collapsible advanced options in dialogs
- Enhance message bubbles with better spacing and width
- Add tool count indicator and better layout

Bug Fixes:
- Fix chat auto-scroll interfering with history viewing
- Fix ChatViewModel thread safety issues with Mutex
- Fix FileViewModel event processing logic
- Fix ToolCallCard expand/collapse button logic
- Remove unused SessionViewModel

Performance:
- Optimize network scan concurrency (32 -> 16)
- Add real-time scan progress feedback
- Improve scan result reporting

Developer Experience:
- Add comprehensive documentation (FIXES_SUMMARY.md, OPTIMIZATIONS_SUMMARY.md, etc.)
- Add APK build guide
- Add detailed commit history

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add Prism4j dependency for syntax highlighting
- Fix SyntaxHighlightPlugin API usage (requires Prism4j instance)
- Add missing LogCollector import in BridgeViewModel
- Add GrammarLocatorDef for Prism4j initialization

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Keep Prism4j dependency for syntax highlighting
- Keep fixed MarkdownText implementation
- Keep updated libs.versions.toml with all dependencies

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GrammarLocatorDef doesn't exist in prism4j, use interface with null implementation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove Prism4j and syntax highlighting dependencies to avoid compatibility issues.
Use simple Markwon core for basic Markdown rendering (headings, lists, links, bold, italic, code blocks).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the dependency reference that was not properly cleaned up by sed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Root causes of 'connect does nothing':
- Race: runtimes[hostId] was registered AFTER client.connect(), so a fast
  onOpen->listSessions() ran before the runtime existed and the session.list
  request was silently dropped (sessions never loaded). Now the runtime is
  registered before connecting.
- No feedback: host.connected only flipped on onOpen, so a failing/hanging
  connection showed nothing. Added per-host ConnectionStatus
  (CONNECTING/CONNECTED/ERROR) with a 12s timeout.
- Silent failures: surfaced as ERROR state with a Retry button.

UI: status chip shows connecting spinner / failed label; connect button shows
a progress spinner while connecting and 'Retry' after failure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MakeBlackSheepGreat
MakeBlackSheepGreat merged commit 8803387 into master Jun 25, 2026
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