Skip to content

fix(core): recover from truncated tool calls via multi-turn continuation#3313

Open
wenshao wants to merge 7 commits intomainfrom
fix/truncated-tool-call-recovery-3049
Open

fix(core): recover from truncated tool calls via multi-turn continuation#3313
wenshao wants to merge 7 commits intomainfrom
fix/truncated-tool-call-recovery-3049

Conversation

@wenshao
Copy link
Copy Markdown
Collaborator

@wenshao wenshao commented Apr 16, 2026

Summary

Fixes #3049 — WriteFile/ReadFile tool calls fail with params must have required property 'file_path' when model output is truncated due to max_tokens limit.

Root cause

When the model generates a large tool call (e.g., WriteFile with a big HTML file), the response can exceed the output token limit. The adaptive escalation (#2898) retries at 64K, but:

  1. For models with output limits > 64K (Opus 128K, GPT-5 128K), the fixed 64K cap wastes available capacity
  2. If the response is still too large even after escalation, the tool call parameters are incomplete (e.g., file_path missing) and the user sees a confusing validation error

Recovery flow / 恢复流程

Request (max_tokens = 8K)
│
▼
┌─────────────────────────┐
│  Response truncated?     │──── No ──▶ Done ✓
│  (MAX_TOKENS)            │
└───────────┬──────────────┘
            │ Yes
            ▼
┌──────────────────────────────────────────────────┐
│  Layer 1: Escalate to model output limit         │
│  第一层:提升到模型实际输出上限                      │
│  ┌────────────────────────────────────────────┐  │
│  │ Pop partial response from history          │  │
│  │ RETRY (isContinuation: false → reset UI)   │  │
│  │ Re-send at max(64K, model output limit)    │  │
│  └────────────────────────────────────────────┘  │
└───────────┬──────────────────────────────────────┘
            │
            ▼
┌─────────────────────────┐
│  Still truncated?        │──── No ──▶ Done ✓
│  (MAX_TOKENS)            │
└───────────┬──────────────┘
            │ Yes
            ▼
┌──────────────────────────────────────────────────┐
│  Layer 2: Multi-turn recovery (up to 3×)         │
│  第二层:多轮续写恢复(最多 3 次)                    │
│  ┌────────────────────────────────────────────┐  │
│  │ Keep partial response in history           │  │
│  │ Push user message: "Resume directly..."    │  │
│  │ RETRY (isContinuation: true → keep UI buf) │  │
│  │ Re-send with updated history               │  │
│  │ Model continues from where it left off     │  │
│  └──────────────┬─────────────────────────────┘  │
│                 │                                 │
│          ┌──────┴──────┐                          │
│          │ Succeeded?  │── Yes ──▶ Done ✓         │
│          └──────┬──────┘                          │
│                 │ No (still truncated)            │
│                 ▼                                 │
│          attempt < 3? ── Yes ──▶ loop back ↑      │
└───────────┬──────────────────────────────────────┘
            │ No (exhausted)
            ▼
┌──────────────────────────────────────────────────┐
│  Layer 3: Tool scheduler fallback                │
│  第三层:工具调度器兜底                               │
│  ┌────────────────────────────────────────────┐  │
│  │ Reject truncated Edit/Write tool calls     │  │
│  │ Return guidance: "You MUST split into      │  │
│  │ smaller parts — write skeleton first,      │  │
│  │ then edit incrementally."                  │  │
│  └────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────┘

Changes / 改动详情

1. Escalate to the model's actual output limit / 提升到模型实际输出上限

Instead of a fixed 64K escalation target, use Math.max(ESCALATED_MAX_TOKENS, tokenLimit(model, 'output')).

不再固定提升到 64K,而是取 64K 与模型实际输出上限的较大值:

Model Before After
Claude Opus 4.6 64,000 131,072
GPT-5 / o-series 64,000 131,072
Qwen3.x 64,000 65,536
Unknown models 64,000 64,000 (floor)

2. Multi-turn recovery after escalation / 提升后多轮续写恢复

When the escalated response is still truncated (finishReason === MAX_TOKENS), instead of immediately failing with a tool validation error:

当提升后响应仍然被截断时,不再直接报错,而是:

  1. Keep the partial model response in history / 保留部分模型响应在历史中
  2. Inject a recovery user message: "Output token limit hit. Resume directly — no recap. Pick up mid-thought. Break remaining work into smaller pieces." / 注入恢复消息,指示模型从断点续写
  3. Re-send the request so the model continues from where it left off / 重新发送请求让模型继续
  4. Repeat up to 3 times / 最多重复 3 次

The recovery RETRY uses isContinuation: true so the UI preserves the text buffer (appending continuation text) rather than resetting it (as done for escalation).

恢复 RETRY 使用 isContinuation: true,UI 保留文本缓冲区(追加续写内容),而非像提升重试那样重置。

If a recovery attempt fails (e.g., empty response, network error), the catch block pops the dangling recovery message to keep history valid, then exits the loop gracefully.

如果恢复尝试失败(空响应、网络错误等),catch 会弹出悬空的恢复消息以保持历史有效,然后优雅退出循环。

3. Stronger truncation guidance (fallback) / 加强截断引导(兜底)

If recovery is exhausted, the tool scheduler's existing truncation rejection now uses more directive language:

恢复耗尽后,工具调度器的截断拒绝消息改用更明确的指令:

  • "you MUST split" instead of "consider splitting" / "必须拆分"替代"建议拆分"
  • "Do NOT retry with the same large content" / "不要用同样的大内容重试"
  • Concrete instructions: "first write_file with skeleton, then edit incrementally" / 具体步骤:先写骨架,再用 edit 逐步补充

Bug fixes / 附带修复

  • Duplicate tool execution on RETRY / RETRY 时工具重复执行: toolCallRequests in useGeminiStream.ts was never cleared on Retry events, causing tool calls from a truncated attempt to persist alongside the retried attempt's calls. Now cleared on every RETRY. / toolCallRequests 在 Retry 事件时从未清空,导致截断尝试的工具调用与重试的调用并存。现已在每次 RETRY 时清空。
  • Text duplication on escalation / 提升时文本重复: geminiMessageBuffer was not reset on escalation RETRY, causing the 8K partial text to be concatenated with the full escalated response. Now reset when isContinuation is false. / 提升 RETRY 时 geminiMessageBuffer 未重置,导致 8K 部分文本与完整提升响应拼接。现在当 isContinuation 为 false 时重置。

Test plan / 测试计划

  • 194 core tests pass (coreToolScheduler, geminiChat, turn, client) / 194 个核心测试通过
  • 74 useGeminiStream UI tests pass / 74 个 UI 测试通过
  • TypeScript type check passes for core and cli / TypeScript 类型检查通过
  • Manual: ask model to write a large HTML file (500+ lines with embedded CSS/JS), verify no truncation error / 手动测试:让模型写大型 HTML 文件,验证无截断错误
  • Manual: verify recovery triggers on a model with low output limit, model continues correctly / 手动测试:低输出上限模型触发恢复,验证模型正确续写

…ion (#3049)

When large tool calls (e.g., WriteFile with big HTML) exceed the output
token limit, the model's response gets truncated and required parameters
like file_path are missing. Previously this surfaced as a confusing
"params must have required property" error.

Three-layer defense:

1. Escalate to model's actual output limit (not fixed 64K). Models with
   128K output (Claude Opus, GPT-5) now use their full capacity.

2. Multi-turn recovery: if the escalated response is still truncated,
   keep the partial response in history and inject a recovery message
   ("Resume directly — pick up mid-thought") so the model continues
   from where it left off. Up to 3 recovery attempts before falling
   back to the tool scheduler's guidance.

3. Stronger truncation guidance as fallback: "you MUST split" instead
   of "consider splitting".

Also fixes:
- Clear toolCallRequests on RETRY to prevent duplicate tool execution
- Add isContinuation flag to RETRY events so the UI preserves text
  buffers during recovery (continuation) but resets them during
  escalation (fresh restart)
- Catch errors during recovery to prevent dangling history entries
@github-actions
Copy link
Copy Markdown
Contributor

📋 Review Summary

This PR implements a robust three-layer defense against output token truncation when model responses exceed token limits, addressing issue #3049. The implementation is well-structured, follows existing patterns, and includes thoughtful error handling. The changes are focused and demonstrate good understanding of the streaming architecture.

🔍 General Feedback

  • Strong architectural approach: The three-layer strategy (escalation → multi-turn recovery → stronger guidance) is well-designed and mirrors industry best practices (Claude Code's recovery strategy)
  • Good separation of concerns: Core logic stays in geminiChat.ts, UI concerns in useGeminiStream.ts, and messaging in coreToolScheduler.ts
  • Thoughtful flag design: The isContinuation flag elegantly distinguishes between escalation (fresh restart) and recovery (continuation) scenarios
  • Comprehensive test coverage mentioned: 194 core tests + 74 UI tests passing is excellent
  • Type safety maintained: New isContinuation flag properly threaded through type definitions

🎯 Specific Feedback

🟡 High

  1. File: packages/core/src/core/geminiChat.ts:568-625 - The recovery loop lacks a delay between attempts. When the model returns truncated output, immediately retrying without any backoff could hit rate limits or overwhelm the API. Consider adding a small exponential backoff between recovery attempts:
// Before the recovery attempt, add:
if (recoveryCount > 0) {
  const delayMs = Math.min(1000 * recoveryCount, 3000); // Cap at 3s
  await new Promise(resolve => setTimeout(resolve, delayMs));
}
  1. File: packages/core/src/core/geminiChat.ts:580 - The recovery message injection doesn't check if the history already has a user message at the end. If a previous recovery attempt failed and left a dangling user message, this could create duplicate user messages in sequence:
// Add guard before pushing recovery message:
if (
  self.history.length === 0 ||
  self.history[self.history.length - 1].role !== 'user'
) {
  self.history.push(createUserContent([{ text: OUTPUT_RECOVERY_MESSAGE }]));
}

🟢 Medium

  1. File: packages/core/src/core/geminiChat.ts:26-26 - The import now includes tokenLimit function but it's only used once in the escalation logic. Consider whether this should be memoized or cached if called frequently, though for a single call per escalation this is likely fine.

  2. File: packages/core/src/core/geminiChat.ts:540 - The escalatedFinishReason variable is declared with let but could be undefined initially. Consider initializing it explicitly for clarity:

let escalatedFinishReason: string | undefined = undefined;
  1. File: packages/cli/src/ui/hooks/useGeminiStream.ts:1151-1158 - The comment explains the logic well, but the conditional buffer reset based on isContinuation could benefit from a guard to ensure toolCallRequests exists before clearing:
// Current code is fine since toolCallRequests is declared in scope,
// but adding a defensive check wouldn't hurt:
if (toolCallRequests && toolCallRequests.length > 0) {
  toolCallRequests.length = 0;
}

🔵 Low

  1. File: packages/core/src/core/geminiChat.ts:97 - The OUTPUT_RECOVERY_MESSAGE constant is quite prescriptive ("Resume directly — no apology, no recap"). This is good guidance, but consider making it configurable via Config for enterprise users who might want to customize the tone.

  2. File: packages/core/src/core/coreToolScheduler.ts:72-83 - The updated truncation messages are much clearer with the "MUST split" language. Consider adding a link to documentation or an example of how to split content, though this assumes the model has been trained on this pattern.

  3. File: packages/core/src/core/turn.ts:71-73 - The isContinuation JSDoc comment is excellent. Consider adding the same level of documentation to the StreamEvent type definition in geminiChat.ts:56-58 for consistency.

  4. File: packages/core/src/core/geminiChat.ts:600 - The error handling for failed recovery attempts is good, but the debug log uses warn level. Consider whether this should be info since a failed recovery attempt that gracefully exits is expected behavior, not a warning condition.

✅ Highlights

  • Excellent multi-turn recovery design: The approach of keeping partial responses in history and injecting a recovery message is sophisticated and mirrors how Claude Code handles this scenario
  • Smart token escalation: Using Math.max(ESCALATED_MAX_TOKENS, tokenLimit(model, 'output')) ensures models with higher limits (128K) are fully utilized while maintaining a 64K floor for unknown models
  • Proactive bug fix: Clearing toolCallRequests on RETRY events fixes a latent bug that could cause duplicate tool execution - great catch
  • Thoughtful UX consideration: The isContinuation flag ensures the UI preserves text buffers during recovery (continuation) but resets them during escalation (fresh restart)
  • Robust error handling: The recovery loop catches errors during recovery attempts to prevent dangling history entries, with proper cleanup of the recovery message
  • Well-documented constants: MAX_OUTPUT_RECOVERY_ATTEMPTS = 3 and OUTPUT_RECOVERY_MESSAGE are clearly documented with their purpose

wenshao added 2 commits April 16, 2026 10:42
…hanism

Update the design doc to reflect:
- Escalation now targets model's actual output limit (64K floor)
- Multi-turn recovery loop after escalation (up to 3 attempts)
- isContinuation flag on RETRY events
- Recovery error handling (pop dangling message, break)
- Updated constants table and model-specific escalation limits
- New design decision: why multi-turn recovery over progressive escalation
@wenshao wenshao requested a review from tanzhenxin April 16, 2026 02:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Code Coverage Summary

Package Lines Statements Functions Branches
CLI 54.66% 54.66% 68.36% 79.4%
Core 74.51% 74.51% 77.48% 81.21%
CLI Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   54.66 |     79.4 |   68.36 |   54.66 |                   
 src               |   64.72 |    65.38 |   66.66 |   64.72 |                   
  gemini.tsx       |   60.85 |    62.06 |      75 |   60.85 | ...35,543-546,554 
  ...ractiveCli.ts |   54.75 |    59.37 |    37.5 |   54.75 | ...62-670,674-675 
  ...liCommands.ts |   83.84 |    69.76 |     100 |   83.84 | ...14,249,251,379 
  ...ActiveAuth.ts |     100 |    88.23 |     100 |     100 | 66,80             
 ...cp-integration |   14.12 |       80 |      40 |   14.12 |                   
  acpAgent.ts      |   12.65 |    83.33 |      60 |   12.65 | ...64-169,172-712 
  authMethods.ts   |   12.19 |      100 |       0 |   12.19 | 11-31,34-38,41-50 
  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 |    63.7 |    65.46 |   73.07 |    63.7 |                   
  ...ryReplayer.ts |   70.98 |    77.14 |      90 |   70.98 | ...38-239,247-248 
  Session.ts       |   56.89 |    59.42 |      60 |   56.89 | ...1887,1893-1896 
  ...entTracker.ts |   90.85 |    84.84 |      90 |   90.85 | ...35,199,251-260 
  index.ts         |       0 |        0 |       0 |       0 | 1-40              
  ...ssionUtils.ts |   84.21 |    77.77 |     100 |   84.21 | ...37-153,209-211 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...ssion/emitters |   91.53 |    89.47 |   88.46 |   91.53 |                   
  BaseEmitter.ts   |   76.92 |    66.66 |      80 |   76.92 | 23-24,39-40,55-56 
  ...ageEmitter.ts |   82.22 |    83.33 |   83.33 |   82.22 | 29-44             
  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              
 ...ession/rewrite |   88.03 |    85.13 |   94.11 |   88.03 |                   
  LlmRewriter.ts   |   80.53 |    79.31 |     100 |   80.53 | ...17-119,170-174 
  ...Middleware.ts |   91.39 |    83.33 |     100 |   91.39 | ...23-125,141-144 
  TurnBuffer.ts    |     100 |      100 |     100 |     100 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 src/commands      |   66.22 |      100 |    12.5 |   66.22 |                   
  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.73 |      100 |      50 |   94.73 | 28                
 src/commands/auth |   42.15 |    95.83 |      60 |   42.15 |                   
  handler.ts       |   27.29 |    94.44 |   14.28 |   27.29 | 55-406            
  ...veSelector.ts |     100 |    96.66 |     100 |     100 | 58                
 ...mmands/channel |   26.76 |    93.75 |   26.47 |   26.76 |                   
  ...l-registry.ts |    8.57 |      100 |       0 |    8.57 | 6-21,24-42        
  config-utils.ts  |   91.89 |      100 |   66.66 |   91.89 | 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.2 |      100 |       0 |     5.2 | ...61-464,466-474 
  status.ts        |   17.54 |      100 |       0 |   17.54 | 15-26,32-77       
  stop.ts          |      20 |      100 |       0 |      20 | 14-48             
 ...nds/extensions |   84.53 |    88.95 |   81.81 |   84.53 |                   
  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       |    75.6 |    66.66 |   66.66 |    75.6 | ...39-142,145-153 
  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  |   91.28 |    82.97 |   88.88 |   91.28 |                   
  add.ts           |     100 |    96.66 |     100 |     100 | 213               
  list.ts          |   91.22 |    80.76 |      80 |   91.22 | ...19-121,146-147 
  reconnect.ts     |   76.72 |    71.42 |   85.71 |   76.72 | 35-48,153-175     
  remove.ts        |     100 |       80 |     100 |     100 | 21-25             
 src/config        |   91.48 |    81.23 |    85.5 |   91.48 |                   
  auth.ts          |   87.87 |    81.35 |     100 |   87.87 | ...20-221,237-238 
  config.ts        |   87.29 |    81.45 |   72.22 |   87.29 | ...1159,1181-1182 
  keyBindings.ts   |   95.95 |       50 |     100 |   95.95 | 160-163           
  ...idersScope.ts |      92 |       90 |     100 |      92 | 11-12             
  sandboxConfig.ts |    58.9 |    61.53 |   66.66 |    58.9 | ...54-68,73,77-89 
  settings.ts      |   83.13 |    82.55 |   85.71 |   83.13 | ...35-936,941-944 
  ...ingsSchema.ts |     100 |      100 |     100 |     100 |                   
  ...tedFolders.ts |   96.29 |       94 |     100 |   96.29 | ...88-190,205-206 
  webSearch.ts     |   41.37 |       25 |     100 |   41.37 | ...4,88-95,98-114 
 ...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.66 |    94.11 |   66.66 |   93.66 |                   
  ...dardApiKey.ts |     100 |      100 |     100 |     100 |                   
  codingPlan.ts    |   93.43 |    94.11 |   66.66 |   93.43 | ...26-327,335-347 
 src/core          |     100 |      100 |     100 |     100 |                   
  auth.ts          |     100 |      100 |     100 |     100 |                   
  initializer.ts   |     100 |      100 |     100 |     100 |                   
  theme.ts         |     100 |      100 |     100 |     100 |                   
 src/generated     |     100 |      100 |     100 |     100 |                   
  git-commit.ts    |     100 |      100 |     100 |     100 |                   
 src/i18n          |   45.08 |    76.19 |   38.88 |   45.08 |                   
  index.ts         |   26.11 |    76.92 |   26.66 |   26.11 | ...35-236,246-257 
  languages.ts     |   98.43 |       75 |     100 |   98.43 | 95                
 src/i18n/locales  |       0 |        0 |       0 |       0 |                   
  de.js            |       0 |        0 |       0 |       0 | 1-2057            
  en.js            |       0 |        0 |       0 |       0 | 1-2094            
  fr.js            |       0 |        0 |       0 |       0 | 1-2095            
  ja.js            |       0 |        0 |       0 |       0 | 1-1547            
  pt.js            |       0 |        0 |       0 |       0 | 1-2048            
  ru.js            |       0 |        0 |       0 |       0 | 1-2053            
  zh.js            |       0 |        0 |       0 |       0 | 1-1897            
 ...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 | ...80-581,584-585 
 ...active/control |   77.55 |    88.23 |      80 |   77.55 |                   
  ...rolContext.ts |    7.69 |        0 |       0 |    7.69 | 47-79             
  ...Dispatcher.ts |   91.66 |    91.83 |   88.88 |   91.66 | ...54-372,388,391 
  ...rolService.ts |       8 |        0 |       0 |       8 | 46-179            
 ...ol/controllers |    7.07 |       80 |   13.33 |    7.07 |                   
  ...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.27 |      100 |       0 |    5.27 | ...21-433,442-467 
 .../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.82 |    86.89 |   96.29 |   88.82 |                   
  ...mandLoader.ts |     100 |    91.66 |     100 |     100 | 82                
  ...killLoader.ts |     100 |    95.65 |     100 |     100 | 39                
  ...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/services/tips |   92.38 |    84.12 |     100 |   92.38 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  tipHistory.ts    |    78.3 |    71.42 |     100 |    78.3 | ...33-148,151,160 
  tipRegistry.ts   |     100 |    95.23 |     100 |     100 | 33                
  tipScheduler.ts  |     100 |    91.66 |     100 |     100 | 55                
 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            |   63.27 |    66.35 |   51.35 |   63.27 |                   
  App.tsx          |     100 |      100 |     100 |     100 |                   
  AppContainer.tsx |   66.51 |    59.03 |   71.42 |   66.51 | ...1587,1603-1736 
  ...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.61 |       50 |   26.08 |   29.61 |                   
  AuthDialog.tsx   |   51.82 |    51.16 |   28.57 |   51.82 | ...73,692,694,696 
  ...nProgress.tsx |       0 |        0 |       0 |       0 | 1-64              
  useAuth.ts       |    2.47 |      100 |       0 |    2.47 | 48-612            
 src/ui/commands   |   55.99 |    77.56 |   49.71 |   55.99 |                   
  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 |    82.14 |     100 |     100 | 21,64-68,183,197  
  bugCommand.ts    |   76.47 |    66.66 |      50 |   76.47 | 21-22,58-67       
  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 |    6.82 |      100 |       0 |    6.82 | ...59-360,364-365 
  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             
  dreamCommand.ts  |   27.02 |      100 |       0 |   27.02 | 19-20,23-50       
  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 
  forgetCommand.ts |   21.95 |      100 |       0 |   21.95 | 14-15,18-51       
  helpCommand.ts   |     100 |      100 |     100 |     100 |                   
  hooksCommand.ts  |   17.93 |    33.33 |      20 |   17.93 | ...85-186,202-203 
  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 |    92.3 |    66.66 |      50 |    92.3 | 14-15             
  modelCommand.ts  |   55.81 |    81.81 |   66.66 |   55.81 | 25-36,54-83       
  ...onsCommand.ts |     100 |      100 |     100 |     100 |                   
  planCommand.ts   |   76.19 |       75 |      50 |   76.19 | ...34,50-55,67-72 
  quitCommand.ts   |   93.75 |      100 |      50 |   93.75 | 15-16             
  ...berCommand.ts |   27.02 |      100 |       0 |   27.02 | 19-20,23-57       
  ...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 
  ...ineCommand.ts |     100 |      100 |     100 |     100 |                   
  ...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.51 |    73.77 |   63.43 |   62.51 |                   
  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 |   14.63 |      100 |       0 |   14.63 | 18-56             
  ...TextInput.tsx |   63.92 |    73.17 |      50 |   63.92 | ...12,226-228,246 
  Composer.tsx     |   89.69 |    58.33 |      50 |   89.69 | ...-55,73,110,123 
  ...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.68 |      100 |       0 |   12.68 | 55-387            
  ...ngsDialog.tsx |    8.44 |      100 |       0 |    8.44 | 37-195            
  ExitWarning.tsx  |     100 |      100 |     100 |     100 |                   
  ...ustDialog.tsx |     100 |      100 |     100 |     100 |                   
  Footer.tsx       |   79.38 |    59.37 |     100 |   79.38 | ...11-115,117-121 
  ...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.74 |    68.75 |     100 |   98.74 | 74,129            
  ...emDisplay.tsx |   62.37 |     37.2 |     100 |   62.37 | ...63,266-275,278 
  ...ngeDialog.tsx |     100 |      100 |     100 |     100 |                   
  InputPrompt.tsx  |   84.49 |     79.1 |     100 |   84.49 | ...1165,1230,1279 
  ...Shortcuts.tsx |   20.87 |      100 |       0 |   20.87 | ...6,49-51,67-125 
  ...Indicator.tsx |     100 |      100 |     100 |     100 |                   
  ...firmation.tsx |   91.42 |      100 |      50 |   91.42 | 26-31             
  MainContent.tsx  |   15.23 |      100 |       0 |   15.23 | 28-133            
  MemoryDialog.tsx |   53.35 |    51.21 |   57.14 |   53.35 | ...55,367,380-382 
  ...geDisplay.tsx |       0 |        0 |       0 |       0 | 1-41              
  ModelDialog.tsx  |   76.59 |    54.54 |     100 |   76.59 | ...60-476,533-537 
  ...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.88 |    73.37 |     100 |   66.88 | ...11-819,825-826 
  ...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 |   57.14 |      100 |       0 |   57.14 | 12-15             
  ...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         |   21.87 |      100 |       0 |   21.87 | 22-40,43-53       
  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 |   72.24 |    70.52 |      80 |   72.24 |                   
  ...etailStep.tsx |   96.52 |       75 |     100 |   96.52 | 33,37,50,59       
  ...etailStep.tsx |   93.27 |    73.68 |     100 |   93.27 | 41-42,99-104,110  
  ...abledStep.tsx |     100 |      100 |     100 |     100 |                   
  ...sListStep.tsx |     100 |      100 |     100 |     100 |                   
  ...entDialog.tsx |   36.09 |    47.05 |      50 |   36.09 | ...49,453-466,470 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-13              
  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 |   71.72 |    72.93 |   59.25 |   71.72 |                   
  ...ionDialog.tsx |   64.44 |    69.69 |   42.85 |   64.44 | ...20,538,556-558 
  BtwMessage.tsx   |     100 |      100 |     100 |     100 |                   
  ...upDisplay.tsx |   10.97 |      100 |       0 |   10.97 | 22-47,52-114      
  ...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             
  ...edMessage.tsx |   16.66 |      100 |       0 |   16.66 | 22-38             
  ...sMessages.tsx |   63.85 |       40 |   33.33 |   63.85 | ...06-116,120-125 
  ...ryMessage.tsx |   12.82 |      100 |       0 |   12.82 | 22-59             
  ...onMessage.tsx |   73.55 |    55.81 |   33.33 |   73.55 | ...41-443,450-452 
  ...upMessage.tsx |   72.52 |    64.28 |     100 |   72.52 | ...32-247,261-262 
  ToolMessage.tsx  |   82.37 |     72.6 |   88.88 |   82.37 | ...20-425,452-454 
 ...ponents/shared |   80.96 |    76.14 |   92.42 |   80.96 |                   
  ...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    |   67.92 |    48.14 |      75 |   67.92 | ...90-194,206-212 
  ...Indicator.tsx |     100 |     87.5 |     100 |     100 | 30                
  text-buffer.ts   |   82.82 |    75.96 |   97.56 |   82.82 | ...2282,2309,2377 
  ...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.39 |      100 |       0 |    8.39 |                   
  ...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 |   13.72 |      100 |       0 |   13.72 | 18-73             
  ...gerDialog.tsx |    6.74 |      100 |       0 |    6.74 | 35-341            
 ...agents/runtime |    7.51 |      100 |       0 |    7.51 |                   
  ...onDisplay.tsx |    7.51 |      100 |       0 |    7.51 | ...96-526,535-573 
 ...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.14 |    79.77 |   88.63 |   76.14 |                   
  ...ewContext.tsx |   65.77 |      100 |      75 |   65.77 | ...22-225,231-241 
  AppContext.tsx   |      40 |      100 |       0 |      40 | 17-22             
  ...deContext.tsx |     100 |      100 |     100 |     100 |                   
  ...igContext.tsx |   81.81 |       50 |     100 |   81.81 | 15-16             
  ...ssContext.tsx |   82.93 |    82.67 |     100 |   82.93 | ...1123,1129-1131 
  ...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 | 116-117           
  ...teContext.tsx |   85.71 |       50 |     100 |   85.71 | 158-159           
  ...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      |   80.84 |    81.46 |   83.95 |   80.84 |                   
  ...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.8 |    70.58 |     100 |    94.8 | ...76-277,282-283 
  ...dProcessor.ts |   76.26 |    59.09 |   66.66 |   76.26 | ...94,718,737-741 
  ...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 |    94.73 |     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.84 |    80.55 |     100 |   94.84 | ...01-202,204-205 
  ...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 
  ...extualTips.ts |   76.92 |       50 |     100 |   76.92 | 55,68,71-75,88-96 
  ...ialogClose.ts |      20 |      100 |     100 |      20 | 71-118            
  ...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 |                   
  ...ggestions.tsx |   89.15 |     64.7 |     100 |   89.15 | ...22-124,149-150 
  ...miniStream.ts |   75.03 |    73.95 |   83.33 |   75.03 | ...1929,1942-1950 
  ...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             
  ...moryDialog.ts |    87.5 |      100 |     100 |    87.5 | 19,23             
  ...oryMonitor.ts |     100 |      100 |     100 |     100 |                   
  ...ssageQueue.ts |   92.42 |      100 |     100 |   92.42 | 79-83             
  ...delCommand.ts |     100 |       75 |     100 |     100 | 22                
  ...raseCycler.ts |   84.48 |    76.47 |     100 |   84.48 | ...47,50-51,67-69 
  useQwenAuth.ts   |     100 |      100 |     100 |     100 |                   
  ...lScheduler.ts |    84.4 |    93.33 |     100 |    84.4 | ...27-232,326-336 
  ...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 |   78.99 |    81.48 |   94.11 |   78.99 | ...77-579,587-624 
  ...tateAndRef.ts |     100 |      100 |     100 |     100 |                   
  useStatusLine.ts |     100 |    98.48 |     100 |     100 | 242               
  ...eateDialog.ts |   88.23 |      100 |     100 |   88.23 | 14,18             
  ...rminalSize.ts |   76.19 |      100 |      50 |   76.19 | 21-25             
  ...emeCommand.ts |   66.66 |    31.25 |     100 |   66.66 | ...09-110,114-115 
  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 |   87.36 |     90.9 |     100 |   87.36 | ...,94-96,114-115 
  vim.ts           |   83.77 |    80.31 |     100 |   83.77 | ...55,759-767,776 
 src/ui/layouts    |   73.83 |    38.46 |     100 |   73.83 |                   
  ...AppLayout.tsx |   76.47 |       40 |     100 |   76.47 | 38-40,46-53,73-78 
  ...AppLayout.tsx |   69.23 |    33.33 |     100 |   69.23 | 30-35,39-44       
 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.38 |     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.36 |     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      |   72.81 |    84.06 |      81 |   72.81 |                   
  ...Colorizer.tsx |   82.78 |    88.23 |     100 |   82.78 | ...10-111,197-223 
  ...nRenderer.tsx |   52.41 |    36.36 |      50 |   52.41 | ...49-151,171-180 
  ...wnDisplay.tsx |   86.79 |    88.88 |     100 |   86.79 | ...06-315,348-373 
  ...eRenderer.tsx |   94.45 |    81.25 |   94.11 |   94.45 | ...65,477,480-483 
  ...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     
  ...ToolGroups.ts |   98.05 |    95.12 |     100 |   98.05 | 44-45             
  ...mConstants.ts |     100 |      100 |     100 |     100 |                   
  ...storyUtils.ts |   57.65 |    66.66 |      90 |   57.65 | ...56,404,409-431 
  ...ickerUtils.ts |     100 |      100 |     100 |     100 |                   
  terminalSetup.ts |    4.37 |      100 |       0 |    4.37 | 44-393            
  textUtils.ts     |   96.36 |    93.84 |   88.88 |   96.36 | ...49-150,285-286 
  updateCheck.ts   |     100 |    80.95 |     100 |     100 | 30-42             
 ...i/utils/export |    2.36 |        0 |       0 |    2.36 |                   
  collect.ts       |    0.87 |        0 |       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         |    70.9 |    89.89 |   94.19 |    70.9 |                   
  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   |   85.29 |    89.47 |     100 |   85.29 | 48-57             
  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 |   90.76 |    93.33 |   88.88 |   90.76 | 103-114           
  ...lationInfo.ts |     100 |      100 |     100 |     100 |                   
  languageUtils.ts |   97.89 |    96.42 |     100 |   97.89 | 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 |                   
  ...upProfiler.ts |     100 |       96 |     100 |     100 | 110               
  ...upWarnings.ts |     100 |      100 |     100 |     100 |                   
  stdioHelpers.ts  |     100 |       60 |     100 |     100 | 23,32             
  systemInfo.ts    |      99 |     90.9 |     100 |      99 | 172               
  ...InfoFields.ts |   86.91 |    65.78 |     100 |   86.91 | ...16-117,138-139 
  ...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.51 |    81.21 |   77.48 |   74.51 |                   
 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        |    85.8 |    83.72 |    92.3 |    85.8 |                   
  ...ound-tasks.ts |   85.33 |    83.72 |    92.3 |   85.33 | ...25-232,245-246 
  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.12 |    85.79 |   72.22 |   76.12 |                   
  ITermBackend.ts  |   97.97 |    93.93 |     100 |   97.97 | ...78-180,255,307 
  ...essBackend.ts |    91.6 |    89.09 |   81.81 |    91.6 | ...15-235,294,379 
  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 |   79.76 |    74.55 |   70.45 |   79.76 |                   
  agent-core.ts    |   71.31 |    65.67 |   56.52 |   71.31 | ...1026,1053-1099 
  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        |   73.96 |    72.28 |   62.43 |   73.96 |                   
  config.ts        |   71.08 |    68.11 |   56.21 |   71.08 | ...2447,2451-2454 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  models.ts        |     100 |      100 |     100 |     100 |                   
  storage.ts       |   95.72 |    92.85 |   91.66 |   95.72 | ...06-207,241-242 
 ...nfirmation-bus |   98.29 |    97.14 |     100 |   98.29 |                   
  message-bus.ts   |   98.14 |    97.05 |     100 |   98.14 | 42-43             
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/core          |   81.18 |    80.22 |   89.74 |   81.18 |                   
  baseLlmClient.ts |     100 |    96.42 |     100 |     100 | 115               
  client.ts        |   72.17 |    73.77 |   79.16 |   72.17 | ...1112,1138-1154 
  ...tGenerator.ts |    72.1 |    61.11 |     100 |    72.1 | ...42,344,351-354 
  ...lScheduler.ts |   72.43 |    75.87 |    90.9 |   72.43 | ...1797,1854-1858 
  geminiChat.ts    |   89.91 |    85.85 |   90.32 |   89.91 | ...1010,1045-1048 
  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 |   75.51 |    53.84 |     100 |   75.51 | ...81-182,196-205 
  prompts.ts       |    88.8 |    88.05 |      75 |    88.8 | ...-898,1101-1102 
  tokenLimits.ts   |     100 |    89.47 |     100 |     100 | 50-51             
  ...okTriggers.ts |   99.31 |     90.9 |     100 |   99.31 | 124,135           
  turn.ts          |   96.29 |    88.46 |     100 |   96.29 | ...80,393-394,442 
 ...ntentGenerator |   93.72 |    73.43 |    90.9 |   93.72 |                   
  ...tGenerator.ts |   95.99 |    72.17 |   86.66 |   95.99 | ...03-304,438,494 
  converter.ts     |   93.47 |       75 |     100 |   93.47 | ...87-488,498,558 
  index.ts         |       0 |        0 |       0 |       0 | 1-21              
 ...ntentGenerator |   91.53 |    71.21 |   93.33 |   91.53 |                   
  ...tGenerator.ts |      90 |    70.49 |   92.85 |      90 | ...77-283,301-302 
  index.ts         |     100 |       80 |     100 |     100 | 50                
 ...ntentGenerator |   90.76 |    76.63 |      85 |   90.76 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...tGenerator.ts |   90.72 |    76.63 |      85 |   90.72 | ...06,516-517,545 
 ...ntentGenerator |   75.81 |    84.46 |   91.42 |   75.81 |                   
  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      |    94.8 |    89.88 |     100 |    94.8 | ...68,288-289,455 
  ...CallParser.ts |   90.66 |    88.57 |     100 |   90.66 | ...15-319,349-350 
 ...rator/provider |   95.91 |    85.71 |   93.75 |   95.91 |                   
  dashscope.ts     |   97.22 |    87.69 |   93.33 |   97.22 | ...10-211,287-288 
  deepseek.ts      |   90.76 |       75 |     100 |   90.76 | 40-41,45-46,59-60 
  default.ts       |   94.44 |    84.21 |   85.71 |   94.44 | 85-86,150-152     
  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     |   59.98 |    79.65 |   78.22 |   59.98 |                   
  ...-converter.ts |   62.35 |    47.82 |      90 |   62.35 | ...90-791,800-832 
  ...ionManager.ts |   44.67 |    83.59 |   65.11 |   44.67 | ...1335,1356-1375 
  ...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.94 |    88.52 |      60 |   44.94 | ...53-359,398-451 
  index.ts         |     100 |      100 |     100 |     100 |                   
  marketplace.ts   |   97.29 |    93.75 |     100 |   97.29 | ...64,184-185,274 
  npm.ts           |   48.66 |    76.08 |      75 |   48.66 | ...18-420,427-431 
  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/followup      |   46.24 |     92.3 |   71.87 |   46.24 |                   
  followupState.ts |      96 |    89.74 |     100 |      96 | 159-161,218-219   
  index.ts         |     100 |      100 |     100 |     100 |                   
  overlayFs.ts     |   95.06 |       84 |     100 |   95.06 | 78,108,122,133    
  speculation.ts   |   13.22 |      100 |   16.66 |   13.22 | 88-458,518-568    
  ...onToolGate.ts |     100 |    96.29 |     100 |     100 | 93                
  ...nGenerator.ts |   36.67 |    95.12 |   33.33 |   36.67 | ...24-326,361-391 
 src/generated     |       0 |        0 |       0 |       0 |                   
  git-commit.ts    |       0 |        0 |       0 |       0 | 1-10              
 src/hooks         |   80.57 |    84.34 |   84.16 |   80.57 |                   
  ...okRegistry.ts |   86.48 |    77.08 |     100 |   86.48 | ...41-344,362-369 
  ...bortSignal.ts |     100 |      100 |     100 |     100 |                   
  ...terpolator.ts |   96.66 |    93.33 |     100 |   96.66 | 66-67             
  ...HookRunner.ts |   96.68 |    87.23 |     100 |   96.68 | 110-112,231-233   
  ...Aggregator.ts |   96.37 |    90.54 |     100 |   96.37 | ...89,291-292,365 
  ...entHandler.ts |   95.58 |    84.37 |   92.59 |   95.58 | ...29,682-683,693 
  hookPlanner.ts   |   84.13 |    76.59 |      90 |   84.13 | ...38,144,162-173 
  hookRegistry.ts  |   88.83 |    86.36 |     100 |   88.83 | ...21,326,330,334 
  hookRunner.ts    |   53.63 |    72.22 |   61.11 |   53.63 | ...23-724,733-734 
  hookSystem.ts    |   75.47 |      100 |   56.41 |   75.47 | ...75-576,582-583 
  ...HookRunner.ts |   75.51 |     61.9 |      80 |   75.51 | ...05-406,424-425 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...SkillHooks.ts |   78.75 |       75 |   66.66 |   78.75 | 62-66,137-152     
  ...oksManager.ts |    96.5 |     91.8 |     100 |    96.5 | ...90,209-210,223 
  ssrfGuard.ts     |   77.22 |    85.36 |     100 |   77.22 | ...57,261-267,273 
  trustedHooks.ts  |       0 |        0 |       0 |       0 | 1-124             
  types.ts         |   90.15 |    91.02 |   85.18 |   90.15 | ...91-392,452-456 
  urlValidator.ts  |     100 |      100 |     100 |     100 |                   
 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.69 |    75.68 |   75.92 |   78.69 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...h-provider.ts |   86.95 |      100 |   33.33 |   86.95 | ...,93,97,101-102 
  ...h-provider.ts |   73.77 |    54.45 |     100 |   73.77 | ...80-887,894-896 
  ...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/memory        |   61.95 |    74.52 |    65.3 |   61.95 |                   
  const.ts         |     100 |      100 |     100 |     100 |                   
  dream.ts         |   88.07 |    66.66 |      80 |   88.07 | ...23,131,141-147 
  ...entPlanner.ts |    55.2 |       75 |   28.57 |    55.2 | ...30,135-142,147 
  entries.ts       |   59.84 |       70 |      50 |   59.84 | ...72-180,183-189 
  extract.ts       |    95.2 |    79.16 |     100 |    95.2 | 81-86,125         
  ...entPlanner.ts |   63.08 |    65.71 |   41.17 |   63.08 | ...17,222-223,332 
  ...ionPlanner.ts |       0 |        0 |       0 |       0 | 1                 
  forget.ts        |    8.04 |      100 |       0 |    8.04 | 67-342            
  governance.ts    |       0 |        0 |       0 |       0 | 1-352             
  indexer.ts       |   83.87 |    45.45 |     100 |   83.87 | ...50,56-57,69-70 
  manager.ts       |   74.16 |    76.23 |   70.27 |   74.16 | ...77-878,891-893 
  memoryAge.ts     |   80.95 |     87.5 |      75 |   80.95 | 48-51             
  paths.ts         |   55.47 |    88.88 |   85.71 |   55.47 | ...,88-89,105-113 
  prompt.ts        |   93.36 |    71.42 |     100 |   93.36 | ...58,161,228-229 
  recall.ts        |   82.24 |    78.04 |   88.88 |   82.24 | ...71-188,246-257 
  ...ceSelector.ts |   91.56 |    73.68 |     100 |   91.56 | ...01,103-104,112 
  scan.ts          |   87.91 |    68.42 |     100 |   87.91 | ...47-48,58,82-87 
  status.ts        |   10.52 |      100 |       0 |   10.52 | 41-98             
  store.ts         |   94.44 |    83.33 |     100 |   94.44 | 56-57,92-93       
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/mocks         |       0 |        0 |       0 |       0 |                   
  msw.ts           |       0 |        0 |       0 |       0 | 1-9               
 src/models        |   88.03 |    83.86 |   86.95 |   88.03 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...tor-config.ts |   88.67 |     90.9 |     100 |   88.67 | 112,118,121-130   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...nfigErrors.ts |   74.22 |    47.82 |   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 |    81.25 |   81.57 |      83 | ...1168,1197-1198 
  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.54 |       88 |    48.2 |   70.54 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...on-manager.ts |   80.82 |    81.72 |   79.16 |   80.82 | ...56-757,764-773 
  rule-parser.ts   |   95.79 |    94.08 |     100 |   95.79 | ...31-832,976-978 
  ...-semantics.ts |   58.28 |    85.27 |    30.2 |   58.28 | ...1604-1614,1643 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/prompts       |   83.63 |      100 |    87.5 |   83.63 |                   
  mcp-prompts.ts   |   18.18 |      100 |       0 |   18.18 | 11-19             
  ...t-registry.ts |     100 |      100 |     100 |     100 |                   
 src/qwen          |    85.9 |    79.74 |   97.18 |    85.9 |                   
  ...tGenerator.ts |   98.64 |    98.18 |     100 |   98.64 | 105-106           
  qwenOAuth2.ts    |   84.73 |    75.37 |   93.33 |   84.73 | ...8,977-993,1023 
  ...kenManager.ts |   83.79 |    76.22 |     100 |   83.79 | ...63-768,789-794 
 src/services      |   82.19 |    80.96 |   85.43 |   82.19 |                   
  ...ionService.ts |   97.95 |    94.04 |     100 |   97.95 | 255,257-261       
  ...ingService.ts |   61.92 |    48.38 |   70.58 |   61.92 | ...70-482,498-499 
  cronScheduler.ts |   97.56 |    92.98 |     100 |   97.56 | 62-63,77,155      
  ...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    |   68.08 |     92.3 |   55.55 |   68.08 | ...10-120,123-127 
  ...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 |   83.84 |    73.33 |   94.44 |   83.84 | ...53-674,706-707 
  ...ionService.ts |   83.46 |    78.53 |   83.33 |   83.46 | ...1017,1023-1028 
 ...icrocompaction |   98.63 |    86.44 |     100 |   98.63 |                   
  microcompact.ts  |   98.63 |    86.44 |     100 |   98.63 | 139,143           
 src/skills        |   83.87 |    79.89 |   90.32 |   83.87 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  skill-load.ts    |    90.9 |    77.77 |     100 |    90.9 | ...32,152,164-166 
  skill-manager.ts |   81.33 |    78.83 |   88.46 |   81.33 | ...52-860,867-871 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/subagents     |   82.38 |    80.96 |    90.9 |   82.38 |                   
  ...tin-agents.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...-selection.ts |     100 |      100 |     100 |     100 |                   
  ...nt-manager.ts |   75.89 |    73.03 |   86.66 |   75.89 | ...1105,1127-1128 
  types.ts         |     100 |      100 |     100 |     100 |                   
  validation.ts    |   92.43 |    95.18 |     100 |   92.43 | 51-56,69-74,78-83 
 src/telemetry     |   67.49 |    84.07 |   72.46 |   67.49 |                   
  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       |   52.09 |    61.64 |   57.77 |   52.09 | ...1218,1235-1255 
  metrics.ts       |    74.9 |    82.95 |   74.54 |    74.9 | ...58-978,981-992 
  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         |    78.8 |    94.49 |   83.33 |    78.8 | ...1108,1111-1140 
  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    |   93.07 |    95.65 |   73.52 |   93.07 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  ...st-helpers.ts |   94.11 |       90 |     100 |   94.11 | 69-70             
  index.ts         |     100 |      100 |     100 |     100 |                   
  mock-tool.ts     |   91.02 |    96.87 |   68.96 |   91.02 | ...32,196-197,210 
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
 src/tools         |   73.54 |    78.86 |   78.84 |   73.54 |                   
  ...erQuestion.ts |   87.89 |     73.8 |    90.9 |   87.89 | ...44-345,349-350 
  cron-create.ts   |   97.61 |    88.88 |   83.33 |   97.61 | 30-31             
  cron-delete.ts   |   96.55 |      100 |   83.33 |   96.55 | 26-27             
  cron-list.ts     |   96.36 |      100 |   83.33 |   96.36 | 25-26             
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  edit.ts          |   80.72 |    85.05 |   73.33 |   80.72 | ...09-510,593-643 
  exitPlanMode.ts  |   84.61 |    85.71 |     100 |   84.61 | ...60-163,177-189 
  glob.ts          |   90.56 |    88.33 |   84.61 |   90.56 | ...24,167,297,300 
  grep.ts          |   71.24 |    87.34 |   72.22 |   71.24 | ...88,528,536-543 
  ls.ts            |   96.74 |    90.27 |     100 |   96.74 | 171-176,207,211   
  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.52 |    71.05 |   46.87 |   29.52 | ...1427,1431-1434 
  mcp-tool.ts      |   90.92 |    88.88 |   96.42 |   90.92 | ...89-590,640-641 
  ...iable-tool.ts |     100 |    84.61 |     100 |     100 | 102,109           
  read-file.ts     |   92.02 |    86.66 |   88.88 |   92.02 | ...,82-83,153-162 
  ripGrep.ts       |   96.46 |     91.3 |     100 |   96.46 | ...93,296,374-375 
  ...-transport.ts |    6.34 |      100 |       0 |    6.34 | 47-145            
  shell.ts         |   86.14 |    78.12 |    92.3 |   86.14 | ...59-463,669-670 
  skill.ts         |   84.68 |    85.36 |   84.61 |   84.68 | ...59,263,286-308 
  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         |   84.18 |    89.58 |   82.35 |   84.18 | ...25-426,442-448 
  web-fetch.ts     |   86.09 |    60.86 |   91.66 |   86.09 | ...53-254,256-257 
  write-file.ts    |   81.28 |    76.78 |      75 |   81.28 | ...11-414,426-461 
 src/tools/agent   |   79.02 |    82.31 |   84.37 |   79.02 |                   
  agent.ts         |   82.25 |    81.94 |   88.88 |   82.25 | ...1091,1117-1121 
  fork-subagent.ts |   42.02 |      100 |      60 |   42.02 | 54-72,91-128      
 ...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         |   86.12 |    86.89 |   90.15 |   86.12 |                   
  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 |                   
  cronDisplay.ts   |   42.85 |    23.07 |     100 |   42.85 | 26-31,33-45,47-54 
  cronParser.ts    |   89.74 |    85.71 |     100 |   89.74 | ...,63-64,183-186 
  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  |   97.05 |       95 |     100 |   97.05 | 39-40             
  ...rReporting.ts |   88.46 |       90 |     100 |   88.46 | 69-74             
  errors.ts        |   70.92 |    80.39 |   53.33 |   70.92 | ...03-219,223-229 
  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 
  forkedAgent.ts   |   62.98 |    54.54 |      75 |   62.98 | ...23-432,434-447 
  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.9 |     100 |     100 | 26                
  ...lPromptIds.ts |     100 |      100 |     100 |     100 |                   
  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 |     100 |   93.63 | ...96-302,384-385 
  ...Inspectors.ts |   61.53 |      100 |      50 |   61.53 | 18-23             
  ...kerChecker.ts |   82.55 |    78.57 |     100 |   82.55 | 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.36 |     100 |   95.67 | ...,70-71,103-104 
  ...ectSummary.ts |   90.15 |       70 |     100 |   90.15 | ...39-142,193-196 
  ...tIdContext.ts |     100 |      100 |     100 |     100 |                   
  proxyUtils.ts    |     100 |      100 |     100 |     100 |                   
  ...rDetection.ts |   58.57 |       76 |     100 |   58.57 | ...4,88-89,95-100 
  ...noreParser.ts |   85.45 |    85.18 |     100 |   85.45 | ...59,65-66,72-73 
  rateLimit.ts     |   91.48 |    94.11 |     100 |   91.48 | 80,93-95          
  readManyFiles.ts |   85.95 |    85.71 |     100 |   85.95 | ...80-182,198-209 
  retry.ts         |   70.14 |    76.92 |     100 |   70.14 | ...89,207,214-215 
  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 |   93.43 |    76.66 |     100 |   93.43 | ...46,155-158,212 
  ...r-launcher.ts |   76.52 |     87.5 |   66.66 |   76.52 | ...33,135,153-191 
  shell-utils.ts   |    83.6 |    90.63 |     100 |    83.6 | ...1040,1047-1051 
  ...lAstParser.ts |   95.58 |    85.71 |     100 |   95.58 | ...1059-1061,1071 
  ...nlyChecker.ts |   95.75 |    92.47 |     100 |   95.75 | ...00-301,313-314 
  sideQuery.ts     |     100 |    92.85 |     100 |     100 | 43                
  ...tGenerator.ts |     100 |      100 |     100 |     100 |                   
  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 |       92 |     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.34 |    91.66 |     100 |   96.34 |                   
  crawlCache.ts    |     100 |      100 |     100 |     100 |                   
  crawler.ts       |   96.87 |    94.44 |     100 |   96.87 | 83-84             
  fileSearch.ts    |   93.29 |    86.76 |     100 |   93.29 | ...40-241,243-244 
  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.

Copy link
Copy Markdown
Collaborator Author

@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.

[Suggestion] The ACP cron path starts a background rewrite with this.messageRewriter.flushTurn(ac.signal), but unlike the normal prompt path it never waits for pending rewrites before returning. That can drop the final rewritten ACP progress update if the cron turn finishes immediately after scheduling the rewrite. Consider mirroring the normal prompt flow by awaiting this.messageRewriter.waitForPendingRewrites() before #executeCronPrompt() returns.

— gpt-5.4 via Qwen Code /review

@wenshao wenshao added the DDAR DataWorks Data Agent Ready label Apr 16, 2026
@wenshao wenshao requested a review from yiliang114 April 16, 2026 09:07
@tanzhenxin tanzhenxin added the type/bug Something isn't working as expected label Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@tanzhenxin tanzhenxin left a comment

Choose a reason for hiding this comment

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

Review

Adds a well-structured 3-layer recovery for truncated model output. The recovery loop is cleanly bounded by MAX_OUTPUT_RECOVERY_ATTEMPTS, and the two bug fixes (duplicate tool execution on RETRY, text duplication on escalation) are real and correct. However, the continuation path has two correctness bugs.

Issues

  1. Partial text lost from display during continuation. On a continuation RETRY, setPendingHistoryItem(null) clears the partial text. When handleContentEvent runs for the first continuation chunk, it sees a null pending item, creates a new one, and resets geminiMessageBuffer = eventValue — discarding the preserved buffer. The user loses the beginning of the recovered response. Suggestion: commit the partial text to the static item list via addItem before clearing, or don't clear pendingHistoryItemRef.current and let the continuation append to it.

  2. Recovery on truncated tool-call turns corrupts conversation state. If the truncated turn already emitted a complete functionCall, the recovery injects a plain user message — creating model(functionCall) → user(text) with no functionResponse. This is an invalid sequence for the API. Suggestion: skip multi-turn recovery when the truncated turn contains functionCall parts, and let the existing tool scheduler fallback (layer 3) handle those cases.

  3. Recovery errors swallowed after partial chunks emitted. A recovery attempt can yield chunks then fail. The catch block breaks without emitting an error event, leaving the UI with partial text and no failure indication. Suggestion: emit an error or warning event in the catch block.

Verdict

REQUEST_CHANGES — The text loss and conversation state corruption need to be fixed. Test coverage for the new recovery loop is also expected.

@wenshao
Copy link
Copy Markdown
Collaborator Author

wenshao commented Apr 16, 2026

Thanks for the thorough review!

Re High #1 (backoff between recovery attempts): makeApiCallAndProcessStream internally uses retryWithBackoff which already handles HTTP 429 retries with exponential backoff. Each recovery request has different history content (partial response + recovery message), so deduplication/caching is not a concern. Adding an extra delay would increase latency for every recovery attempt without meaningful benefit.

Re High #2 (guard before pushing recovery message): This is already handled by the catch block. If a recovery attempt fails, the catch pops the dangling user message and breaks out of the loop. In the success path, processStreamResponse always pushes a model response to history before control returns to the recovery loop, so the history maintains proper alternating user/model structure before the next recovery message is pushed.

Re Medium #3-5: Acknowledged as style preferences. tokenLimit is called once per escalation (no caching needed), escalatedFinishReason type annotation already implies undefined initial value, and toolCallRequests is a locally-scoped const array that is always defined.

Re Low #6-9: Good suggestions for future iterations. Keeping them out of this PR scope to minimize change surface.

@tanzhenxin
Copy link
Copy Markdown
Collaborator

Hi @wenshao, looks like your earlier response was addressing the github-actions bot review. Could you take a look at the three critical issues I flagged in my review above?

  1. Partial text lost from display during continuation — when setPendingHistoryItem(null) clears the pending item before the continuation chunk arrives, handleContentEvent creates a fresh pending item and resets geminiMessageBuffer = eventValue, so the user loses the beginning of the recovered response. This is a visible regression for the exact scenario the PR targets.

  2. Recovery on truncated tool-call turns produces invalid history — if the truncated turn contains functionCall parts, appending a plain user recovery message yields a model(functionCall) → user(text) sequence with no intervening functionResponse, which the API documents as invalid. The already-emitted tool call is also lost. Gating the recovery path on "no functionCall parts in the truncated turn" would be the cleanest fix.

  3. Recovery errors swallowed after partial chunks emitted — if a recovery attempt yields chunks then fails, the catch block pops the prompt and breaks without emitting an error event, leaving the UI with partial text and no terminal signal.

Happy to discuss if you disagree on any of these — (2) in particular would be good to confirm against real API behavior.

Three correctness fixes from @tanzhenxin's review:

1. Partial text lost during continuation (useGeminiStream.ts):
   On continuation RETRY, setPendingHistoryItem(null) cleared the pending
   gemini item. The next Content event then saw a null pending item,
   created a fresh one, and reset geminiMessageBuffer = eventValue —
   discarding the preserved partial text. Now the pending item AND
   buffers are kept on continuation, so the continuation appends.

2. Recovery on truncated tool-call turns (geminiChat.ts):
   When the truncated turn already contains a complete functionCall,
   appending a user recovery message produces model(functionCall) →
   user(text) with no intervening functionResponse — an invalid API
   sequence. Now recovery skips turns with functionCall parts and
   defers to the tool scheduler's layer-3 fallback.

3. Recovery errors swallowed after partial chunks (geminiChat.ts):
   If a recovery attempt yielded chunks then failed, the catch block
   broke without emitting any terminal signal, leaving the UI with
   partial text and no Finished event. Now emits a synthetic
   finishReason=STOP chunk in the catch so the UI gets a proper
   terminal signal.
@wenshao
Copy link
Copy Markdown
Collaborator Author

wenshao commented Apr 17, 2026

@tanzhenxin You are absolutely right on all three — apologies for conflating your review with the bot review earlier.

Addressed in f683830:

1. Partial text lost during continuation — Kept both pendingHistoryItemRef.current and the buffers on continuation RETRY. handleContentEvent now sees an existing gemini pending item and appends instead of resetting the buffer.

2. Recovery on truncated tool-call turns — Added a guard at the top of the recovery loop: if the last model entry in history contains any functionCall part, break out and defer to the layer-3 tool scheduler fallback. This avoids the invalid model(functionCall) → user(text) sequence and preserves the tool-call path you pointed out was being silently dropped.

3. Recovery errors swallowed after partial chunks — In the catch block, now emit a synthetic chunk with finishReason: STOP before breaking, so turn.ts yields a Finished event and the UI gets a proper terminal signal. The partial chunks from prior successful iterations remain in the transcript as the user-visible response; the failure is logged via debugLogger.warn.

Regarding (2), I verified by tracing the history structure after the guard fires: the truncated model turn with functionCall stays intact, wasOutputTruncated=true is already set on pendingToolCalls by turn.ts, and coreToolScheduler then applies TRUNCATION_EDIT_REJECTION / TRUNCATION_PARAM_GUIDANCE as the fallback. No invalid sequence is written to history.

Will add targeted tests for the recovery loop next.

Four targeted tests for the recovery mechanism introduced in the
truncated-tool-call-recovery PR:

1. Recovery loop fires when escalated response is also truncated:
   initial MAX_TOKENS → escalation MAX_TOKENS → recovery STOP. Verifies
   two RETRY events (one escalation, one continuation) and three API
   calls.

2. Recovery is skipped when truncated turn contains a functionCall:
   prevents the invalid model(functionCall) → user(text) sequence.
   Verifies no continuation RETRY and history ends with the functionCall
   intact.

3. Recovery attempts are capped at MAX_OUTPUT_RECOVERY_ATTEMPTS (3):
   persistent MAX_TOKENS triggers exactly 5 API calls (1 initial + 1
   escalation + 3 recovery).

4. Recovery catch block emits synthetic STOP chunk and pops dangling
   user message: when a recovery attempt fails (empty stream →
   InvalidStreamError), the UI gets a terminal signal and history
   ends on the model turn, not a dangling user recovery message.
@wenshao
Copy link
Copy Markdown
Collaborator Author

wenshao commented Apr 17, 2026

Added 4 targeted recovery-loop tests in b9340c1 covering:

  • Recovery fires when escalation is still truncated — verifies two RETRY events (escalation with isContinuation undefined, continuation with isContinuation: true) and three API calls.
  • Recovery skipped when truncated turn has functionCall — verifies no continuation RETRY, only 2 API calls, and history ends with the functionCall part intact (layer-3 fallback takes over).
  • Recovery capped at 3 attempts — persistent MAX_TOKENS triggers exactly 1 + 1 + 3 = 5 API calls.
  • Recovery catch emits synthetic STOP chunk and pops dangling user message — when a recovery attempt yields no chunks (→ InvalidStreamError), the last emitted chunk has finishReason: STOP and history ends on a model turn.

Total: 198 tests pass (194 existing + 4 new).

wenshao added 2 commits April 17, 2026 18:25
Existing tests cover the functionCall guard when both initial and
escalated responses have functionCall. This adds a test for the
cross-iteration case: iter 1 returns text (recovery proceeds), iter 2
returns functionCall (recovery must break before iter 3).

Verifies:
- API called exactly 4 times (1 initial + 1 escalation + 2 recovery)
- History ends with the functionCall model turn, not a dangling user
  recovery message
- Iter 3's user recovery message is never pushed (guard fires at top
  of loop before recoveryCount increment)
The object literal {candidates, content, parts} doesn't structurally
overlap enough with GenerateContentResponse for TypeScript's strict
narrow cast. Casting through 'unknown' is required per TS2352.

Build error from CI:
  src/core/geminiChat.ts(651,24): error TS2352: Conversion of type '...'
  to type 'GenerateContentResponse' may be a mistake because neither
  type sufficiently overlaps with the other. If this was intentional,
  convert the expression to 'unknown' first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DDAR DataWorks Data Agent Ready type/bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: WriteFile tool fails with missing file_path parameter when creating large HTML files

2 participants