Skip to content

feat: add MCP auto-reconnect + expand terminal rendering optimization#40

Merged
wenshao merged 2 commits intomainfrom
feat/mcp-reconnect-item
Apr 4, 2026
Merged

feat: add MCP auto-reconnect + expand terminal rendering optimization#40
wenshao merged 2 commits intomainfrom
feat/mcp-reconnect-item

Conversation

@wenshao
Copy link
Copy Markdown
Owner

@wenshao wenshao commented Apr 4, 2026

Summary

From PR QwenLM/qwen-code#2866 analysis + terminal flicker source code comparison:

New item: MCP Auto-Reconnect (P2, item 70)

  • Claude Code: MAX_ERRORS_BEFORE_RECONNECT = 3 + SSE auto-reconnect + session 404 refresh
  • Qwen Code: no MCP reconnect mechanism
  • Source: services/mcp/client.ts L1225-L1357

Expanded item: Terminal Rendering Optimization (P2, item 54)

Expanded from "Fullscreen Rendering" to full 8-layer anti-flicker:

Layer Claude Code Qwen Code
DEC 2026 synchronized output
Cell-level diff rendering
Double buffering
DECSTBM hardware scroll
Cache pooling (16K cap)
Damage tracking
Render throttle (~60fps)
Alt-screen fullscreen

Qwen Code only has message-splitting (useGeminiStream.ts L632).

🤖 Generated with Claude Code

wenshao and others added 2 commits April 4, 2026 15:19
New P2 item from QwenLM/qwen-code#2866 upstream backports analysis:
- Claude Code: MAX_ERRORS_BEFORE_RECONNECT = 3, SSE auto-reconnect,
  session expired (404) auto-refresh
- Qwen Code: no MCP reconnect mechanism
- Source: services/mcp/client.ts L1225-L1357

Also confirmed PR #2866 items already covered:
- Compress orphan funcCall → item 1 (compression) enhancement
- API-round grouping → item 1 grouping.ts (63 lines)
- Follow-up suggestions → item 3 (Speculation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Item 54 expanded from "Fullscreen Rendering" to full "终端渲染优化":
- DEC 2026 synchronized output (BSU/ESU atomic rendering)
- Cell-level differential rendering (ink/log-update.ts)
- Double buffering (frontFrame/backFrame swap)
- DECSTBM hardware scroll
- CharCache/StylePool/CharPool caching (16K cap)
- Damage tracking (dirty rectangle)
- Render throttling (~60fps via queueMicrotask)
- Alt-screen fullscreen mode

Qwen Code has only message-splitting (useGeminiStream.ts L632-634).
Claude Code has 8-layer anti-flicker in customized Ink engine (~7000 LOC).

Item 70: MCP Auto-Reconnect (from PR #2866 analysis)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wenshao wenshao merged commit 9afac06 into main Apr 4, 2026
wenshao added a commit that referenced this pull request Apr 5, 2026
Closed PR #76 — contained 6 files from previously closed PRs #69/#72
(repeated submission), plus 4 items of which 2 duplicated existing
(Plugin Marketplace = P3 #11, Tips = p2-tools #19).

Extracted 2 new items to p2-tools:
- #39 /clear multi-mode (clear screen / clear history / full reset)
- #40 /thinkback session recall (timeline key event review)

Total: 193 items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
wenshao added a commit that referenced this pull request Apr 8, 2026
P1 (1 item):
- #27 Error recovery classification routing — truncation→continuation,
  overflow→compaction, transport→backoff, with per-category budgets

P2 (2 items):
- #40 drain-before-call — drain background notification queue before
  each LLM call so model sees latest results
- #41 Post-compact identity re-injection — inject agent identity block
  when messages≤3 after compression (multi-agent scenario)

All 3 items have full detail sections in their respective files with
standard format (problem/solution/source/status/cost/comparison).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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