Skip to content

feat(channels): add extensible Channels platform with plugin system and Telegram/WeChat/DingTalk channels#2628

Merged
tanzhenxin merged 53 commits intomainfrom
feat/channels-telegram
Apr 1, 2026
Merged

feat(channels): add extensible Channels platform with plugin system and Telegram/WeChat/DingTalk channels#2628
tanzhenxin merged 53 commits intomainfrom
feat/channels-telegram

Conversation

@tanzhenxin
Copy link
Copy Markdown
Collaborator

@tanzhenxin tanzhenxin commented Mar 24, 2026

TLDR

This PR introduces a new Channels platform that enables Qwen Code to interact with users through messaging platforms. It includes a plugin system for building custom channel adapters, plus built-in support for Telegram, WeChat, and DingTalk.

Key highlights:

  • Plugin System: Build custom channel adapters as extensions using @qwen-code/channel-base
  • Built-in Adapters: Telegram, WeChat, and DingTalk ready to use
  • Access Control: Allowlist, pairing flow, and group policies
  • Session Management: User-scoped, thread-scoped, or single sessions

Screenshots / Video Demo

Features

Core Platform

  • 3 built-in channels — Telegram, WeChat, DingTalk
  • Plugin systemChannelBase SDK with connect/sendMessage/disconnect, extension manifest, compiled JS + .d.ts

Access Control

  • Sender policiesallowlist, pairing (8-char codes, CLI approval), open policies
  • Group chat policiesopen/disabled/allowlist group policy, requireMention per group, reply-as-mention

Session Management

  • Session routinguser, thread, single scopes with per-channel cwd, model, instructions
  • Dispatch modessteer (default: cancel + re-prompt), collect (buffer + coalesce), followup (sequential queue). Per-channel and per-group config.

Messaging Features

  • Working indicators — centralized onPromptStart/onPromptEnd hooks. Telegram: typing bar. WeChat: typing API. DingTalk: 👀 emoji reaction.
  • Block streaming — progressive multi-message delivery with paragraph-aware chunking
  • Streaming hooksonResponseChunk/onResponseComplete for plugins to implement progressive display
  • Media support — images (vision input), files/audio/video (saved to temp, path in prompt), Attachment interface on Envelope

Commands & Service

  • Slash commands/help, /clear (/reset, /new), /status, custom via registerCommand()
  • Service managementqwen channel start/stop/status, PID tracking, crash recovery (auto-restart, session persistence)
  • Token security$ENV_VAR syntax in config

Supported Platforms

Telegram

Full-featured Telegram bot support:

  • Group chats with @mention detection
  • Images and file attachments
  • Slash commands (/clear, /help, /status)
  • Markdown to HTML formatting
  • Typing indicators

WeChat

DM support via iLink Bot API:

  • QR code authentication
  • Images and media support
  • AES media decryption

DingTalk

Enterprise messaging via Stream Mode WebSocket:

  • Group chats with @mention detection
  • Images and file attachments
  • Rich text and markdown support

Custom Channels (Plugin System)

Build your own channel adapter for any messaging platform. The @qwen-code/channel-base package provides the core infrastructure, and @qwen-code/channel-plugin-example offers a working reference implementation to get started quickly.

See the Channel Plugin Developer Guide for details.

Architecture

Platform Adapter (your plugin)  →  builds Envelope  →  ChannelBase.handleInbound()
ChannelBase  →  SenderGate → GroupGate → Commands → SessionRouter → AcpBridge.prompt()
ChannelBase  →  calls your sendMessage() with agent response

Core Components:

  • AcpBridge: Spawns qwen-code --acp subprocess, manages ACP sessions
  • ChannelBase: Abstract base class with access control, session routing, slash commands
  • SessionRouter: Maps senders to sessions (user/thread/single scope)
  • SenderGate: DM access control (allowlist/pairing/open)
  • GroupGate: Group chat policy and @mention gating
  • PairingStore: Pairing code generation and approval flow

Configuration

Channels are configured in ~/.qwen/settings.json:

{
  "channels": {
    "my-telegram": {
      "type": "telegram",
      "token": "$TELEGRAM_BOT_TOKEN",
      "senderPolicy": "allowlist",
      "allowedUsers": ["123456789"],
      "sessionScope": "user",
      "cwd": "/path/to/project",
      "instructions": "You are a helpful coding assistant.",
      "groupPolicy": "disabled"
    }
  }
}

See the Channels documentation for full configuration options.

CLI Commands

qwen channel start <name>           # Start a channel
qwen channel pairing list <name>     # List pending pairing requests
qwen channel pairing approve <name> <CODE>  # Approve pairing
qwen channel configure-weixin        # WeChat QR login

Future Work

Safety & Group Chat

  • Per-group tool restrictionstools/toolsBySender deny/allow lists per group
  • Group context history — ring buffer of recent skipped messages, prepended on @mention
  • Regex mention patterns — fallback mentionPatterns for unreliable @mention metadata
  • Per-group instructionsinstructions field on GroupConfig for per-group personas
  • /activation command — runtime toggle for requireMention, persisted to disk

Operational Tooling

  • qwen channel doctor — config validation, env vars, bot tokens, network checks
  • qwen channel status --probe — real connectivity checks per channel

Platform Expansion

  • Discord — Bot API + Gateway, servers/channels/DMs/threads
  • Slack — Bolt SDK, Socket Mode, workspaces/channels/DMs/threads

Multi-Agent

  • Multi-agent routing — multiple agents with bindings per channel/group/user
  • Broadcast groups — multiple agents respond to the same message

Plugin Ecosystem

  • Community plugin templatecreate-qwen-channel scaffolding tool
  • Plugin registry/discoveryqwen extensions search, version compatibility

Reviewer Test Plan

Telegram

  1. Create a bot via @BotFather, get token
  2. Find your user ID via @userinfobot
  3. Add channel config to ~/.qwen/settings.json
  4. Run npm run build && qwen channel start my-telegram
  5. Send messages, images, files to your bot

WeChat

  1. Run qwen channel configure-weixin, scan QR code
  2. Add channel config to ~/.qwen/settings.json
  3. Run qwen channel start my-weixin

DingTalk

  1. Create bot app in DingTalk Developer Portal with Stream Mode
  2. Add channel config to ~/.qwen/settings.json
  3. Run npm run build && qwen channel start my-dingtalk

Documentation

Packages

Package Description
@qwen-code/channel-base Core infrastructure for building channel adapters
@qwen-code/channel-plugin-example Reference plugin implementation
@qwen-code/channel-telegram Telegram adapter
@qwen-code/channel-weixin WeChat adapter
@qwen-code/channel-dingtalk DingTalk adapter

@github-actions
Copy link
Copy Markdown
Contributor

📋 Review Summary

This PR introduces a well-architected Channels feature that enables Qwen Code to interact with users through messaging platforms, starting with Telegram support. The implementation leverages the Agent Client Protocol (ACP) to bridge messaging channels with the Qwen Code CLI. Overall, the code demonstrates solid architectural decisions with clean separation of concerns, though there are several security, reliability, and maintainability issues that should be addressed before merging.

🔍 General Feedback

  • Strong modular architecture: The separation into AcpBridge, ChannelBase, SessionRouter, and SenderGate components shows good design patterns
  • Extensible design: The abstract ChannelBase class makes it straightforward to add new channel types (Discord, webhook, etc.)
  • Good use of TypeScript: Proper typing throughout with interfaces for configuration and data structures
  • Session management: The in-memory session routing is clean but lacks persistence
  • Missing test coverage: No test files are included for this critical new feature
  • Console logging: Heavy use of console.log/console.error instead of a proper logging system

🎯 Specific Feedback

🔴 Critical

  • File: packages/channels/base/src/AcpBridge.ts:117-127 - Security: Auto-approving all tool permissions. The requestPermission handler auto-approves all tool calls without user consent. This is extremely dangerous as it allows the agent to execute any tool (file writes, shell commands, etc.) without user approval when accessed via Telegram.

    // Phase 1: auto-approve everything so plain text works
    const optionId =
      options.find((o) => o.optionId === 'proceed_once')?.optionId ||
      options[0]?.optionId ||
      'proceed_once';
    return { outcome: { outcome: 'selected', optionId } };

    Recommendation: Implement proper permission handling that respects the approvalMode config. At minimum, dangerous operations (file writes, shell execution) should require explicit approval. The PR description mentions approvalMode in the config but it's never used.

  • File: packages/channels/base/src/SenderGate.ts:18-20 - Security: Unimplemented pairing policy. The pairing policy is documented but falls through to allowlist behavior with a comment "will be implemented later". This could mislead users into thinking they have pairing protection when they don't.
    Recommendation: Either implement the pairing policy properly or remove it from the type definition until ready.

  • File: packages/cli/src/commands/channel/start.ts:74-79 - Security: Token validation happens after type check. The token is resolved from environment variables after validating the channel type, but there's no validation that the token is non-empty after resolution.
    Recommendation: Add validation after resolveEnvVars to ensure the token is not empty.

🟡 High

  • File: packages/channels/base/src/AcpBridge.ts:67-70 - Reliability: Hardcoded 1-second startup delay. Using setTimeout(resolve, 1000) to wait for the ACP process is fragile and may fail on slower systems or succeed incorrectly on faster ones.
    Recommendation: Implement a proper handshake or readiness check instead of a fixed timeout. Consider using a health check pattern.

  • File: packages/channels/base/src/SessionRouter.ts:5-6 - Reliability: Memory leak potential. The toSession and toTarget maps grow indefinitely with no cleanup mechanism. Sessions are never expired or removed except via the /reset command.
    Recommendation: Implement session expiration/tTL and periodic cleanup. Add a maximum session count with LRU eviction.

  • File: packages/channels/telegram/src/TelegramAdapter.ts:104-112 - Reliability: Silent failure on message send. The sendMessage method catches errors but silently falls back to plain text, then returns without confirming success. If the fallback also fails, the user never receives the response.
    Recommendation: Log the error properly and consider retry logic. At minimum, notify the user if the message couldn't be delivered.

  • File: packages/channels/base/src/ChannelBase.ts:40-44 - Functionality: Instructions only applied once per session. The instructedSessions Set prevents instructions from being re-applied, but this is tracked in-memory only. If the channel restarts, instructions would be re-applied unexpectedly.
    Recommendation: Document this behavior clearly or persist the state if cross-restart consistency is needed.

  • File: packages/cli/src/commands/channel/start.ts:115-122 - Reliability: SIGTERM handler doesn't complete gracefully. The SIGTERM handler calls disconnect/stop but doesn't wait for them to complete before resolving.
    Recommendation: Make the handlers async and await the cleanup operations.

🟢 Medium

  • File: packages/channels/base/src/AcpBridge.ts:1-208 - Maintainability: Missing JSDoc documentation. The public methods lack documentation explaining their purpose, parameters, and return values.
    Recommendation: Add JSDoc comments to all public APIs, especially for complex methods like prompt() and start().

  • File: packages/channels/telegram/src/TelegramAdapter.ts:13 - Maintainability: Magic constant for local commands. The LOCAL_COMMANDS set is defined but the relationship between this and the individually registered commands (start, help, reset) isn't clear.
    Recommendation: Extract the command list to a constant and use it consistently for both registration and filtering.

  • File: packages/channels/base/src/types.ts:3 - Maintainability: Unused channel types. The ChannelType includes 'discord' | 'webhook' which aren't implemented, potentially confusing developers.
    Recommendation: Only include implemented types, or add a comment indicating these are planned future implementations.

  • File: packages/cli/src/commands/channel/start.ts:9-18 - Code quality: Limited environment variable resolution. The resolveEnvVars function only handles simple $VAR syntax, not ${VAR} or $VAR/suffix patterns.
    Recommendation: Use a more robust solution like dotenv-expand or implement proper variable expansion with regex.

  • File: packages/channels/base/src/AcpBridge.ts:83-94 - Code quality: Verbose type casting. The repeated as unknown as Record<string, unknown> patterns suggest the ACP SDK types may not match the actual protocol.
    Recommendation: Consider creating proper type guards or interface definitions that match the actual protocol structure.

🔵 Low

  • File: packages/channels/telegram/src/TelegramAdapter.ts:24-28 - UX: Hardcoded welcome message. The /start command message is hardcoded and not customizable via config.
    Suggestion: Allow customization of the welcome message through channel configuration.

  • File: packages/channels/base/src/SessionRouter.ts:24-30 - Naming: Inconsistent scope naming. The SessionScope type uses 'user' | 'thread' | 'single' but the routing key function uses __single__ as a magic string.
    Suggestion: Extract __single__ to a constant or use a more descriptive name.

  • File: packages/cli/src/commands/channel/start.ts:45-47 - Type safety: Unsafe type casting. The channels config is cast as Record<string, unknown> which bypasses type safety.
    Suggestion: Create a proper interface for channel configuration in the settings schema.

  • File: packages/channels/base/package.json and packages/channels/telegram/package.json - Missing metadata. The package.json files are missing author, license, repository, and keywords fields.
    Suggestion: Add standard package metadata for consistency with other packages in the monorepo.

  • File: packages/channels/telegram/src/TelegramAdapter.ts:95-97 - Error handling: Generic error message. Users receive "Sorry, something went wrong" without any error code or debugging information.
    Suggestion: Include a reference code or suggest retrying, while logging the full error server-side.

✅ Highlights

  • Excellent architecture: The layered approach with AcpBridgeChannelBaseTelegramChannel demonstrates solid software design principles
  • Clean session routing: The SessionRouter elegantly handles different scoping strategies (user, thread, single)
  • Good use of existing protocols: Leveraging ACP instead of reinventing agent communication is a smart choice
  • Sender policy implementation: The SenderGate provides flexible access control with allowlist/blocklist/open policies
  • Telegram formatting: Using telegram-markdown-formatter for proper markdown-to-HTML conversion shows attention to platform-specific details
  • Slash command support: The implementation properly handles Telegram slash commands while forwarding others to the agent
  • Comprehensive PR description: The PR body includes architecture documentation, configuration examples, and a testing matrix

Summary

This is a well-designed feature that adds significant value to Qwen Code. However, the critical security issue with auto-approving tool permissions must be addressed before merging. Additionally, I strongly recommend adding test coverage for the core components (AcpBridge, SessionRouter, SenderGate) and implementing proper session cleanup to prevent memory leaks in long-running instances.

Implements the channels infrastructure for connecting external messaging
platforms to Qwen Code via ACP. Phase 1 supports plain text round-trip:
Telegram user sends message -> AcpBridge -> qwen-code --acp -> response
back to Telegram.

New packages:
- @qwen-code/channel-base: AcpBridge, SessionRouter, SenderGate, ChannelBase
- @qwen-code/channel-telegram: TelegramAdapter using telegraf

CLI: `qwen channel start <name>` reads from settings.json channels config,
spawns ACP agent, connects to Telegram via polling.
Use telegram-markdown-formatter to convert agent markdown responses
to Telegram HTML (bold, italic, code blocks, links). Falls back to
plain text if HTML parsing fails. Also uses the package's built-in
HTML-aware message splitting for long responses.
- Local commands: /start (welcome), /help (dynamic list), /reset (clear session)
- Non-local slash commands forwarded to ACP agent as prompts
- AcpBridge captures available_commands_update to populate /help dynamically
- SessionRouter gains hasSession/removeSession for /reset support
… support

- Validate required fields (type, token) with clear error messages
- Prepend channel instructions to first prompt of each session
- SessionRouter respects sessionScope (user/thread/single) for routing keys
@tanzhenxin tanzhenxin force-pushed the feat/channels-telegram branch from 37a0c97 to 615ccd0 Compare March 24, 2026 06:33
tanzhenxin and others added 4 commits March 24, 2026 06:45
- Use bracket notation for index signature properties
- Add tsconfig.json for channels/base and channels/telegram packages

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…nt handling

- Add ToolCallEvent interface and emit typed events from AcpBridge
- Refactor sessionUpdate handling into dedicated method
- Simplify TelegramAdapter to use simple 'Working...' message
- Change to non-awaited handler to avoid Telegraf 90s timeout
- Remove console.log statements for cleaner code

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add overview page explaining channels architecture and configuration
- Add Telegram channel setup guide with bot creation steps
- Add navigation entries for channels section

This documents the new Channels feature that allows users to interact
with Qwen Code agents from messaging platforms like Telegram.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add PairingStore for managing pending requests and approved users
- Update SenderGate to support pairing policy with code generation
- Add CLI commands: `qwen channel pairing list/approve`
- Document pairing flow with rules and usage examples

This allows unknown senders to request access via a pairing code
that the bot operator approves through the CLI.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
tanzhenxin and others added 3 commits March 25, 2026 02:04
- Add GroupGate class for group access control with three policies:
  disabled (default), allowlist, and open
- Implement mention gating: bot only responds when @mentioned or replied to
  in groups (configurable per-group)
- Extend Envelope type with isGroup, isMentioned, isReplyToBot fields
- Update TelegramAdapter to detect group context and mentions
- Add comprehensive documentation for group chat setup and troubleshooting

This enables using Qwen Code bots in Telegram groups with fine-grained
access control and mention-based activation to prevent noise.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add WeixinAdapter with accounts, api, login, monitor, send modules
- Add channel configure command for interactive setup
- Update TelegramAdapter for consistency

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add model configuration option for channel-specific model selection
- Support base64-encoded images in prompts via AcpBridge
- Add media utilities for WeChat/Weixin channel
- Update settings schema for model configuration

Enables channels to process images and use custom models.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Code Coverage Summary

Package Lines Statements Functions Branches
CLI 55.3% 55.3% 66.44% 79.68%
Core 74.74% 74.74% 77.28% 81.32%
CLI Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |    55.3 |    79.68 |   66.44 |    55.3 |                   
 src               |   75.98 |    67.64 |   72.22 |   75.98 |                   
  gemini.tsx       |   60.64 |    63.15 |      75 |   60.64 | ...02,510-513,521 
  ...ractiveCli.ts |   84.94 |    66.03 |      40 |   84.94 | ...32,342-343,362 
  ...liCommands.ts |   83.77 |    69.76 |     100 |   83.77 | ...12,247,249,377 
  ...ActiveAuth.ts |   94.11 |    82.35 |     100 |   94.11 | 27-30             
 ...cp-integration |    5.61 |    33.33 |    12.5 |    5.61 |                   
  acpAgent.ts      |    2.86 |        0 |       0 |    2.86 | 71-125,128-625    
  authMethods.ts   |    11.9 |      100 |       0 |    11.9 | 11-32,35-39,42-51 
  errorCodes.ts    |       0 |        0 |       0 |       0 | 1-22              
  ...DirContext.ts |     100 |      100 |     100 |     100 |                   
 ...ration/service |   68.65 |    83.33 |   66.66 |   68.65 |                   
  filesystem.ts    |   68.65 |    83.33 |   66.66 |   68.65 | ...32,77-94,97-98 
 ...ration/session |   69.39 |    60.53 |      75 |   69.39 |                   
  ...ryReplayer.ts |      76 |    79.41 |      90 |      76 | ...19-220,228-229 
  Session.ts       |    63.4 |    47.65 |    61.9 |    63.4 | ...1204,1210-1213 
  ...entTracker.ts |   90.85 |    84.84 |      90 |   90.85 | ...35,199,251-260 
  index.ts         |       0 |        0 |       0 |       0 | 1-40              
  ...ssionUtils.ts |   74.59 |    73.07 |     100 |   74.59 | ...73-189,204-206 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...ssion/emitters |   96.24 |    90.26 |      92 |   96.24 |                   
  BaseEmitter.ts   |    82.6 |       75 |      80 |    82.6 | 23-24,50-51       
  ...ageEmitter.ts |     100 |    83.33 |     100 |     100 | 84-86             
  PlanEmitter.ts   |     100 |      100 |     100 |     100 |                   
  ...allEmitter.ts |   97.96 |     91.8 |     100 |   97.96 | 230-231,320,328   
  index.ts         |       0 |        0 |       0 |       0 | 1-10              
 src/commands      |   65.77 |      100 |    12.5 |   65.77 |                   
  auth.ts          |   46.55 |      100 |       0 |   46.55 | ...58,67-72,75-76 
  channel.ts       |   56.66 |      100 |       0 |   56.66 | 15-19,27-34       
  extensions.tsx   |   96.55 |      100 |      50 |   96.55 | 37                
  hooks.tsx        |   66.66 |      100 |       0 |   66.66 | 20-24             
  mcp.ts           |   94.11 |      100 |      50 |   94.11 | 26                
 src/commands/auth |    42.6 |    95.83 |      60 |    42.6 |                   
  handler.ts       |   27.37 |    94.44 |   14.28 |   27.37 | 55-394            
  ...veSelector.ts |     100 |    96.66 |     100 |     100 | 58                
 ...mmands/channel |   28.87 |    93.87 |   28.12 |   28.87 |                   
  ...l-registry.ts |   47.61 |      100 |       0 |   47.61 | 14-20,23-24,27-28 
  config-utils.ts  |   91.78 |      100 |   66.66 |   91.78 | 20-25             
  configure.ts     |    14.7 |      100 |       0 |    14.7 | 18-21,23-84       
  pairing.ts       |   26.31 |      100 |       0 |   26.31 | ...30,40-50,52-65 
  pidfile.ts       |   96.34 |    86.95 |     100 |   96.34 | 49,59,91          
  start.ts         |    5.07 |      100 |       0 |    5.07 | ...22-425,427-432 
  status.ts        |   17.54 |      100 |       0 |   17.54 | 15-26,32-77       
  stop.ts          |      20 |      100 |       0 |      20 | 14-48             
 ...nds/extensions |   85.34 |    91.27 |   81.81 |   85.34 |                   
  consent.ts       |   71.65 |    89.28 |   42.85 |   71.65 | ...85-141,156-162 
  disable.ts       |     100 |      100 |     100 |     100 |                   
  enable.ts        |     100 |      100 |     100 |     100 |                   
  install.ts       |   81.73 |    83.33 |   66.66 |   81.73 | ...17-120,123-130 
  link.ts          |     100 |      100 |     100 |     100 |                   
  list.ts          |     100 |      100 |     100 |     100 |                   
  new.ts           |     100 |      100 |     100 |     100 |                   
  settings.ts      |   99.15 |      100 |   83.33 |   99.15 | 151               
  uninstall.ts     |    37.5 |      100 |   33.33 |    37.5 | 23-45,57-64,67-70 
  update.ts        |   96.32 |      100 |     100 |   96.32 | 101-105           
  utils.ts         |   60.24 |    28.57 |     100 |   60.24 | ...81,83-87,89-93 
 ...les/mcp-server |       0 |        0 |       0 |       0 |                   
  example.ts       |       0 |        0 |       0 |       0 | 1-60              
 src/commands/mcp  |   97.36 |    87.87 |    90.9 |   97.36 |                   
  add.ts           |     100 |    96.66 |     100 |     100 | 213               
  list.ts          |   91.22 |    80.76 |      80 |   91.22 | ...19-121,146-147 
  remove.ts        |     100 |       80 |     100 |     100 | 21-25             
 src/config        |   90.69 |     80.5 |   84.12 |   90.69 |                   
  auth.ts          |   86.92 |    78.84 |     100 |   86.92 | ...98-199,215-216 
  config.ts        |   87.28 |    82.12 |   72.22 |   87.28 | ...1151,1173-1174 
  keyBindings.ts   |   95.87 |       50 |     100 |   95.87 | 159-162           
  ...idersScope.ts |      92 |       90 |     100 |      92 | 11-12             
  sandboxConfig.ts |   54.16 |    23.07 |   66.66 |   54.16 | ...44,54-68,73-89 
  settings.ts      |   80.69 |    82.05 |   81.81 |   80.69 | ...98-699,775-792 
  ...ingsSchema.ts |     100 |      100 |     100 |     100 |                   
  ...tedFolders.ts |   96.29 |       94 |     100 |   96.29 | ...88-190,205-206 
  webSearch.ts     |    40.9 |    22.22 |     100 |    40.9 | ...95-102,105-121 
 ...nfig/migration |   94.56 |    78.94 |   83.33 |   94.56 |                   
  index.ts         |   93.93 |    88.88 |     100 |   93.93 | 85-86             
  scheduler.ts     |   96.55 |    77.77 |     100 |   96.55 | 19-20             
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...ation/versions |   93.63 |     94.5 |     100 |   93.63 |                   
  ...-v2-shared.ts |     100 |      100 |     100 |     100 |                   
  v1-to-v2.ts      |   81.75 |    90.19 |     100 |   81.75 | ...28-229,231-247 
  v2-to-v3.ts      |     100 |      100 |     100 |     100 |                   
 src/constants     |   93.02 |    94.11 |   66.66 |   93.02 |                   
  ...dardApiKey.ts |     100 |      100 |     100 |     100 |                   
  codingPlan.ts    |   92.74 |    94.11 |   66.66 |   92.74 | ...00-301,309-321 
 src/core          |   51.51 |    33.33 |   33.33 |   51.51 |                   
  auth.ts          |    9.52 |      100 |       0 |    9.52 | 21-48             
  initializer.ts   |   84.37 |    33.33 |     100 |   84.37 | 41,55-58          
  theme.ts         |   38.46 |      100 |       0 |   38.46 | 17-24             
 src/generated     |     100 |      100 |     100 |     100 |                   
  git-commit.ts    |     100 |      100 |     100 |     100 |                   
 src/i18n          |   43.69 |    76.19 |   38.88 |   43.69 |                   
  index.ts         |   26.11 |    76.92 |   26.66 |   26.11 | ...35-236,246-257 
  languages.ts     |   98.27 |       75 |     100 |   98.27 | 88                
 src/i18n/locales  |       0 |        0 |       0 |       0 |                   
  de.js            |       0 |        0 |       0 |       0 | 1-1951            
  en.js            |       0 |        0 |       0 |       0 | 1-1992            
  ja.js            |       0 |        0 |       0 |       0 | 1-1444            
  pt.js            |       0 |        0 |       0 |       0 | 1-1941            
  ru.js            |       0 |        0 |       0 |       0 | 1-1948            
  zh.js            |       0 |        0 |       0 |       0 | 1-1798            
 ...nonInteractive |   68.34 |    71.68 |   68.88 |   68.34 |                   
  session.ts       |    73.1 |    69.52 |   81.81 |    73.1 | ...03-604,612-622 
  types.ts         |    42.5 |      100 |   33.33 |    42.5 | ...74-575,578-579 
 ...active/control |   77.48 |       88 |      80 |   77.48 |                   
  ...rolContext.ts |    7.69 |        0 |       0 |    7.69 | 47-79             
  ...Dispatcher.ts |   91.63 |    91.66 |   88.88 |   91.63 | ...54-372,387,390 
  ...rolService.ts |       8 |        0 |       0 |       8 | 46-179            
 ...ol/controllers |    7.32 |       80 |   13.79 |    7.32 |                   
  ...Controller.ts |   19.32 |      100 |      60 |   19.32 | 81-118,127-210    
  ...Controller.ts |       0 |        0 |       0 |       0 | 1-56              
  ...Controller.ts |    3.96 |      100 |   11.11 |    3.96 | ...61-379,389-494 
  ...Controller.ts |   14.06 |      100 |       0 |   14.06 | ...82-117,130-133 
  ...Controller.ts |    5.72 |      100 |       0 |    5.72 | ...72-384,393-418 
 .../control/types |       0 |        0 |       0 |       0 |                   
  serviceAPIs.ts   |       0 |        0 |       0 |       0 | 1                 
 ...Interactive/io |   97.57 |    92.91 |   96.15 |   97.57 |                   
  ...putAdapter.ts |    97.3 |    91.75 |     100 |    97.3 | ...1272,1297-1298 
  ...putAdapter.ts |      96 |    91.66 |   85.71 |      96 | 51-52             
  ...nputReader.ts |     100 |    94.73 |     100 |     100 | 67                
  ...putAdapter.ts |   98.23 |      100 |   89.47 |   98.23 | 70-71,111-112     
 src/patches       |       0 |        0 |       0 |       0 |                   
  is-in-ci.ts      |       0 |        0 |       0 |       0 | 1-17              
 src/services      |   88.29 |    86.97 |   96.29 |   88.29 |                   
  ...mandLoader.ts |     100 |      100 |     100 |     100 |                   
  ...killLoader.ts |     100 |      100 |     100 |     100 |                   
  ...andService.ts |     100 |      100 |     100 |     100 |                   
  ...mandLoader.ts |   86.38 |    81.48 |     100 |   86.38 | ...25-330,335-340 
  ...omptLoader.ts |    75.1 |    80.64 |   83.33 |    75.1 | ...03-204,270-271 
  ...nd-factory.ts |    91.2 |    93.33 |     100 |    91.2 | 119-126           
  ...ation-tool.ts |     100 |    95.45 |     100 |     100 | 125               
  ...and-parser.ts |   89.74 |    85.71 |     100 |   89.74 | 59-62             
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...ght/generators |   85.95 |    86.42 |   90.47 |   85.95 |                   
  DataProcessor.ts |   85.68 |    86.46 |   92.85 |   85.68 | ...1110,1114-1121 
  ...tGenerator.ts |   98.21 |    85.71 |     100 |   98.21 | 46                
  ...teRenderer.ts |   45.45 |      100 |       0 |   45.45 | 13-51             
 .../insight/types |       0 |       50 |      50 |       0 |                   
  ...sightTypes.ts |       0 |        0 |       0 |       0 |                   
  ...sightTypes.ts |       0 |        0 |       0 |       0 | 1                 
 ...mpt-processors |   97.27 |    94.04 |     100 |   97.27 |                   
  ...tProcessor.ts |     100 |      100 |     100 |     100 |                   
  ...eProcessor.ts |   94.52 |    84.21 |     100 |   94.52 | 46-47,93-94       
  ...tionParser.ts |     100 |      100 |     100 |     100 |                   
  ...lProcessor.ts |   97.41 |    95.65 |     100 |   97.41 | 95-98             
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/test-utils    |   93.63 |    83.33 |      80 |   93.63 |                   
  ...omMatchers.ts |   69.69 |       50 |      50 |   69.69 | 32-35,37-39,45-47 
  ...andContext.ts |     100 |      100 |     100 |     100 |                   
  render.tsx       |     100 |      100 |     100 |     100 |                   
 src/ui            |   65.47 |    71.25 |   48.64 |   65.47 |                   
  App.tsx          |     100 |      100 |     100 |     100 |                   
  AppContainer.tsx |      70 |     62.6 |   57.14 |      70 | ...1217,1231-1351 
  ...tionNudge.tsx |    9.58 |      100 |       0 |    9.58 | 24-94             
  ...ackDialog.tsx |   29.23 |      100 |       0 |   29.23 | 25-75             
  ...tionNudge.tsx |    7.69 |      100 |       0 |    7.69 | 25-103            
  colors.ts        |   52.72 |      100 |   23.52 |   52.72 | ...52,54-55,60-61 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  keyMatchers.ts   |   91.83 |    88.46 |     100 |   91.83 | 25-26,54-55       
  ...tic-colors.ts |     100 |      100 |     100 |     100 |                   
  textConstants.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/auth       |   29.96 |       50 |   26.08 |   29.96 |                   
  AuthDialog.tsx   |   52.67 |    51.16 |   28.57 |   52.67 | ...66,685,687,689 
  ...nProgress.tsx |       0 |        0 |       0 |       0 | 1-64              
  useAuth.ts       |    2.47 |      100 |       0 |    2.47 | 48-612            
 src/ui/commands   |   59.01 |    78.99 |   51.14 |   59.01 |                   
  aboutCommand.ts  |     100 |      100 |     100 |     100 |                   
  agentsCommand.ts |    64.7 |      100 |       0 |    64.7 | ...30,35-36,39-41 
  ...odeCommand.ts |     100 |      100 |     100 |     100 |                   
  arenaCommand.ts  |   32.65 |    67.64 |    37.5 |   32.65 | ...52-557,636-641 
  authCommand.ts   |     100 |      100 |     100 |     100 |                   
  btwCommand.ts    |     100 |    90.32 |     100 |     100 | 25,199,213        
  bugCommand.ts    |   76.47 |    66.66 |      50 |   76.47 | 21-22,57-66       
  clearCommand.ts  |   89.65 |    55.55 |      50 |   89.65 | 23-24,49-50,68-69 
  ...essCommand.ts |   63.15 |       50 |      50 |   63.15 | ...47-148,162-165 
  ...extCommand.ts |    4.65 |      100 |       0 |    4.65 | ...8,93-96,99-375 
  copyCommand.ts   |   96.22 |      100 |      50 |   96.22 | 15-16             
  ...ryCommand.tsx |   59.19 |    73.07 |    37.5 |   59.19 | ...15-216,224-232 
  docsCommand.ts   |   95.23 |       80 |      50 |   95.23 | 20-21             
  editorCommand.ts |     100 |      100 |     100 |     100 |                   
  exportCommand.ts |   55.97 |    91.66 |   33.33 |   55.97 | ...48-349,356-357 
  ...onsCommand.ts |   44.09 |    85.71 |   27.27 |   44.09 | ...35-236,244-245 
  helpCommand.ts   |     100 |      100 |     100 |     100 |                   
  hooksCommand.ts  |   43.92 |       60 |   33.33 |   43.92 | ...86-113,120-121 
  ideCommand.ts    |   56.79 |    57.69 |   35.29 |   56.79 | ...00-301,304-318 
  initCommand.ts   |    81.7 |       70 |      50 |    81.7 | ...67,81-86,88-93 
  ...ghtCommand.ts |   69.23 |       40 |   66.66 |   69.23 | ...97-111,116-129 
  ...ageCommand.ts |   89.24 |    82.35 |   76.92 |   89.24 | ...20-323,345-346 
  mcpCommand.ts    |   85.71 |      100 |      50 |   85.71 | 14-15             
  memoryCommand.ts |   71.11 |    84.61 |    37.5 |   71.11 | ...89,296-297,315 
  modelCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...onsCommand.ts |     100 |      100 |     100 |     100 |                   
  quitCommand.ts   |   93.75 |      100 |      50 |   93.75 | 15-16             
  ...oreCommand.ts |   92.24 |     87.5 |     100 |   92.24 | ...,83-88,129-130 
  resumeCommand.ts |     100 |      100 |     100 |     100 |                   
  ...ngsCommand.ts |     100 |      100 |     100 |     100 |                   
  ...hubCommand.ts |   80.12 |    63.63 |      60 |   80.12 | ...69-172,175-178 
  skillsCommand.ts |    12.5 |      100 |       0 |    12.5 | ...89-105,108-135 
  statsCommand.ts  |   76.92 |       75 |      50 |   76.92 | ...36,50-51,65-66 
  ...aryCommand.ts |    4.61 |      100 |       0 |    4.61 | 21-24,27-322      
  ...tupCommand.ts |     100 |      100 |     100 |     100 |                   
  themeCommand.ts  |     100 |      100 |     100 |     100 |                   
  toolsCommand.ts  |   95.12 |      100 |      50 |   95.12 | 18-19             
  trustCommand.ts  |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
  vimCommand.ts    |   42.85 |      100 |       0 |   42.85 | 14-15,18-28       
 src/ui/components |   62.91 |    73.55 |   64.28 |   62.91 |                   
  AboutBox.tsx     |     100 |      100 |     100 |     100 |                   
  AnsiOutput.tsx   |     100 |      100 |     100 |     100 |                   
  ApiKeyInput.tsx  |   18.91 |      100 |       0 |   18.91 | 30-95             
  AppHeader.tsx    |   87.03 |    42.85 |     100 |   87.03 | 33-39,41          
  ...odeDialog.tsx |     9.7 |      100 |       0 |     9.7 | 35-47,50-182      
  AsciiArt.ts      |     100 |      100 |     100 |     100 |                   
  ...Indicator.tsx |   13.95 |      100 |       0 |   13.95 | 18-58             
  ...TextInput.tsx |   63.22 |    70.27 |      50 |   63.22 | ...12,220-222,240 
  Composer.tsx     |   89.47 |    58.33 |      50 |   89.47 | ...-55,73,110,121 
  ...itDisplay.tsx |   55.81 |      100 |      50 |   55.81 | 22-38,42-43       
  ...entPrompt.tsx |     100 |      100 |     100 |     100 |                   
  ...ryDisplay.tsx |   75.89 |    62.06 |     100 |   75.89 | ...,88,93-108,113 
  ...geDisplay.tsx |   90.47 |       75 |     100 |   90.47 | 20-21             
  ...ification.tsx |   28.57 |      100 |       0 |   28.57 | 16-36             
  ...gProfiler.tsx |       0 |        0 |       0 |       0 | 1-36              
  ...ogManager.tsx |   12.85 |      100 |       0 |   12.85 | 54-374            
  ...ngsDialog.tsx |    8.44 |      100 |       0 |    8.44 | 37-195            
  ExitWarning.tsx  |     100 |      100 |     100 |     100 |                   
  ...ustDialog.tsx |     100 |      100 |     100 |     100 |                   
  Footer.tsx       |   77.31 |    33.33 |     100 |   77.31 | ...64,71-75,77-81 
  ...ngSpinner.tsx |   54.28 |       50 |      50 |   54.28 | 31-48,61          
  Header.tsx       |   94.28 |    76.92 |     100 |   94.28 | 96,98,103-106     
  Help.tsx         |    98.7 |    68.75 |     100 |    98.7 | 74,129            
  ...emDisplay.tsx |    68.9 |     42.1 |     100 |    68.9 | ...19-225,228,231 
  ...ngeDialog.tsx |     100 |      100 |     100 |     100 |                   
  InputPrompt.tsx  |   83.78 |    76.34 |     100 |   83.78 | ...1047,1106,1151 
  ...Shortcuts.tsx |   21.11 |      100 |       0 |   21.11 | ...5,48-50,66-124 
  ...Indicator.tsx |     100 |      100 |     100 |     100 |                   
  ...firmation.tsx |   91.42 |      100 |      50 |   91.42 | 26-31             
  MainContent.tsx  |   18.46 |      100 |       0 |   18.46 | 24-80             
  ...geDisplay.tsx |       0 |        0 |       0 |       0 | 1-41              
  ModelDialog.tsx  |   76.85 |    46.66 |     100 |   76.85 | ...31-440,446-450 
  ...tsDisplay.tsx |     100 |      100 |     100 |     100 |                   
  ...fications.tsx |   18.18 |      100 |       0 |   18.18 | 15-58             
  ...onsDialog.tsx |    2.18 |      100 |       0 |    2.18 | 62-133,148-986    
  ...ryDisplay.tsx |     100 |      100 |     100 |     100 |                   
  ...icePrompt.tsx |   88.14 |    83.87 |     100 |   88.14 | ...01-105,133-138 
  PrepareLabel.tsx |   91.66 |    76.19 |     100 |   91.66 | 73-75,77-79,110   
  ...geDisplay.tsx |     100 |      100 |     100 |     100 |                   
  ...ngDisplay.tsx |   21.42 |      100 |       0 |   21.42 | 13-39             
  ...hProgress.tsx |   85.25 |    88.46 |     100 |   85.25 | 121-147           
  ...ionPicker.tsx |   94.18 |    92.85 |     100 |   94.18 | 79,194-202        
  ...ryDisplay.tsx |     100 |      100 |     100 |     100 |                   
  ...putPrompt.tsx |   72.56 |       80 |      40 |   72.56 | ...06-109,114-117 
  ...ngsDialog.tsx |   66.75 |    72.66 |     100 |   66.75 | ...72-780,786-787 
  ...ionDialog.tsx |    87.8 |      100 |   33.33 |    87.8 | 36-39,44-51       
  ...putPrompt.tsx |    15.9 |      100 |       0 |    15.9 | 20-63             
  ...Indicator.tsx |   44.44 |      100 |       0 |   44.44 | 12-17             
  ...MoreLines.tsx |      28 |      100 |       0 |      28 | 18-40             
  ...ionPicker.tsx |    8.04 |      100 |       0 |    8.04 | 21-129            
  StatsDisplay.tsx |   98.66 |    93.33 |     100 |   98.66 | 199-201           
  ...nsDisplay.tsx |   84.09 |    57.14 |     100 |   84.09 | ...16-118,125-127 
  ThemeDialog.tsx  |   90.95 |    44.44 |      75 |   90.95 | ...16-117,159-161 
  Tips.tsx         |      75 |       60 |      75 |      75 | 23,48-49,52-62    
  TodoDisplay.tsx  |     100 |      100 |     100 |     100 |                   
  ...tsDisplay.tsx |     100 |     87.5 |     100 |     100 | 31-32             
  TrustDialog.tsx  |     100 |    81.81 |     100 |     100 | 71-86             
  ...ification.tsx |   36.36 |      100 |       0 |   36.36 | 15-22             
  ...ackDialog.tsx |    7.84 |      100 |       0 |    7.84 | 24-134            
 ...nts/agent-view |   25.14 |    89.36 |    12.5 |   25.14 |                   
  ...tChatView.tsx |    8.42 |      100 |       0 |    8.42 | 53-272            
  ...tComposer.tsx |    9.95 |      100 |       0 |    9.95 | 57-308            
  AgentFooter.tsx  |   17.07 |      100 |       0 |   17.07 | 28-66             
  AgentHeader.tsx  |   15.38 |      100 |       0 |   15.38 | 27-64             
  AgentTabBar.tsx  |    8.25 |      100 |       0 |    8.25 | 35-55,60-167      
  ...oryAdapter.ts |     100 |     91.3 |     100 |     100 | 102,108-109,137   
  index.ts         |       0 |        0 |       0 |       0 | 1-12              
 ...mponents/arena |    5.92 |      100 |       0 |    5.92 |                   
  ArenaCards.tsx   |       4 |      100 |       0 |       4 | 24-129,134-290    
  ...ectDialog.tsx |    5.28 |      100 |       0 |    5.28 | 32-260            
  ...artDialog.tsx |   10.15 |      100 |       0 |   10.15 | 27-161            
  ...tusDialog.tsx |    5.63 |      100 |       0 |    5.63 | 33-75,80-288      
  ...topDialog.tsx |    6.17 |      100 |       0 |    6.17 | 33-213            
 ...nts/extensions |   45.28 |    33.33 |      60 |   45.28 |                   
  ...gerDialog.tsx |   44.31 |    34.14 |      75 |   44.31 | ...71-480,483-488 
  index.ts         |       0 |        0 |       0 |       0 | 1-9               
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...tensions/steps |   54.77 |    94.23 |   66.66 |   54.77 |                   
  ...ctionStep.tsx |   95.12 |    92.85 |   85.71 |   95.12 | 84-86,89          
  ...etailStep.tsx |    6.18 |      100 |       0 |    6.18 | 17-128            
  ...nListStep.tsx |   88.35 |    94.73 |      80 |   88.35 | 51-52,58-71,105   
  ...electStep.tsx |   13.46 |      100 |       0 |   13.46 | 20-70             
  ...nfirmStep.tsx |   19.56 |      100 |       0 |   19.56 | 23-65             
  index.ts         |     100 |      100 |     100 |     100 |                   
 ...mponents/hooks |   74.26 |    68.18 |   78.94 |   74.26 |                   
  ...etailStep.tsx |   96.52 |       75 |     100 |   96.52 | 33,37,50,59       
  ...etailStep.tsx |   98.13 |    82.35 |     100 |   98.13 | 41-42             
  ...sListStep.tsx |     100 |      100 |     100 |     100 |                   
  ...entDialog.tsx |   39.14 |     37.5 |      50 |   39.14 | ...84,388-401,405 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-11              
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...components/mcp |   18.82 |    84.37 |   77.77 |   18.82 |                   
  ...entDialog.tsx |    3.64 |      100 |       0 |    3.64 | 41-717            
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-30              
  types.ts         |     100 |      100 |     100 |     100 |                   
  utils.ts         |   96.42 |    87.09 |     100 |   96.42 | 21,96-97          
 ...ents/mcp/steps |    7.31 |      100 |       0 |    7.31 |                   
  ...icateStep.tsx |    7.58 |      100 |       0 |    7.58 | 27-197            
  ...electStep.tsx |   10.95 |      100 |       0 |   10.95 | 16-88             
  ...etailStep.tsx |    5.26 |      100 |       0 |    5.26 | 31-247            
  ...rListStep.tsx |    5.88 |      100 |       0 |    5.88 | 20-176            
  ...etailStep.tsx |   10.41 |      100 |       0 |   10.41 | ...1,67-79,82-139 
  ToolListStep.tsx |    7.14 |      100 |       0 |    7.14 | 16-146            
 ...nents/messages |   73.75 |    76.09 |   59.18 |   73.75 |                   
  ...ionDialog.tsx |   65.11 |       73 |   42.85 |   65.11 | ...20,538,556-558 
  BtwMessage.tsx   |   76.31 |       50 |     100 |   76.31 | 34-42             
  ...onMessage.tsx |   91.93 |    82.35 |     100 |   91.93 | 57-59,61,63       
  ...nMessages.tsx |   77.35 |      100 |      70 |   77.35 | ...31-244,248-260 
  DiffRenderer.tsx |   93.19 |    86.17 |     100 |   93.19 | ...09,237-238,304 
  ...ssMessage.tsx |    12.5 |      100 |       0 |    12.5 | 18-59             
  ...sMessages.tsx |   16.17 |      100 |       0 |   16.17 | ...1,85-95,99-104 
  ...ryMessage.tsx |   12.82 |      100 |       0 |   12.82 | 22-59             
  ...onMessage.tsx |   73.07 |    55.81 |   33.33 |   73.07 | ...34-436,443-445 
  ...upMessage.tsx |   95.09 |     87.5 |     100 |   95.09 | 40-43,55          
  ToolMessage.tsx  |   83.09 |    72.72 |      90 |   83.09 | ...94-399,473-475 
 ...ponents/shared |   77.03 |    76.86 |   90.56 |   77.03 |                   
  ...ctionList.tsx |   99.03 |    95.65 |     100 |   99.03 | 85                
  ...tonSelect.tsx |   97.14 |    66.66 |     100 |   97.14 | 72                
  EnumSelector.tsx |     100 |    96.42 |     100 |     100 | 58                
  MaxSizedBox.tsx  |   81.13 |    81.96 |   88.88 |   81.13 | ...12-513,618-619 
  MultiSelect.tsx  |    5.59 |      100 |       0 |    5.59 | 34-41,44-193      
  ...tonSelect.tsx |     100 |      100 |     100 |     100 |                   
  ...eSelector.tsx |     100 |       60 |     100 |     100 | 40-45             
  TextInput.tsx    |    7.14 |      100 |       0 |    7.14 | 39-222            
  text-buffer.ts   |   82.07 |    75.59 |   96.87 |   82.07 | ...1897,1924,1986 
  ...er-actions.ts |   86.71 |    67.79 |     100 |   86.71 | ...07-608,809-811 
 ...ents/subagents |    32.1 |      100 |       0 |    32.1 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  reducers.tsx     |    12.1 |      100 |       0 |    12.1 | 33-190            
  types.ts         |     100 |      100 |     100 |     100 |                   
  utils.ts         |   10.95 |      100 |       0 |   10.95 | ...1,56-57,60-102 
 ...bagents/create |    9.13 |      100 |       0 |    9.13 |                   
  ...ionWizard.tsx |    7.28 |      100 |       0 |    7.28 | 34-299            
  ...rSelector.tsx |   14.75 |      100 |       0 |   14.75 | 26-85             
  ...onSummary.tsx |    4.26 |      100 |       0 |    4.26 | 27-331            
  ...tionInput.tsx |    8.63 |      100 |       0 |    8.63 | 23-177            
  ...dSelector.tsx |   33.33 |      100 |       0 |   33.33 | 20-21,26-27,36-63 
  ...nSelector.tsx |    37.5 |      100 |       0 |    37.5 | 20-21,26-27,36-58 
  ...EntryStep.tsx |   12.76 |      100 |       0 |   12.76 | 34-78             
  ToolSelector.tsx |    4.16 |      100 |       0 |    4.16 | 31-253            
 ...bagents/manage |    8.43 |      100 |       0 |    8.43 |                   
  ...ctionStep.tsx |   10.25 |      100 |       0 |   10.25 | 21-103            
  ...eleteStep.tsx |   20.93 |      100 |       0 |   20.93 | 23-62             
  ...tEditStep.tsx |   25.53 |      100 |       0 |   25.53 | ...2,37-38,51-124 
  ...ctionStep.tsx |    2.29 |      100 |       0 |    2.29 | 28-449            
  ...iewerStep.tsx |   15.21 |      100 |       0 |   15.21 | 18-66             
  ...gerDialog.tsx |    6.74 |      100 |       0 |    6.74 | 35-341            
 ...agents/runtime |    7.83 |      100 |       0 |    7.83 |                   
  ...onDisplay.tsx |    7.83 |      100 |       0 |    7.83 | ...72-502,511-549 
 ...mponents/views |   48.59 |    69.23 |      30 |   48.59 |                   
  ContextUsage.tsx |    5.07 |      100 |       0 |    5.07 | ...30-145,148-424 
  ...sionsList.tsx |   87.69 |    73.68 |     100 |   87.69 | 65-72             
  McpStatus.tsx    |   89.53 |    60.52 |     100 |   89.53 | ...72,175-177,262 
  SkillsList.tsx   |   27.27 |      100 |       0 |   27.27 | 18-35             
  ToolsList.tsx    |     100 |      100 |     100 |     100 |                   
 src/ui/contexts   |   76.97 |    80.31 |   86.11 |   76.97 |                   
  ...ewContext.tsx |   65.77 |      100 |      75 |   65.77 | ...22-225,231-241 
  AppContext.tsx   |      40 |      100 |       0 |      40 | 17-22             
  ...igContext.tsx |   81.81 |       50 |     100 |   81.81 | 15-16             
  ...ssContext.tsx |   85.29 |    83.68 |     100 |   85.29 | ...64-966,969-971 
  ...owContext.tsx |   89.28 |       80 |   66.66 |   89.28 | 34,47-48,60-62    
  ...onContext.tsx |   47.02 |     62.5 |   71.42 |   47.02 | ...36-239,243-246 
  ...gsContext.tsx |   83.33 |       50 |     100 |   83.33 | 17-18             
  ...usContext.tsx |     100 |      100 |     100 |     100 |                   
  ...ngContext.tsx |   71.42 |       50 |     100 |   71.42 | 17-20             
  ...nsContext.tsx |   89.47 |       50 |     100 |   89.47 | 112-113           
  ...teContext.tsx |   85.71 |       50 |     100 |   85.71 | 152-153           
  ...deContext.tsx |   76.08 |    72.72 |     100 |   76.08 | 47-48,52-59,77-78 
 src/ui/editors    |   93.33 |    85.71 |   66.66 |   93.33 |                   
  ...ngsManager.ts |   93.33 |    85.71 |   66.66 |   93.33 | 49,63-64          
 src/ui/hooks      |   79.61 |    81.54 |   81.75 |   79.61 |                   
  ...dProcessor.ts |   83.02 |     81.9 |     100 |   83.02 | ...86-387,406-433 
  keyToAnsi.ts     |    3.92 |      100 |       0 |    3.92 | 19-77             
  ...dProcessor.ts |   94.77 |    70.58 |     100 |   94.77 | ...75-276,281-282 
  ...dProcessor.ts |   76.36 |    59.43 |   66.66 |   76.36 | ...78,702,721-725 
  ...amingState.ts |   12.22 |      100 |       0 |   12.22 | 54-158            
  ...agerDialog.ts |   88.23 |      100 |     100 |   88.23 | 20,24             
  ...odeCommand.ts |   58.82 |      100 |     100 |   58.82 | 28,33-48          
  ...enaCommand.ts |      85 |      100 |     100 |      85 | 23-24,29          
  ...aInProcess.ts |   19.81 |    66.66 |      25 |   19.81 | 57-175            
  ...Completion.ts |   92.77 |    89.09 |     100 |   92.77 | ...86-187,220-223 
  ...ifications.ts |   88.05 |       90 |     100 |   88.05 | 84-93             
  ...tIndicator.ts |     100 |    93.75 |     100 |     100 | 63                
  ...ketedPaste.ts |    23.8 |      100 |       0 |    23.8 | 19-37             
  ...lanUpdates.ts |     100 |       92 |     100 |     100 | 59,158            
  ...ompletion.tsx |   94.87 |    80.55 |     100 |   94.87 | ...02-203,205-206 
  ...dMigration.ts |   90.62 |       75 |     100 |   90.62 | 38-40             
  useCompletion.ts |    92.4 |     87.5 |     100 |    92.4 | 68-69,93-94,98-99 
  ...ialogClose.ts |   22.22 |      100 |     100 |   22.22 | 67-109            
  ...orSettings.ts |     100 |      100 |     100 |     100 |                   
  ...ionUpdates.ts |   93.45 |     92.3 |     100 |   93.45 | ...83-287,300-306 
  ...agerDialog.ts |   88.88 |      100 |     100 |   88.88 | 21,25             
  ...backDialog.ts |   50.37 |    77.77 |   33.33 |   50.37 | ...58-174,195-196 
  useFocus.ts      |     100 |      100 |     100 |     100 |                   
  ...olderTrust.ts |     100 |      100 |     100 |     100 |                   
  ...miniStream.ts |   75.45 |     72.5 |      80 |   75.45 | ...1491,1527-1628 
  ...BranchName.ts |    90.9 |     92.3 |     100 |    90.9 | 19-20,55-58       
  ...oryManager.ts |   98.41 |    93.33 |     100 |   98.41 | 43                
  ...ooksDialog.ts |    87.5 |      100 |     100 |    87.5 | 19,23             
  ...stListener.ts |     100 |      100 |     100 |     100 |                   
  ...nAuthError.ts |   76.19 |       50 |     100 |   76.19 | 39-40,43-45       
  ...putHistory.ts |   92.59 |    85.71 |     100 |   92.59 | 63-64,72,94-96    
  ...storyStore.ts |     100 |    94.11 |     100 |     100 | 69                
  useKeypress.ts   |     100 |      100 |     100 |     100 |                   
  ...rdProtocol.ts |   36.36 |      100 |       0 |   36.36 | 24-31             
  ...unchEditor.ts |    8.97 |      100 |       0 |    8.97 | 20-67,74-125      
  ...gIndicator.ts |     100 |      100 |     100 |     100 |                   
  useLogger.ts     |   21.05 |      100 |       0 |   21.05 | 15-37             
  useMcpDialog.ts  |    87.5 |      100 |     100 |    87.5 | 19,23             
  ...oryMonitor.ts |     100 |      100 |     100 |     100 |                   
  ...ssageQueue.ts |     100 |      100 |     100 |     100 |                   
  ...delCommand.ts |     100 |      100 |     100 |     100 |                   
  ...raseCycler.ts |   84.48 |    76.47 |     100 |   84.48 | ...47,50-51,67-69 
  useQwenAuth.ts   |     100 |      100 |     100 |     100 |                   
  ...lScheduler.ts |   85.06 |    94.73 |     100 |   85.06 | ...05-208,295-305 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-7               
  ...umeCommand.ts |   94.54 |    68.75 |     100 |   94.54 | 60-61,79          
  ...ompletion.tsx |   90.59 |    83.33 |     100 |   90.59 | ...01,104,137-140 
  ...ectionList.ts |   96.59 |    94.62 |     100 |   96.59 | ...82-183,237-240 
  ...sionPicker.ts |   91.66 |    72.34 |     100 |   91.66 | ...45-246,250-251 
  ...ngsCommand.ts |   18.75 |      100 |       0 |   18.75 | 10-25             
  ...ellHistory.ts |   91.74 |    79.41 |     100 |   91.74 | ...74,122-123,133 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-73              
  ...Completion.ts |   80.97 |     84.4 |   91.66 |   80.97 | ...69-471,479-487 
  ...tateAndRef.ts |     100 |      100 |     100 |     100 |                   
  ...eateDialog.ts |   88.23 |      100 |     100 |   88.23 | 14,18             
  ...rminalSize.ts |   76.19 |      100 |      50 |   76.19 | 21-25             
  ...emeCommand.ts |    8.04 |      100 |       0 |    8.04 | 25-112            
  useTimer.ts      |   88.09 |    85.71 |     100 |   88.09 | 44-45,51-53       
  ...lMigration.ts |       0 |        0 |       0 |       0 |                   
  ...rustModify.ts |     100 |      100 |     100 |     100 |                   
  ...elcomeBack.ts |   69.44 |    54.54 |     100 |   69.44 | ...85,89-90,96-98 
  vim.ts           |   83.54 |     79.5 |     100 |   83.54 | ...44,748-756,765 
 src/ui/layouts    |   77.31 |    38.46 |     100 |   77.31 |                   
  ...AppLayout.tsx |   79.36 |       40 |     100 |   79.36 | 38-40,46-53,71-73 
  ...AppLayout.tsx |   73.52 |    33.33 |     100 |   73.52 | 30-35,37-39       
 src/ui/models     |   80.24 |    79.16 |   71.42 |   80.24 |                   
  ...ableModels.ts |   80.24 |    79.16 |   71.42 |   80.24 | ...,61-71,123-125 
 ...noninteractive |     100 |      100 |    7.69 |     100 |                   
  ...eractiveUi.ts |     100 |      100 |    7.69 |     100 |                   
 src/ui/state      |   94.91 |    81.81 |     100 |   94.91 |                   
  extensions.ts    |   94.91 |    81.81 |     100 |   94.91 | 68-69,88          
 src/ui/themes     |      99 |    58.66 |     100 |      99 |                   
  ansi-light.ts    |     100 |      100 |     100 |     100 |                   
  ansi.ts          |     100 |      100 |     100 |     100 |                   
  atom-one-dark.ts |     100 |      100 |     100 |     100 |                   
  ayu-light.ts     |     100 |      100 |     100 |     100 |                   
  ayu.ts           |     100 |      100 |     100 |     100 |                   
  color-utils.ts   |     100 |      100 |     100 |     100 |                   
  default-light.ts |     100 |      100 |     100 |     100 |                   
  default.ts       |     100 |      100 |     100 |     100 |                   
  dracula.ts       |     100 |      100 |     100 |     100 |                   
  github-dark.ts   |     100 |      100 |     100 |     100 |                   
  github-light.ts  |     100 |      100 |     100 |     100 |                   
  googlecode.ts    |     100 |      100 |     100 |     100 |                   
  no-color.ts      |     100 |      100 |     100 |     100 |                   
  qwen-dark.ts     |     100 |      100 |     100 |     100 |                   
  qwen-light.ts    |     100 |      100 |     100 |     100 |                   
  ...tic-tokens.ts |     100 |      100 |     100 |     100 |                   
  ...-of-purple.ts |     100 |      100 |     100 |     100 |                   
  theme-manager.ts |   87.08 |    79.68 |     100 |   87.08 | ...03-312,317-318 
  theme.ts         |     100 |    28.98 |     100 |     100 | 272-461           
  xcode.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/utils      |   67.78 |    83.33 |   79.01 |   67.78 |                   
  ...Colorizer.tsx |   82.78 |    88.23 |     100 |   82.78 | ...10-111,197-223 
  ...nRenderer.tsx |   59.31 |    38.23 |     100 |   59.31 | ...33-139,149-151 
  ...wnDisplay.tsx |   85.75 |    88.05 |     100 |   85.75 | ...76-284,317-342 
  ...eRenderer.tsx |   77.88 |    76.19 |     100 |   77.88 | 54-82             
  ...boardUtils.ts |   59.61 |    58.82 |     100 |   59.61 | ...,86-88,107-149 
  commandUtils.ts  |   93.54 |    88.63 |     100 |   93.54 | ...43,147,149-150 
  computeStats.ts  |     100 |      100 |     100 |     100 |                   
  displayUtils.ts  |   60.46 |      100 |      50 |   60.46 | 19-35             
  formatters.ts    |    94.8 |    98.07 |     100 |    94.8 | 101-104           
  highlight.ts     |   98.63 |       95 |     100 |   98.63 | 93                
  isNarrowWidth.ts |     100 |      100 |     100 |     100 |                   
  ...olDetector.ts |     7.4 |      100 |       0 |     7.4 | ...20-121,124-125 
  layoutUtils.ts   |     100 |      100 |     100 |     100 |                   
  ...nUtilities.ts |   69.84 |    85.71 |     100 |   69.84 | 75-91,100-101     
  ...mConstants.ts |     100 |      100 |     100 |     100 |                   
  ...storyUtils.ts |   59.68 |    67.69 |      90 |   59.68 | ...40,388,393-415 
  ...ickerUtils.ts |     100 |      100 |     100 |     100 |                   
  terminalSetup.ts |    4.37 |      100 |       0 |    4.37 | 44-393            
  textUtils.ts     |   96.52 |    94.44 |    87.5 |   96.52 | 19-20,148-149     
  updateCheck.ts   |     100 |    80.95 |     100 |     100 | 30-42             
 ...i/utils/export |    2.36 |        0 |       0 |    2.36 |                   
  collect.ts       |    0.87 |      100 |       0 |    0.87 | 40-394,401-697    
  index.ts         |     100 |      100 |     100 |     100 |                   
  normalize.ts     |     1.2 |      100 |       0 |     1.2 | 17-346            
  types.ts         |       0 |        0 |       0 |       0 | 1                 
  utils.ts         |      40 |      100 |       0 |      40 | 11-13             
 ...ort/formatters |    3.38 |      100 |       0 |    3.38 |                   
  html.ts          |    9.61 |      100 |       0 |    9.61 | ...28,34-76,82-84 
  json.ts          |      50 |      100 |       0 |      50 | 14-15             
  jsonl.ts         |     3.5 |      100 |       0 |     3.5 | 14-76             
  markdown.ts      |    0.94 |      100 |       0 |    0.94 | 13-295            
 src/utils         |   68.73 |    89.64 |    93.7 |   68.73 |                   
  acpModelUtils.ts |     100 |      100 |     100 |     100 |                   
  ...tification.ts |   92.59 |    71.42 |     100 |   92.59 | 36-37             
  checks.ts        |   33.33 |      100 |       0 |   33.33 | 23-28             
  cleanup.ts       |   65.38 |      100 |   66.66 |   65.38 | 28-37             
  commands.ts      |     100 |      100 |     100 |     100 |                   
  commentJson.ts   |     100 |    93.75 |     100 |     100 | 30                
  deepMerge.ts     |     100 |       90 |     100 |     100 | 41-43,49          
  ...ScopeUtils.ts |   97.56 |    88.88 |     100 |   97.56 | 67                
  ...arResolver.ts |   94.28 |    88.46 |     100 |   94.28 | 28-29,125-126     
  errors.ts        |   98.27 |       95 |     100 |   98.27 | 44-45             
  events.ts        |     100 |      100 |     100 |     100 |                   
  gitUtils.ts      |   91.91 |    84.61 |     100 |   91.91 | 78-81,124-127     
  ...AutoUpdate.ts |    51.2 |       90 |      50 |    51.2 | 87-152            
  ...lationInfo.ts |     100 |      100 |     100 |     100 |                   
  languageUtils.ts |   97.87 |    96.42 |     100 |   97.87 | 132-133           
  math.ts          |       0 |        0 |       0 |       0 | 1-15              
  ...onfigUtils.ts |     100 |      100 |     100 |     100 |                   
  ...iveHelpers.ts |   96.84 |    93.28 |     100 |   96.84 | ...87-488,586,599 
  package.ts       |   88.88 |       80 |     100 |   88.88 | 33-34             
  processUtils.ts  |     100 |      100 |     100 |     100 |                   
  readStdin.ts     |   79.62 |       90 |      80 |   79.62 | 33-40,52-54       
  relaunch.ts      |   98.07 |    76.92 |     100 |   98.07 | 70                
  resolvePath.ts   |   66.66 |       25 |     100 |   66.66 | 12-13,16,18-19    
  sandbox.ts       |       0 |        0 |       0 |       0 | 1-984             
  settingsUtils.ts |   86.32 |    90.59 |   94.44 |   86.32 | ...38,569,632-644 
  spawnWrapper.ts  |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |     100 |      100 |     100 |     100 |                   
  stdioHelpers.ts  |     100 |       60 |     100 |     100 | 23,32             
  systemInfo.ts    |   98.97 |     90.9 |     100 |   98.97 | 171               
  ...InfoFields.ts |   86.79 |    65.78 |     100 |   86.79 | ...15-116,137-138 
  ...entEmitter.ts |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |   91.17 |    82.35 |     100 |   91.17 | 67-68,73-74,77-78 
  version.ts       |     100 |       50 |     100 |     100 | 11                
  windowTitle.ts   |     100 |      100 |     100 |     100 |                   
  ...WithBackup.ts |    62.1 |    77.77 |     100 |    62.1 | 93,107,118-157    
-------------------|---------|----------|---------|---------|-------------------
Core Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   74.74 |    81.32 |   77.28 |   74.74 |                   
 src               |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/__mocks__/fs  |       0 |        0 |       0 |       0 |                   
  promises.ts      |       0 |        0 |       0 |       0 | 1-48              
 src/agents        |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/agents/arena  |   64.56 |    66.66 |   68.49 |   64.56 |                   
  ...gentClient.ts |   79.47 |    88.88 |   81.81 |   79.47 | ...68-183,189-204 
  ArenaManager.ts  |    61.9 |    63.09 |   67.27 |    61.9 | ...1611,1620-1630 
  arena-events.ts  |   64.44 |      100 |      50 |   64.44 | ...71-175,178-183 
  index.ts         |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...gents/backends |   76.77 |    85.23 |    72.6 |   76.77 |                   
  ITermBackend.ts  |   97.97 |    93.93 |     100 |   97.97 | ...78-180,255,307 
  ...essBackend.ts |   92.81 |     85.5 |   82.85 |   92.81 | ...15-235,294,390 
  TmuxBackend.ts   |    90.7 |    76.55 |   97.36 |    90.7 | ...87,697,743-747 
  detect.ts        |   31.25 |      100 |       0 |   31.25 | 34-88             
  index.ts         |     100 |      100 |     100 |     100 |                   
  iterm-it2.ts     |     100 |     92.1 |     100 |     100 | 37-38,106         
  tmux-commands.ts |    6.64 |      100 |    3.03 |    6.64 | ...93-363,386-503 
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...agents/runtime |   80.01 |    75.07 |   70.45 |   80.01 |                   
  agent-core.ts    |    71.4 |     66.4 |   56.52 |    71.4 | ...-975,1002-1048 
  agent-events.ts  |   86.48 |      100 |      75 |   86.48 | 218-222           
  ...t-headless.ts |   79.52 |       75 |      55 |   79.52 | ...54-355,358-359 
  ...nteractive.ts |   83.53 |    78.12 |   77.77 |   83.53 | ...01,503,505,508 
  ...statistics.ts |   98.19 |    82.35 |     100 |   98.19 | 127,151,192,225   
  agent-types.ts   |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/config        |   69.47 |    78.18 |   61.37 |   69.47 |                   
  config.ts        |    65.8 |    74.66 |   54.83 |    65.8 | ...2200,2203-2204 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  models.ts        |     100 |      100 |     100 |     100 |                   
  storage.ts       |   95.55 |    92.59 |   91.17 |   95.55 | ...97-198,232-233 
 ...nfirmation-bus |   21.36 |      100 |       0 |   21.36 |                   
  message-bus.ts   |   14.81 |      100 |       0 |   14.81 | ...5,78-82,90-143 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/core          |   79.28 |    79.64 |   89.65 |   79.28 |                   
  baseLlmClient.ts |     100 |    96.42 |     100 |     100 | 115               
  client.ts        |   74.11 |     74.5 |   86.36 |   74.11 | ...04,823,849-865 
  ...tGenerator.ts |    72.1 |    61.11 |     100 |    72.1 | ...42,344,351-354 
  ...lScheduler.ts |   67.78 |    75.93 |   89.65 |   67.78 | ...1642,1699-1703 
  geminiChat.ts    |   84.16 |    84.66 |    86.2 |   84.16 | ...87-698,732-735 
  geminiRequest.ts |     100 |      100 |     100 |     100 |                   
  logger.ts        |   82.25 |    81.81 |     100 |   82.25 | ...57-361,407-421 
  ...tyDefaults.ts |     100 |      100 |     100 |     100 |                   
  ...olExecutor.ts |   92.59 |       75 |      50 |   92.59 | 41-42             
  ...on-helpers.ts |   67.67 |    30.43 |     100 |   67.67 | ...86,192,197-206 
  prompts.ts       |   88.66 |    87.87 |   72.72 |   88.66 | ...-876,1079-1080 
  tokenLimits.ts   |     100 |    88.23 |     100 |     100 | 43-44             
  ...okTriggers.ts |   99.31 |    90.54 |     100 |   99.31 | 124,135           
  turn.ts          |   96.15 |    88.46 |     100 |   96.15 | ...49,362-363,411 
 ...ntentGenerator |   93.99 |     74.3 |    90.9 |   93.99 |                   
  ...tGenerator.ts |   96.61 |     74.1 |   86.66 |   96.61 | ...92-293,427,483 
  converter.ts     |   93.47 |       75 |     100 |   93.47 | ...87-488,498,558 
  index.ts         |       0 |        0 |       0 |       0 | 1-21              
 ...ntentGenerator |   91.37 |    70.31 |   93.33 |   91.37 |                   
  ...tGenerator.ts |      90 |    70.49 |   92.85 |      90 | ...77-283,301-302 
  index.ts         |     100 |    66.66 |     100 |     100 | 45                
 ...ntentGenerator |   90.34 |    71.57 |      85 |   90.34 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...tGenerator.ts |   90.29 |    71.57 |      85 |   90.29 | ...62,472-473,501 
 ...ntentGenerator |   75.52 |    83.85 |   91.42 |   75.52 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  converter.ts     |   70.98 |    78.77 |   88.88 |   70.98 | ...1321,1342-1351 
  errorHandler.ts  |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-94              
  ...tGenerator.ts |   48.78 |    91.66 |   77.77 |   48.78 | ...10-163,166-167 
  pipeline.ts      |   93.94 |    87.17 |     100 |   93.94 | ...90,425-426,434 
  ...CallParser.ts |   90.66 |    88.57 |     100 |   90.66 | ...15-319,349-350 
 ...rator/provider |   96.09 |    88.07 |   93.75 |   96.09 |                   
  dashscope.ts     |   96.33 |    87.69 |   93.33 |   96.33 | ...12-213,289-290 
  deepseek.ts      |   90.76 |       75 |     100 |   90.76 | 40-41,45-46,59-60 
  default.ts       |   97.56 |      100 |   85.71 |   97.56 | 85-86             
  index.ts         |     100 |      100 |     100 |     100 |                   
  modelscope.ts    |     100 |      100 |     100 |     100 |                   
  openrouter.ts    |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 |                   
 src/extension     |   61.33 |       80 |   78.44 |   61.33 |                   
  ...-converter.ts |   63.44 |    47.82 |      90 |   63.44 | ...81-782,791-823 
  ...ionManager.ts |   44.82 |    83.59 |   65.11 |   44.82 | ...1329,1350-1369 
  ...onSettings.ts |   93.46 |    93.05 |     100 |   93.46 | ...17-221,228-232 
  ...-converter.ts |   54.88 |    94.44 |      60 |   54.88 | ...35-146,158-192 
  github.ts        |   44.89 |    89.83 |      60 |   44.89 | ...49-355,394-447 
  index.ts         |     100 |      100 |     100 |     100 |                   
  marketplace.ts   |   97.19 |    93.47 |     100 |   97.19 | ...63,183-184,266 
  override.ts      |   94.11 |    88.88 |     100 |   94.11 | 63-64,81-82       
  settings.ts      |   66.26 |      100 |      50 |   66.26 | 81-108,143-149    
  storage.ts       |   94.73 |       90 |     100 |   94.73 | 41-42             
  ...ableSchema.ts |     100 |      100 |     100 |     100 |                   
  variables.ts     |   88.75 |    83.33 |     100 |   88.75 | ...28-231,234-237 
 src/generated     |       0 |        0 |       0 |       0 |                   
  git-commit.ts    |       0 |        0 |       0 |       0 | 1-10              
 src/hooks         |   85.09 |    87.85 |   90.09 |   85.09 |                   
  ...Aggregator.ts |   96.17 |       90 |     100 |   96.17 | ...74,276-277,350 
  ...entHandler.ts |   95.03 |    83.33 |    91.3 |   95.03 | ...17,570-571,581 
  hookPlanner.ts   |   84.67 |    78.57 |      90 |   84.67 | ...26,132,150-161 
  hookRegistry.ts  |   79.54 |    83.92 |   92.85 |   79.54 | ...46-251,340-352 
  hookRunner.ts    |   72.05 |    79.24 |   77.77 |   72.05 | ...68-378,381-391 
  hookSystem.ts    |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  trustedHooks.ts  |    9.75 |      100 |       0 |    9.75 | 24-118            
  types.ts         |   91.42 |    95.94 |   85.18 |   91.42 | ...93-294,354-358 
 src/ide           |   74.28 |    83.39 |   78.33 |   74.28 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  detect-ide.ts    |     100 |      100 |     100 |     100 |                   
  ide-client.ts    |    64.2 |    81.48 |   66.66 |    64.2 | ...9-970,999-1007 
  ide-installer.ts |   89.06 |    79.31 |     100 |   89.06 | ...36,143-147,160 
  ideContext.ts    |     100 |      100 |     100 |     100 |                   
  process-utils.ts |   84.84 |    71.79 |     100 |   84.84 | ...37,151,193-194 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/lsp           |   33.39 |    43.75 |   44.91 |   33.39 |                   
  ...nfigLoader.ts |   70.27 |    35.89 |   94.73 |   70.27 | ...20-422,426-432 
  ...ionFactory.ts |    4.29 |      100 |       0 |    4.29 | ...20-371,377-394 
  ...Normalizer.ts |   23.09 |    13.72 |   30.43 |   23.09 | ...04-905,909-924 
  ...verManager.ts |   10.47 |       75 |      25 |   10.47 | ...56-675,681-711 
  ...eLspClient.ts |   17.89 |      100 |       0 |   17.89 | ...37-244,254-258 
  ...LspService.ts |   45.87 |    62.13 |   66.66 |   45.87 | ...1282,1299-1309 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/mcp           |   78.74 |    75.68 |   75.92 |   78.74 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...h-provider.ts |   86.95 |      100 |   33.33 |   86.95 | ...,93,97,101-102 
  ...h-provider.ts |   73.74 |    54.45 |     100 |   73.74 | ...64-871,878-880 
  ...en-storage.ts |   98.62 |    97.72 |     100 |   98.62 | 87-88             
  oauth-utils.ts   |   70.58 |    85.29 |    90.9 |   70.58 | ...70-290,315-344 
  ...n-provider.ts |   89.83 |    95.83 |   45.45 |   89.83 | ...43,147,151-152 
 .../token-storage |   79.48 |    86.66 |   86.36 |   79.48 |                   
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   82.75 |    82.35 |   92.85 |   82.75 | ...62-172,180-181 
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   68.14 |    82.35 |   64.28 |   68.14 | ...81-295,298-314 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/mocks         |       0 |        0 |       0 |       0 |                   
  msw.ts           |       0 |        0 |       0 |       0 | 1-9               
 src/models        |   88.34 |    82.51 |   87.69 |   88.34 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...nfigErrors.ts |   74.22 |       44 |   84.61 |   74.22 | ...,67-74,106-117 
  ...igResolver.ts |    97.5 |    86.44 |     100 |    97.5 | ...95,301,316-317 
  modelRegistry.ts |     100 |    98.21 |     100 |     100 | 182               
  modelsConfig.ts  |   83.61 |    81.37 |   83.78 |   83.61 | ...1157,1186-1187 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/output        |     100 |      100 |     100 |     100 |                   
  ...-formatter.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/permissions   |   70.28 |    88.43 |   47.44 |   70.28 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...on-manager.ts |   79.63 |    81.11 |   78.26 |   79.63 | ...17-718,725-734 
  rule-parser.ts   |   97.85 |    95.67 |     100 |   97.85 | ...93-794,938-940 
  ...-semantics.ts |   58.28 |    85.27 |    30.2 |   58.28 | ...1604-1614,1643 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/prompts       |   29.09 |      100 |      25 |   29.09 |                   
  mcp-prompts.ts   |   18.18 |      100 |       0 |   18.18 | 11-19             
  ...t-registry.ts |   31.81 |      100 |   28.57 |   31.81 | ...45,51-58,71-76 
 src/qwen          |   85.87 |    79.93 |   97.18 |   85.87 |                   
  ...tGenerator.ts |   98.64 |    98.18 |     100 |   98.64 | 105-106           
  qwenOAuth2.ts    |   84.74 |    75.78 |   93.33 |   84.74 | ...4,963-979,1009 
  ...kenManager.ts |   83.67 |    76.03 |     100 |   83.67 | ...59-764,785-790 
 src/services      |   80.52 |    79.06 |   85.07 |   80.52 |                   
  ...ionService.ts |   93.95 |    90.76 |     100 |   93.95 | ...58,190,192-196 
  ...ingService.ts |   68.39 |    48.38 |   85.71 |   68.39 | ...25-437,453-454 
  ...eryService.ts |   80.43 |    95.45 |      75 |   80.43 | ...19-134,140-141 
  ...temService.ts |   89.76 |     85.1 |   88.88 |   89.76 | ...89,191,266-273 
  gitService.ts    |   66.29 |     90.9 |   55.55 |   66.29 | ...03-113,116-120 
  ...reeService.ts |   68.75 |    67.04 |   86.95 |   68.75 | ...88-789,805,821 
  ...ionService.ts |   98.98 |     98.3 |     100 |   98.98 | 260-261           
  ...ionService.ts |   79.23 |    73.19 |   88.88 |   79.23 | ...53-674,682-706 
  ...ionService.ts |   83.46 |    78.53 |   83.33 |   83.46 | ...1017,1023-1028 
 src/skills        |   76.31 |    80.14 |   77.77 |   76.31 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  skill-load.ts    |   90.69 |    77.77 |     100 |   90.69 | ...24,144,156-158 
  skill-manager.ts |   71.57 |    80.76 |   73.91 |   71.57 | ...91-699,702-711 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/subagents     |   80.41 |    84.21 |    92.1 |   80.41 |                   
  ...tin-agents.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...nt-manager.ts |   72.88 |    75.83 |      88 |   72.88 | ...90-912,982-983 
  types.ts         |     100 |      100 |     100 |     100 |                   
  validation.ts    |   92.34 |    96.51 |     100 |   92.34 | 50-55,59-64,68-73 
 src/telemetry     |   68.77 |    83.47 |   72.77 |   68.77 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...-exporters.ts |   36.76 |      100 |   22.22 |   36.76 | ...84,87-88,91-92 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-111             
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-128             
  loggers.ts       |   53.11 |     61.4 |      55 |   53.11 | ...1041,1050-1058 
  metrics.ts       |   75.93 |    86.74 |   76.92 |   75.93 | ...09-846,849-878 
  sanitize.ts      |      80 |    83.33 |     100 |      80 | 35-36,41-42       
  sdk.ts           |   85.13 |    56.25 |     100 |   85.13 | ...78,184-185,191 
  ...etry-utils.ts |     100 |      100 |     100 |     100 |                   
  ...l-decision.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |   81.48 |    86.48 |   84.37 |   81.48 | ...53-864,873-896 
  uiTelemetry.ts   |   91.87 |    96.15 |   78.57 |   91.87 | ...67-168,174-181 
 ...ry/qwen-logger |   68.18 |    80.21 |   64.91 |   68.18 |                   
  event-types.ts   |       0 |        0 |       0 |       0 |                   
  qwen-logger.ts   |   68.18 |       80 |   64.28 |   68.18 | ...1040,1078-1079 
 src/test-utils    |   89.28 |    94.11 |   76.66 |   89.28 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  mock-tool.ts     |   86.53 |    93.33 |      75 |   86.53 | ...52,195-196,209 
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
 src/tools         |   74.23 |    79.43 |   79.94 |   74.23 |                   
  agent.ts         |   92.04 |    92.13 |   93.33 |   92.04 | ...56-460,578-583 
  ...erQuestion.ts |   87.89 |     73.8 |    90.9 |   87.89 | ...44-345,349-350 
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  edit.ts          |   82.47 |    84.53 |      80 |   82.47 | ...23-524,607-657 
  exitPlanMode.ts  |   85.81 |    86.95 |     100 |   85.81 | ...24-129,157-169 
  glob.ts          |   91.57 |    88.33 |   84.61 |   91.57 | ...20,163,293,296 
  grep.ts          |   71.64 |    87.34 |   72.22 |   71.64 | ...84,524,532-539 
  ls.ts            |   96.72 |    90.14 |     100 |   96.72 | 169-174,205,209   
  lsp.ts           |   72.58 |    60.29 |   90.32 |   72.58 | ...1202,1204-1205 
  ...nt-manager.ts |   47.47 |       60 |   44.44 |   47.47 | ...73-491,494-531 
  mcp-client.ts    |   29.24 |    69.44 |   46.87 |   29.24 | ...1416,1420-1423 
  mcp-tool.ts      |   90.45 |    87.95 |      96 |   90.45 | ...06-507,557-558 
  memoryTool.ts    |   74.48 |    83.05 |   90.47 |   74.48 | ...48-356,458-542 
  ...iable-tool.ts |     100 |    84.61 |     100 |     100 | 102,109           
  read-file.ts     |   96.47 |     87.8 |   88.88 |   96.47 | 68,70,72-73,79-80 
  ripGrep.ts       |   96.24 |    90.76 |     100 |   96.24 | ...73,276,354-355 
  ...-transport.ts |    6.34 |      100 |       0 |    6.34 | 47-145            
  shell.ts         |   86.14 |    78.12 |    92.3 |   86.14 | ...59-463,657-658 
  skill.ts         |   94.08 |    88.88 |   84.61 |   94.08 | ...16,255-258,262 
  todoWrite.ts     |   85.42 |    84.09 |   84.61 |   85.42 | ...05-410,432-433 
  tool-error.ts    |     100 |      100 |     100 |     100 |                   
  tool-names.ts    |     100 |      100 |     100 |     100 |                   
  tool-registry.ts |   62.79 |    65.38 |   59.37 |   62.79 | ...34-543,550-566 
  tools.ts         |   83.77 |    89.58 |   82.35 |   83.77 | ...19-420,436-442 
  web-fetch.ts     |   85.41 |    58.33 |   91.66 |   85.41 | ...58-259,261-262 
  write-file.ts    |   82.48 |    80.32 |      75 |   82.48 | ...24-427,439-474 
 ...ols/web-search |   72.42 |    76.59 |   76.47 |   72.42 |                   
  base-provider.ts |    40.9 |    33.33 |     100 |    40.9 | 40-43,48-56       
  index.ts         |   76.85 |    84.61 |   84.61 |   76.85 | ...62-166,272-282 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
  utils.ts         |      60 |       50 |      50 |      60 | 35-42             
 ...arch/providers |   46.73 |     64.7 |   72.72 |   46.73 |                   
  ...e-provider.ts |       8 |      100 |       0 |       8 | 68-83,89-199      
  ...e-provider.ts |      82 |    55.55 |     100 |      82 | 57-58,61-62,72-76 
  ...y-provider.ts |   89.79 |       75 |     100 |   89.79 | 62-66             
 src/utils         |   85.74 |    87.54 |   89.22 |   85.74 |                   
  LruCache.ts      |       0 |        0 |       0 |       0 | 1-41              
  ...ssageQueue.ts |     100 |      100 |     100 |     100 |                   
  ...cFileWrite.ts |   76.08 |    44.44 |     100 |   76.08 | 61-70,72          
  browser.ts       |    7.69 |      100 |       0 |    7.69 | 17-56             
  ...igResolver.ts |     100 |      100 |     100 |     100 |                   
  debugLogger.ts   |   96.12 |    93.75 |   93.75 |   96.12 | 164-168           
  editHelper.ts    |   92.67 |    82.14 |     100 |   92.67 | ...52-454,463-464 
  editor.ts        |   96.98 |    93.87 |     100 |   96.98 | ...93-194,196-197 
  ...arResolver.ts |   94.28 |    88.88 |     100 |   94.28 | 28-29,125-126     
  ...entContext.ts |     100 |       95 |     100 |     100 | 83                
  errorParsing.ts  |   96.92 |       95 |     100 |   96.92 | 36-37             
  ...rReporting.ts |   88.46 |       90 |     100 |   88.46 | 69-74             
  errors.ts        |    68.7 |    77.27 |   53.33 |    68.7 | ...86-202,206-212 
  fetch.ts         |   71.97 |    71.42 |   71.42 |   71.97 | ...38,144,157,182 
  fileUtils.ts     |   91.68 |    83.85 |   94.73 |   91.68 | ...28-734,748-754 
  formatters.ts    |   54.54 |       50 |     100 |   54.54 | 12-16             
  ...eUtilities.ts |   89.21 |    86.66 |     100 |   89.21 | 16-17,49-55,65-66 
  ...rStructure.ts |   94.36 |    94.28 |     100 |   94.36 | ...17-120,330-335 
  getPty.ts        |    12.5 |      100 |       0 |    12.5 | 21-34             
  ...noreParser.ts |    92.3 |    89.36 |     100 |    92.3 | ...15-116,186-187 
  gitUtils.ts      |   36.66 |    76.92 |      50 |   36.66 | ...4,88-89,97-148 
  iconvHelper.ts   |     100 |      100 |     100 |     100 |                   
  ...rePatterns.ts |     100 |      100 |     100 |     100 |                   
  ...ionManager.ts |     100 |       90 |     100 |     100 | 26                
  jsonl-utils.ts   |    8.87 |      100 |       0 |    8.87 | ...51-184,190-196 
  ...-detection.ts |     100 |      100 |     100 |     100 |                   
  ...yDiscovery.ts |   82.97 |    76.59 |     100 |   82.97 | ...75,292-293,296 
  ...tProcessor.ts |   93.63 |    90.12 |     100 |   93.63 | ...96-302,384-385 
  ...Inspectors.ts |   61.53 |      100 |      50 |   61.53 | 18-23             
  ...kerChecker.ts |   84.04 |    78.94 |     100 |   84.04 | 68-69,79-84,92-98 
  openaiLogger.ts  |   86.27 |    82.14 |     100 |   86.27 | ...05-107,130-135 
  partUtils.ts     |     100 |      100 |     100 |     100 |                   
  pathReader.ts    |     100 |      100 |     100 |     100 |                   
  paths.ts         |   95.67 |    94.52 |     100 |   95.67 | ...,70-71,103-104 
  ...ectSummary.ts |    3.75 |      100 |       0 |    3.75 | 27-119            
  ...tIdContext.ts |     100 |      100 |     100 |     100 |                   
  ...rDetection.ts |   58.57 |       76 |     100 |   58.57 | ...4,88-89,95-100 
  ...noreParser.ts |   85.45 |    81.48 |     100 |   85.45 | ...59,65-66,72-73 
  rateLimit.ts     |      90 |    84.37 |     100 |      90 | 68,79-81          
  readManyFiles.ts |   85.95 |    85.71 |     100 |   85.95 | ...80-182,198-209 
  retry.ts         |   70.14 |    76.92 |     100 |   70.14 | ...88,206,213-214 
  ripgrepUtils.ts  |   46.53 |    83.33 |   66.66 |   46.53 | ...32-233,245-322 
  ...tchOptions.ts |   55.88 |       50 |      75 |   55.88 | ...29-130,151-152 
  safeJsonParse.ts |   74.07 |    83.33 |     100 |   74.07 | 40-46             
  ...nStringify.ts |     100 |      100 |     100 |     100 |                   
  ...aConverter.ts |   90.78 |    87.87 |     100 |   90.78 | ...41-42,93,95-96 
  ...aValidator.ts |     100 |    82.85 |     100 |     100 | 16-40,94-95,126   
  ...r-launcher.ts |   76.52 |     87.5 |   66.66 |   76.52 | ...33,135,153-191 
  shell-utils.ts   |   84.23 |    90.87 |     100 |   84.23 | ...1035,1042-1046 
  ...lAstParser.ts |   97.27 |    85.54 |     100 |   97.27 | ...1030-1032,1042 
  ...nlyChecker.ts |   85.15 |    85.89 |   81.81 |   85.15 | ...13-314,318-319 
  ...tGenerator.ts |     100 |     90.9 |     100 |     100 | 129               
  symlink.ts       |   77.77 |       50 |     100 |   77.77 | 44,54-59          
  ...emEncoding.ts |   96.36 |    91.17 |     100 |   96.36 | 59-60,124-125     
  ...Serializer.ts |   99.07 |    91.22 |     100 |   99.07 | 90,156-158        
  testUtils.ts     |   53.33 |      100 |   33.33 |   53.33 | ...53,59-64,70-72 
  textUtils.ts     |      60 |      100 |   66.66 |      60 | 36-55             
  thoughtUtils.ts  |     100 |    92.85 |     100 |     100 | 71                
  ...-converter.ts |   94.59 |    85.71 |     100 |   94.59 | 35-36             
  tool-utils.ts    |    93.6 |     91.3 |     100 |    93.6 | ...58-159,162-163 
  truncation.ts    |     100 |     91.3 |     100 |     100 | 52,71             
  ...aceContext.ts |   96.22 |       92 |   93.33 |   96.22 | ...15-116,133,160 
  yaml-parser.ts   |      92 |    83.67 |     100 |      92 | 49-53,65-69       
 ...ils/filesearch |   96.17 |     91.4 |     100 |   96.17 |                   
  crawlCache.ts    |     100 |      100 |     100 |     100 |                   
  crawler.ts       |   96.22 |     92.3 |     100 |   96.22 | 66-67             
  fileSearch.ts    |   93.22 |    87.14 |     100 |   93.22 | ...30-231,233-234 
  ignore.ts        |     100 |      100 |     100 |     100 |                   
  result-cache.ts  |     100 |     92.3 |     100 |     100 | 46                
 ...uest-tokenizer |   56.63 |    74.52 |   74.19 |   56.63 |                   
  ...eTokenizer.ts |   41.86 |    76.47 |   69.23 |   41.86 | ...70-443,453-507 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...tTokenizer.ts |   68.39 |    69.49 |    90.9 |   68.39 | ...24-325,327-328 
  ...ageFormats.ts |      76 |      100 |   33.33 |      76 | 45-48,55-56       
  textTokenizer.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 | 1                 
-------------------|---------|----------|---------|---------|-------------------

For detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

- Add photo message handling in Telegram adapter with base64 encoding

- Add document/file message handling with temp directory storage

- Extend WeChat adapter to support file downloads from CDN

- Refactor envelope building into reusable buildEnvelope method

- Rename ImageCdnRef to CdnRef for generic media handling

This enables users to send images and files through both Telegram and WeChat channels, with files saved to a temp directory for agent access.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

- Add Media Support section to overview with images and files

- Document model option for multimodal channel support

- Add Images and Files section to Telegram guide

- Add complete WeChat (Weixin) setup guide with QR auth

This documents the new media handling capabilities added to both Telegram and WeChat channels.
@tanzhenxin tanzhenxin changed the title feat(channels): add Telegram channel integration with ACP bridge feat(channels): add Channels feature with Telegram and WeChat support Mar 25, 2026
@tanzhenxin tanzhenxin marked this pull request as ready for review March 25, 2026 09:34
tanzhenxin and others added 3 commits March 26, 2026 02:55
- Add session persistence to SessionRouter for crash recovery
- Add loadSession method to AcpBridge for restoring sessions
- Add ChannelBaseOptions to support external router injection
- Refactor start.ts to support both standalone and gateway modes
- Extract config utilities into separate module

This enables channels to recover sessions after bridge crashes and
supports running multiple channels under a gateway process.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add `qwen channel status` to check running service info
- Add `qwen channel stop` to gracefully stop the service
- Add PID file tracking to prevent duplicate service instances
- Update documentation with new commands and usage

This enables users to manage the channel service from another terminal
without needing to use Ctrl+C on the foreground process.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add /help, /clear (aliases: /reset, /new), /status commands to ChannelBase
- Commands are handled locally without agent round-trip
- TelegramAdapter skips "Working..." indicator for local commands
- Update docs to reflect new command structure

This provides a consistent command interface across all channel types
(Telegram, WeChat, etc.) with platform-specific extensibility.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
TOPIC_ROBOT,
(msg: DWClientDownStream) => {
// ACK immediately so DingTalk doesn't retry
this.client.send(msg.headers.messageId, {
Copy link
Copy Markdown
Collaborator

@wenshao wenshao Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACKing immediately before local processing completes creates a real loss window: if the process crashes after the ACK but before onMessage()/handleInbound() succeeds, DingTalk will not retry and the message is gone. This callback needs either a minimal durable checkpoint before ACK or a recoverable inbox/queue model.

— qwen-code + gpt-5.4

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted risk, deferred — ACK-first is an intentional tradeoff. Agent prompts can take minutes; deferring ACK would cause DingTalk to retry during processing, creating duplicate messages. The crash-after-ACK message loss scenario is real but rare, and fixing it properly requires a durable message queue or checkpoint, which is out of scope for MVP.

@wenshao
Copy link
Copy Markdown
Collaborator

wenshao commented Mar 30, 2026

补充审计意见 (Supplemental Review)

wenshao 专家非常详尽的评审基础上,我对该 PR 进行了独立的无方向审计。以下是一些额外的技术细节和改进建议,旨在提升 Channels 平台的并发能力、生产稳定性及渲染质量:

1. 并发瓶颈风险 (Concurrency Bottleneck)

PairingStore.ts 中,MAX_PENDING 被硬编码为 3。对于消息平台(尤其是群聊场景),全局仅允许 3 个待处理配对请求极易导致合法用户被误拒。建议:

  • 调高该阈值(如 10-20)。
  • 或者改为基于用户/IP 的动态速率限制。

2. Bridge 启动可靠性 (Fragile Startup)

AcpBridge.ts (L67-70) 使用了 1 秒的 setTimeout 等待子进程启动。这是一个典型的“竞态条件”设计,受限于系统负载。建议:

  • 实现正式的 ACP Handshake 握手。
  • 或通过 stdout 捕获特定初始化成功的信号再 resolve。

3. 流式渲染鲁棒性 (Markdown Fragment Risk)

BlockStreamer.ts 的段落分块逻辑在处理 Markdown 代码块 (```) 或复杂列表时存在风险。如果在代码块内部发生截断,会导致客户端 UI 渲染结构损坏。建议:

  • 增加简单的语法检查,避免在开启的标记块内中途截断。

4. 内存管理策略 (Memory Management)

SessionRouter 中的 toSessiontoTarget 映射表目前随时间无限增长,缺乏淘汰机制。对于长运行服务,这是一个潜在的内存溢出点。建议:

  • 引入简单的清理策略或使用 lru-cache 管理活跃会话。

5. 进程生命周期处理 (Incomplete SIGTERM Handling)

start.ts 中,SIGTERM 回调函数中的异步清理逻辑(如 channel.disconnect())未被正确 await。进程可能在资源(如远程连接、临时文件)完全释放前就被操作系统强制终止。

6. 安全实践肯定 (Positive Implementation)

肯定一下:AcpBridgespawn 子进程时正确设置了 shell: false,从底层防止了 shell 注入风险。


Audit by: gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator

@wenshao wenshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

针对该 PR 的部分关键技术细节进行的补充评审。建议采纳相关优化以提升生产环境下的鲁棒性和并发能力。

Audit by: gemini-3.1-pro-preview

const SAFE_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
const CODE_LENGTH = 8;
const EXPIRY_MS = 60 * 60 * 1000; // 1 hour
const MAX_PENDING = 3;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAX_PENDING = 3 的硬编码数值在群聊或高流量场景下过小,容易导致合法用户被误拒。建议根据实际负载需求调优此阈值。 -- gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — 3 concurrent pairings is a reasonable limit for MVP. It's a product policy, not a bug.

});

// Give the process a moment to start
await new Promise((resolve) => setTimeout(resolve, 1000));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用固定的 setTimeout 等待子进程启动较为脆弱。建议改为监听子进程 stdout 的就绪信号或实现标准握手机制。 -- gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — 1s is fine for local process startup in MVP. Will revisit if users report race conditions.

}

export class SessionRouter {
private toSession: Map<string, string> = new Map(); // routing key → session ID
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前的 Map 结构随时间无限增长。对于长期运行的服务,建议引入 LRU 淘汰策略以防止潜在的内存溢出。 -- gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — each entry is small; not a concern at MVP scale. Will revisit if long-running bots show memory growth.

* Find the best break point at or before maxPos.
* Prefers paragraph break > newline > space > maxPos.
*/
private findBreakPoint(text: string, maxPos: number): number {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处的分块逻辑在处理 Markdown 复杂结构(如嵌套代码块或列表)时可能导致渲染断点错误。建议增强分块时对 Markdown 语法的感知。 -- gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — cosmetic issue, worst case is a broken bold/code block across two messages.

}
});

const shutdown = () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIGTERM 回调中的 shutdown 逻辑应确保异步清理过程(如连接断开、临时文件清理)被完整执行并被 await,否则进程可能在资源释放前即被强制终止。 -- gemini-3.1-pro-preview

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — all cleanup operations (disconnect(), bridge.stop(), clearAll(), removeServiceInfo()) are synchronous in all current implementations. No async work to await.


export function resolveEnvVars(value: string): string {
if (value.startsWith('$')) {
const envName = value.substring(1);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

环境变量语法不支持 ${VAR}(带花括号)

resolveEnvVars 检测 $ 前缀后直接取 substring(1) 作为变量名。对于 ${TELEGRAM_TOKEN} 这种写法,实际查找的变量名是 {TELEGRAM_TOKEN}(含花括号),会报出令人困惑的 "variable not set" 错误。

${VAR} 是 Docker Compose、shell 等配置系统中的标准写法,用户很自然会使用这种格式。

建议:增加花括号剥离逻辑:

let envName = value.substring(1);
if (envName.startsWith('{') && envName.endsWith('}')) {
  envName = envName.slice(1, -1);
}

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — only $VAR is documented and used. A fuller implementation exists elsewhere in the codebase if needed later.

private seenMessages: Map<string, number> = new Map();
private dedupTimer?: ReturnType<typeof setInterval>;
/** Map conversationId → latest sessionWebhook URL for sending replies. */
private webhooks: Map<string, string> = new Map();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DingTalk sessionWebhook 无限期缓存,但实际有 TTL

DingTalk 的 sessionWebhook 通常有 10-30 分钟的有效期,但这里缓存在 Map 中永不清理。对于执行时间较长的 agent 任务,响应发送时 webhook 可能已过期,导致静默发送失败——用户收不到任何回复,也无错误通知。

建议:

  1. 存储 webhook 时附带时间戳,发送前检查新鲜度
  2. 发送失败时检查是否为过期错误,给用户发送提醒
  3. 或添加定期清理过期 webhook 的定时器

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — only affects conversations idle >10 min. Active conversations refresh the webhook on each message.

const result = await router.restoreSessions();
writeStdoutLine(
`[Channel] Bridge restarted. Sessions restored: ${result.restored}, failed: ${result.failed}`,
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crashCount 在成功重启后重置为 0,可能导致无限崩溃循环

第 213 行在 bridge 成功重启后将 crashCount 重置为 0。这意味着如果 bridge 持续不稳定(每次启动后短暂存活再崩溃),它会无限循环:崩溃 3 次 → 重启 → 重置 → 崩溃 3 次 → 重启……,掩盖了底层问题并可能刷满日志。

建议:使用时间窗口计数(例如 10 分钟内 3 次崩溃则放弃),或使用单调递增计数器不重置,或添加生命周期总崩溃数硬上限。

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — replaced resettable counter with time-window counting (3 crashes within 5 minutes = give up).


/** Detect image MIME type from magic bytes. */
function detectImageMime(data: Buffer): string {
if (data[0] === 0x89 && data[1] === 0x50 && data[2] === 0x4e) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detectImageMime 访问 Buffer 未做边界检查

函数直接访问 data[0]data[1]data[2]data[3] 而未检查 buffer 是否至少有 4 字节。空或截断的图片下载会导致 undefined 比较,静默降级为 'image/jpeg'。虽然不会崩溃,但错误的 MIME 类型可能影响 agent 处理。

建议:添加边界检查:

function detectImageMime(data: Buffer): string {
  if (data.length < 4) return 'image/jpeg';
  if (data[0] === 0x89 && data[1] === 0x50 && data[2] === 0x4e) {
    return 'image/png';
  }
  // ...
}

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — accessing undefined bytes just fails the comparisons and defaults to jpeg. No crash or incorrect behavior.

cleanText = text
.replace(new RegExp(`@${this.botUsername}`, 'gi'), '')
.trim();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

botUsername 未转义直接构造正则表达式

botUsername 为空字符串时(例如 getMe() 返回空值),new RegExp(@${this.botUsername}, 'gi') 会生成 /@/gi,将删除消息中 所有 @ 字符,破坏消息内容。

虽然 Telegram 用户名约束为 [a-zA-Z0-9_] 不含正则元字符,但空值防护仍然必要。

建议:使用 String.replaceAll 或添加空值守卫:

if (isMentioned && this.botUsername) {
  cleanText = text.replaceAll(`@${this.botUsername}`, '').trim();
}

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — already guarded by if (isMentioned && this.botUsername) on line 229. Empty botUsername never reaches the regex.

import { TypingStatus } from './types.js';

/** In-memory typing ticket cache: userId -> typingTicket */
const typingTickets = new Map<string, string>();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

模块级单例 Map 在多实例场景下交叉污染

typingTicketscontextTokens(在 monitor.ts 中)是模块作用域的 Map。如果 startAll() 模式下创建了多个 WeChat channel(不同账号),它们会共享同一个 Map,导致不同实例之间的状态交叉污染。

此外这些 Map 在 disconnect() 时不会被清理,长期运行会导致内存持续增长。

建议:将 typingTicketscontextTokens 移为 WeixinChannel 的实例属性,在 disconnect() 中清理。

— qwen-code + glm-5.1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred — only matters for multi-account WeChat in startAll(). Single-instance MVP is fine.

- fix: sanitize remote filenames with basename() and isolate uploads
  in UUID subdirs to prevent path traversal and collision (#2-4, #27)
- fix: use crypto.randomInt() for pairing codes instead of Math.random() (#5)
- fix: pass config.sessionScope instead of hardcoded 'user' (#6);
  add per-channel scope overrides via setChannelScope() for startAll (#7)
- fix: removeSession now returns removed session IDs and persists
  when chatId is provided (#8)
- fix: /clear only removes the cleared session from instructedSessions,
  not all sessions (#9)
- fix: DingTalk @mention stripping now removes only the first mention
  instead of all mentions (#10)
- fix: remove dead TELEGRAF_COMMANDS Set and its guard (#13)
- fix: WeChat cursor saved after message processing, not before (#14)
- fix: crash recovery uses time-window counting instead of resettable
  counter to prevent infinite restart loops (#17)
- fix: call channel.disconnect() before exit on crash exhaustion (#18)
@tanzhenxin tanzhenxin added the type/feature-request New feature or enhancement request label Mar 31, 2026
…script

- Add plugin-example to build order in scripts/build.js
- Add prepublishOnly script to auto-build before npm publish

This ensures the plugin-example package is built during the main build process and automatically compiled before publishing to npm.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Replace Telegraf with Grammy as the Telegram Bot framework.

- Replace @telegraf/types with @grammyjs/types in package-lock.json
- Swap telegraf dependency for grammy ^1.41.1 in package.json
- Update TelegramAdapter.ts: Bot instead of Telegraf, .api.* instead
  of .telegram.* calls, .start() instead of .launch(), adjusted event
  subscription syntax (message:text, message:photo, message:document)

Grammy is a more modern and actively maintained Telegram bot framework
for Node.js, improving reliability and reduce legacy dependencies.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Copy link
Copy Markdown
Collaborator

@DennisYu07 DennisYu07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Collaborator

@pomelo-nwu pomelo-nwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tanzhenxin tanzhenxin merged commit b2f0441 into main Apr 1, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.14.0 type/feature-request New feature or enhancement request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants