Skip to content

Conversation

@acoliver
Copy link
Collaborator

@acoliver acoliver commented Jan 17, 2026

Summary

  • preserve Anthropic thinking during tool-call turns by inserting redacted thinking placeholders instead of disabling thinking
  • ensure redacted thinking placeholders include non-empty data to satisfy Anthropic API validation
  • cover issue Opus seems to stop thinking after the first few messages #1150 regression cases for missing thinking blocks in history
  • fix diff type usage to satisfy CI lint/typecheck

Testing

  • npm run test
  • npm run lint
  • npm run format
  • npm run typecheck
  • npm run build
  • node scripts/start.js --profile-load synthetic --prompt "write me a haiku" (fails: rate limit 429)

Fixes #1150

… calls

**Root Cause:**
The auto-disable logic was too aggressive - it disabled thinking whenever it found
a tool call without a thinking block in the SAME AI message. During streaming,
thinking blocks and tool calls are often stored as separate IContent items, causing
the auto-disable to incorrectly trigger and permanently disable thinking.

**Changes:**

1. **Improved Auto-Disable Detection (AnthropicProvider.ts lines 936-1008)**
   - Enhanced logic to look back up to 3 previous messages for orphaned thinking blocks
   - Only disables thinking if truly no thinking found anywhere in recent history
   - Added detailed debug logging to track when/why thinking gets disabled

2. **Extended Orphaned Thinking Merging (AnthropicProvider.ts lines 1170-1201)**
   - Increased look-back window from 1 to 3 previous messages
   - Can now find and merge thinking blocks that are several messages away from tool calls
   - Handles non-consecutive AI messages (e.g., separated by tool results)

3. **Comprehensive Test Coverage (AnthropicProvider.thinking.test.ts)**
   - Added 4 new tests for multi-turn thinking persistence
   - Tests verify thinking persists across tool calls in various scenarios
   - Tests confirm auto-disable only triggers when genuinely appropriate

**Result:**
Thinking blocks now persist throughout entire conversations, even with tool calls.
The auto-disable safety mechanism remains in place but only triggers in rare edge
cases where thinking blocks are genuinely missing.

Fixes #1150
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Summary by CodeRabbit

  • New Features

    • Thinking content is now first-class: can be retained in context when enabled, preserves signatures, and yields redacted placeholders when needed.
  • Bug Fixes

    • Improved multi-turn thinking persistence: lookback up to 3 messages, safer merging of orphaned thinking with assistant/tool responses, clearer warnings when signed thinking is absent.
  • Tests

    • Added extensive suites covering streaming/non-streaming, merge/lookback, redaction, and complex tool-call scenarios.
  • Refactor

    • Adjusted diff option typings for consistency.
  • Chore

    • Test prompt clarified to use the run_shell_command tool.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Implements cross-message detection and merging of orphaned thinking blocks with a 3-message lookback, preserves/signs thinking metadata (or inserts redacted_thinking), updates Anthropic provider streaming/non-streaming logic, and adds extensive multi-turn tests and content-conversion support for thinking blocks.

Changes

Cohort / File(s) Summary
Anthropic provider logic
packages/core/src/providers/anthropic/AnthropicProvider.ts
Replace per-message thinking check with cross-message analysis (look back up to 3 prior AI messages); merge orphaned thinking into subsequent assistant/tool messages; preserve/signature metadata; insert redacted_thinking when reasoning requested but signed thinking missing; update streaming and non-streaming paths and logging.
New / expanded tests (Anthropic)
packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts, packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts, packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
Add comprehensive multi-turn test suites covering orphaned thinking merging, lookback behaviors (up to 3 messages), streaming vs non-streaming flows, signature preservation/redaction, stripFromContext interactions, and many edge cases.
Gemini / thinking integration
packages/core/src/core/geminiChat.ts, packages/core/src/core/geminiChat.runtime.test.ts, packages/core/src/services/history/ContentConverters.ts, packages/core/src/services/history/ContentConverters.test.ts, packages/core/src/services/history/IContent.ts, packages/core/src/services/history/HistoryService.test.ts
Introduce ThinkingBlock/ThoughtPart handling across Gemini ↔ IContent conversions and history recording; preserve thought signatures and sourceField; add tests validating conversions and history filtering for invalid/unsigned thinking.
CLI tool response handling
packages/cli/src/ui/hooks/useGeminiStream.ts, packages/cli/src/ui/hooks/useGeminiStream.test.tsx
Filter out functionCall parts when submitting tool responses (only send functionResponse + subsequent text); add tests (duplicate test block observed).
Diff options typing
packages/core/src/tools/diffOptions.ts
Replace some removed type-only imports from 'diff' with local PatchOptions/StructuredPatch types and update exported DEFAULT_* typings (type-level change).
Integration test wording
integration-tests/run_shell_command.test.ts
Minor prompt wording change to explicitly instruct use of the run_shell_command tool.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Client
  participant Provider as AnthropicProvider
  participant History as MessageHistory
  participant AnthropicAPI as Anthropic API

  Note over Provider,History: look back up to 3 prior AI messages for orphaned thinking
  User->>Client: user input (may trigger tool call)
  Client->>Provider: build ProviderCallOptions (contents, settings)
  Provider->>History: inspect recent messages (lookback up to 3 AI messages) for thinking/tool_use/tool_call
  alt orphaned thinking found
    History-->>Provider: return thinking block(s) with signature/sourceField
    Provider->>Provider: merge thinking into assistant/tool_use payload (preserve signature)
  else no signed thinking & reasoning enabled
    Provider->>Provider: insert `redacted_thinking` placeholder
  end
  Provider->>AnthropicAPI: send assembled request (includes thinking/tool_use/redacted_thinking)
  AnthropicAPI-->>Provider: response (streaming or final)
  Provider->>Client: return response / stream
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped back three turns to fetch a stray thought,
I signed it or masked it when signatures were not,
I stitched musings to calls and kept logs tidy and bright,
Now thinking arrives again — I cheered with a bite! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers TLDR (summary) and Testing sections but lacks Dive Deeper and Reviewer Test Plan details. The Testing Matrix is also not completed. Add more detailed reasoning in Dive Deeper section and provide specific reviewer test plan with example prompts and validation steps.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix Anthropic thinking with tool calls' directly summarizes the primary change in the PR: preserving Anthropic thinking during tool-call turns.
Linked Issues check ✅ Passed The PR addresses all core objectives from issue #1150: preserves thinking visibility across tool-call turns, prevents erroneous auto-disable of thinking, correctly merges orphaned thinking blocks, and ensures thinking appears throughout multi-turn conversations.
Out of Scope Changes check ✅ Passed All changes align with fixing thinking preservation during tool calls. Minor adjustments to Gemini stream filtering, diff types, and content converters are closely related to the core fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue1150

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d914933 and 6254d97.

📒 Files selected for processing (12)
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
  • packages/cli/src/ui/hooks/useGeminiStream.ts
  • packages/core/src/core/geminiChat.runtime.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/services/history/ContentConverters.test.ts
  • packages/core/src/services/history/ContentConverters.ts
  • packages/core/src/services/history/HistoryService.test.ts
  • packages/core/src/services/history/IContent.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.
📚 Learning: 2026-01-13T19:28:00.789Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.

Applied to files:

  • packages/core/src/services/history/HistoryService.test.ts
  • packages/core/src/services/history/ContentConverters.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/services/history/ContentConverters.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
📚 Learning: 2025-11-16T22:51:26.374Z
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.

Applied to files:

  • packages/cli/src/ui/hooks/useGeminiStream.ts
  • packages/core/src/core/geminiChat.runtime.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
🧬 Code graph analysis (4)
packages/core/src/services/history/ContentConverters.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
packages/core/src/core/geminiChat.ts (2)
packages/core/src/services/history/IContent.ts (2)
  • ThinkingBlock (177-191)
  • IContent (21-40)
packages/core/src/services/history/ContentConverters.ts (1)
  • ContentConverters (36-455)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts (2)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
  • AnthropicProvider (76-2624)
packages/core/src/services/history/IContent.ts (2)
  • IContent (21-40)
  • ThinkingBlock (177-191)
🔇 Additional comments (14)
packages/core/src/services/history/IContent.ts (1)

232-240: LGTM! Thinking block validation correctly enforces signature requirements.

The validation logic properly distinguishes between Anthropic thinking blocks (which require signatures per the API contract) and other thinking sources. The early return for empty thoughts is a good defensive check.

packages/core/src/services/history/HistoryService.test.ts (1)

746-759: LGTM! Good coverage for the new unsigned thinking block validation.

This test correctly verifies that Anthropic thinking blocks (identified by sourceField: 'thinking') without a signature are treated as invalid content and filtered from curated history. This aligns with the validation changes in IContent.ts.

packages/cli/src/ui/hooks/useGeminiStream.ts (1)

1423-1428: LGTM! Correct filtering of functionCall parts from tool response submission.

This change properly prevents functionCall parts from being resent when submitting tool responses as a continuation. Tool calls originate from the model and should not be included in user/tool role messages sent back to the API. The filtering ensures only functionResponse and other relevant parts are submitted.

packages/core/src/core/geminiChat.runtime.test.ts (2)

278-369: LGTM! Comprehensive test for thinking block retention with tool calls.

This test correctly verifies that when reasoning.includeInContext is enabled, thinking blocks are preserved alongside tool calls in the curated history. The test:

  • Mocks a response containing both thinking and tool_call blocks
  • Verifies the thinking block appears in the same history entry as the tool call
  • Uses appropriate assertions to confirm the expected behavior

This provides good coverage for the PR's objective of preserving thinking visibility across tool-call turns.


137-138: LGTM! Setting reasoning.includeInContext to true enables thinking block preservation for this test context.

packages/cli/src/ui/hooks/useGeminiStream.test.tsx (2)

687-784: LGTM! Excellent test coverage for the functionCall filtering behavior.

This test properly validates that when tool responses are submitted:

  1. functionCall parts are filtered out from the payload
  2. functionResponse and text parts are retained and sent to the stream

The test setup mirrors realistic scenarios where response parts may contain both the original function call and its response, ensuring the implementation correctly handles this case.


543-543: LGTM! Adding explicit errorType: undefined satisfies the interface requirements and makes the test fixtures type-complete.

packages/core/src/services/history/ContentConverters.test.ts (4)

2-7: LGTM! Import addition of ThinkingBlock enables proper type assertions in the new thinking-related tests.


187-214: LGTM! Good test coverage for thinking signature preservation from Gemini content.

This test verifies that when converting Gemini content with thinking parts to IContent:

  • The thoughtSignature maps to signature
  • The thought: true indicator results in sourceField: 'thought'
  • The thought text is preserved correctly

216-243: LGTM! Proper test for Anthropic thinking metadata preservation.

This test correctly validates that explicit llxprtSourceField: 'thinking' metadata (used for Anthropic thinking blocks) is preserved during Gemini→IContent conversion, ensuring cross-provider thinking block handling works correctly.


369-392: LGTM! Comprehensive test for IContent→Gemini thinking conversion.

This test verifies the reverse direction: when converting IContent with a ThinkingBlock back to Gemini format:

  • signature maps to thoughtSignature
  • sourceField: 'thinking' maps to llxprtSourceField: 'thinking'
  • thought: true is set on the part

This completes the round-trip test coverage for thinking block metadata.

packages/core/src/services/history/ContentConverters.ts (1)

109-125: Thinking metadata propagation looks solid.

The updated mapping preserves signature and sourceField cleanly in both directions.

Also applies to: 228-241

packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts (1)

160-291: Good regression coverage for issue #1150 scenarios.

The multi-turn/tool-call test setup looks thorough and aligns well with the bug’s reproduction cases.

packages/core/src/core/geminiChat.ts (1)

165-179: Thought-part handling and history attachment look good.

The ThoughtPart guard + thought-block extraction/attachment aligns with includeInContext behavior and keeps history consistent.

Also applies to: 2509-2615

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the maintainer:e2e:ok Trusted contributor; maintainer-approved E2E run label Jan 17, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

WARNING: LLxprt PR Review infrastructure failure

The automated reviewer failed with exit code 1. Please inspect the workflow logs (LLxprt section) and re-run once resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts`:
- Around line 1083-1085: The test is checking for a 'redacted_thinking' type but
AnthropicContentBlock doesn't include it, causing a TS2367 error; update the
local type used when reading assistantMsg!.content (used in the hasThinking
computation) to include 'redacted_thinking' so the union is widened. For
example, introduce a local alias (e.g., TestBlock = AnthropicContentBlock | {
type: 'redacted_thinking' }) and cast assistantMsg!.content to TestBlock[] when
computing hasThinking, or cast the checked value to unknown before the .some
check to satisfy the type system.
🧹 Nitpick comments (1)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)

1226-1257: Consider preventing orphaned thinking reuse/duplication.

When you pull a thinking-only block from earlier history, it can be reattached to multiple tool_call messages within the 3-message window, and the original thinking-only message still gets emitted—potentially duplicating context and inflating tokens. A small pre-merge/consume strategy (e.g., tracking “consumed” orphan indices and skipping reuse) would keep the request tighter.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a28d09b and defb04c.

📒 Files selected for processing (2)
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.
📚 Learning: 2026-01-13T19:28:00.789Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.ts
📚 Learning: 2025-12-18T14:06:22.557Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2025-12-18T14:06:22.557Z
Learning: OpenAIResponsesProvider (packages/core/src/providers/openai-responses/OpenAIResponsesProvider.ts) currently bypasses the ephemeral truncation system by using direct `JSON.stringify(toolResponseBlock.result)` and needs to be updated to support ephemeral settings like the other providers.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
📚 Learning: 2025-11-16T22:51:26.374Z
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
📚 Learning: 2025-12-14T16:16:39.939Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2025-12-14T16:16:39.939Z
Learning: MiniMax M2 model (hf:MiniMax/MiniMax-M2) requires reasoning.stripFromContext set to "none" to preserve interleaved thinking tokens in conversation history, as dropping thinking content harms agent reliability.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.ts
🧬 Code graph analysis (1)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
⏰ Context from checks skipped due to timeout of 270000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test (macos-latest, 24.x)
  • GitHub Check: Test (ubuntu-latest, 24.x)
  • GitHub Check: Test (windows-latest, 24.x)
  • GitHub Check: E2E Test (Linux) - sandbox:none
  • GitHub Check: E2E Test (Linux) - sandbox:docker
  • GitHub Check: E2E Test (macOS)
  • GitHub Check: Slow E2E - Win
🔇 Additional comments (2)
packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts (1)

1005-1160: Great multi-turn coverage for the issue regression.

These scenarios hit the tool/thinking split cases and verify the persistence logic clearly.

packages/core/src/providers/anthropic/AnthropicProvider.ts (1)

936-1023: Cross-message thinking validation looks solid.

The lookback-based check reads clearly and should prevent the false disables seen in the issue.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +1083 to +1085
const hasThinking = (
assistantMsg!.content as AnthropicContentBlock[]
).some((b) => b.type === 'thinking' || b.type === 'redacted_thinking');
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Type union doesn’t include redacted_thinking.

Line 1083 compares against redacted_thinking, but AnthropicContentBlock currently excludes it, which can trigger a TS2367 error in stricter configs. Consider widening the local union.

Suggested update (local test type)
 type AnthropicContentBlock =
   | { type: 'text'; text: string }
   | {
       type: 'thinking';
       thinking: string;
       signature: string;
     }
+  | {
+      type: 'redacted_thinking';
+      data: string;
+    }
   | {
       type: 'tool_use';
       id: string;
       name: string;
       input: unknown;
     };
🤖 Prompt for AI Agents
In `@packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts`
around lines 1083 - 1085, The test is checking for a 'redacted_thinking' type
but AnthropicContentBlock doesn't include it, causing a TS2367 error; update the
local type used when reading assistantMsg!.content (used in the hasThinking
computation) to include 'redacted_thinking' so the union is widened. For
example, introduce a local alias (e.g., TestBlock = AnthropicContentBlock | {
type: 'redacted_thinking' }) and cast assistantMsg!.content to TestBlock[] when
computing hasThinking, or cast the checked value to unknown before the .some
check to satisfy the type system.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

Code Coverage Summary

Package Lines Statements Functions Branches
CLI 48.75% 48.75% 57.89% 77.06%
Core 71.16% 71.16% 73.74% 79.11%
CLI Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   48.75 |    77.06 |   57.89 |   48.75 |                   
 src               |   30.76 |    42.57 |   47.05 |   30.76 |                   
  gemini.tsx       |   14.62 |    57.14 |   28.57 |   14.62 | ...,334-1125,1133 
  ...ractiveCli.ts |   53.44 |    41.07 |      25 |   53.44 | ...89-396,398-406 
  ...liCommands.ts |   97.22 |       60 |     100 |   97.22 | 39-40             
  ...ActiveAuth.ts |      36 |    35.71 |      80 |      36 | ...64-169,186-195 
 src/auth          |   50.88 |    64.79 |   66.89 |   50.88 |                   
  ...andlerImpl.ts |   90.72 |    84.61 |   71.42 |   90.72 | ...48-149,155-159 
  ...henticator.ts |     100 |    95.23 |   83.33 |     100 | 170               
  ...ketManager.ts |     100 |      100 |     100 |     100 |                   
  ...h-provider.ts |   58.98 |    59.57 |   66.66 |   58.98 | ...84-518,526-549 
  ...h-provider.ts |   40.74 |    85.71 |   69.23 |   40.74 | ...72-485,489-531 
  ...h-provider.ts |   17.74 |       90 |   27.77 |   17.74 | ...31-562,568-587 
  ...l-oauth-ui.ts |   54.16 |      100 |      40 |   54.16 | 26-32,38-39,57-61 
  ...h-callback.ts |   82.94 |    75.67 |    90.9 |   82.94 | ...74-775,788-790 
  migration.ts     |       0 |        0 |       0 |       0 | 1-69              
  oauth-manager.ts |      52 |    55.33 |      75 |      52 | ...1880,1889-1906 
  ...h-provider.ts |   36.15 |    31.81 |      40 |   36.15 | ...52-490,498-534 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/commands      |   71.11 |      100 |      25 |   71.11 |                   
  extensions.tsx   |   57.14 |      100 |       0 |   57.14 | 22-32,36          
  mcp.ts           |   94.11 |      100 |      50 |   94.11 | 26                
 ...nds/extensions |   45.47 |    97.14 |   32.14 |   45.47 |                   
  disable.ts       |   17.54 |      100 |       0 |   17.54 | 17-30,36-63,65-69 
  enable.ts        |   16.12 |      100 |       0 |   16.12 | 17-36,42-68,70-74 
  install.ts       |   93.22 |    95.45 |   66.66 |   93.22 | 138,141-147       
  link.ts          |   26.31 |      100 |       0 |   26.31 | 20-37,44-49,51-54 
  list.ts          |   32.14 |      100 |       0 |   32.14 | 11-27,34-35       
  new.ts           |     100 |      100 |     100 |     100 |                   
  uninstall.ts     |   44.11 |      100 |   33.33 |   44.11 | 14-22,34-39,42-45 
  update.ts        |   10.94 |      100 |       0 |   10.94 | ...42-157,159-163 
 ...les/mcp-server |       0 |        0 |       0 |       0 |                   
  example.ts       |       0 |        0 |       0 |       0 | 1-60              
 src/commands/mcp  |   97.15 |    86.44 |    90.9 |   97.15 |                   
  add.ts           |     100 |    96.15 |     100 |     100 | 210               
  list.ts          |   90.65 |    80.76 |      80 |   90.65 | ...11-113,138-139 
  remove.ts        |     100 |    71.42 |     100 |     100 | 19-23             
 src/config        |   83.88 |     79.2 |   74.81 |   83.88 |                   
  auth.ts          |   90.69 |    89.47 |     100 |   90.69 | 19-20,57-58       
  ...alSettings.ts |   86.66 |    88.88 |     100 |   86.66 | 40-41,44-47       
  config.ts        |   78.33 |    81.39 |      76 |   78.33 | ...1821,1824-1828 
  extension.ts     |   78.22 |    87.75 |   75.75 |   78.22 | ...02-803,806-807 
  keyBindings.ts   |     100 |      100 |     100 |     100 |                   
  paths.ts         |     100 |      100 |     100 |     100 |                   
  ...eBootstrap.ts |      86 |     82.5 |      90 |      86 | ...51-753,762-763 
  sandboxConfig.ts |   66.66 |    47.77 |   89.47 |   66.66 | ...87-494,512-513 
  ...oxProfiles.ts |    8.53 |      100 |       0 |    8.53 | 47-48,51-129      
  settings.ts      |   86.67 |    75.59 |      72 |   86.67 | ...74-775,829-830 
  ...ingsSchema.ts |     100 |      100 |     100 |     100 |                   
  ...tedFolders.ts |   97.94 |    95.45 |     100 |   97.94 | 86,180-181        
  welcomeConfig.ts |   21.05 |      100 |       0 |   21.05 | ...70,73-78,81-82 
 ...fig/extensions |   62.74 |    87.58 |   83.78 |   62.74 |                   
  ...Enablement.ts |   93.25 |    95.52 |     100 |   93.25 | ...90-196,240-242 
  github.ts        |    43.3 |    86.79 |   54.54 |    43.3 | ...61-355,406-459 
  update.ts        |   62.33 |    46.15 |   66.66 |   62.33 | ...19-145,161-169 
  ...ableSchema.ts |     100 |      100 |     100 |     100 |                   
  variables.ts     |   95.34 |       90 |     100 |   95.34 | 30-31             
 src/constants     |     100 |      100 |     100 |     100 |                   
  historyLimits.ts |     100 |      100 |     100 |     100 |                   
 src/extensions    |   65.75 |    57.89 |      75 |   65.75 |                   
  ...utoUpdater.ts |   65.75 |    57.89 |      75 |   65.75 | ...49-450,459,461 
 src/generated     |     100 |      100 |     100 |     100 |                   
  git-commit.ts    |     100 |      100 |     100 |     100 |                   
 ...egration-tests |   90.72 |    84.61 |     100 |   90.72 |                   
  test-utils.ts    |   90.72 |    84.61 |     100 |   90.72 | ...01,219-220,230 
 src/patches       |       0 |        0 |       0 |       0 |                   
  is-in-ci.ts      |       0 |        0 |       0 |       0 | 1-17              
 src/providers     |   82.64 |    68.29 |   83.67 |   82.64 |                   
  IFileSystem.ts   |    86.2 |    85.71 |   85.71 |    86.2 | 51-52,67-68       
  ...Precedence.ts |   94.59 |    86.66 |     100 |   94.59 | 40-41             
  index.ts         |       0 |        0 |       0 |       0 | 1-19              
  ...gistration.ts |   77.94 |    68.75 |   33.33 |   77.94 | ...,93-97,103-104 
  ...derAliases.ts |   74.35 |    70.37 |     100 |   74.35 | ...27-133,138-139 
  ...onfigUtils.ts |   92.45 |       75 |     100 |   92.45 | 25-29             
  ...erInstance.ts |   83.64 |    64.75 |   88.46 |   83.64 | ...49-753,770-774 
  types.ts         |       0 |        0 |       0 |       0 | 1-8               
 ...viders/logging |   87.59 |    88.63 |   63.63 |   87.59 |                   
  ...rvice-impl.ts |   44.44 |        0 |       0 |   44.44 | 21-22,25-30,36-37 
  git-stats.ts     |   94.59 |    90.69 |     100 |   94.59 | ...48-149,180-181 
 src/runtime       |   67.11 |    72.11 |   69.67 |   67.11 |                   
  ...imeAdapter.ts |   97.03 |    89.65 |     100 |   97.03 | ...38,344-345,541 
  ...etFailover.ts |   97.05 |    91.66 |     100 |   97.05 | 31-32,215         
  messages.ts      |      20 |      100 |       0 |      20 | ...0,38-66,74-102 
  ...pplication.ts |   82.78 |    71.31 |      70 |   82.78 | ...65-668,679-680 
  ...extFactory.ts |   91.28 |    72.41 |     100 |   91.28 | ...63-266,351-358 
  ...meSettings.ts |   55.42 |    66.55 |   55.22 |   55.42 | ...2179,2204-2258 
 src/services      |   71.55 |    87.34 |   82.35 |   71.55 |                   
  ...mandLoader.ts |     100 |      100 |     100 |     100 |                   
  ...ardService.ts |    91.3 |    33.33 |     100 |    91.3 | 35-36             
  ...andService.ts |     100 |      100 |     100 |     100 |                   
  ...mandLoader.ts |   88.77 |    90.47 |     100 |   88.77 | ...79-184,258-265 
  ...omptLoader.ts |   30.68 |    81.25 |      50 |   30.68 | ...80-281,284-288 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...mpt-processors |   97.56 |    94.11 |     100 |   97.56 |                   
  ...tProcessor.ts |     100 |      100 |     100 |     100 |                   
  ...lProcessor.ts |   97.36 |    93.61 |     100 |   97.36 | 77-78,202-203     
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...o-continuation |   86.01 |     78.4 |   94.11 |   86.01 |                   
  ...ionService.ts |   86.01 |     78.4 |   94.11 |   86.01 | ...94,562,588-589 
 src/settings      |   61.97 |    77.87 |     100 |   61.97 |                   
  ...alSettings.ts |   61.53 |    79.24 |     100 |   61.53 | ...26-437,440-446 
  ...aramParser.ts |   71.42 |    57.14 |     100 |   71.42 | 21-22,24-25,30-31 
 src/test-utils    |   40.68 |    78.57 |   42.85 |   40.68 |                   
  ...eExtension.ts |     100 |      100 |     100 |     100 |                   
  ...omMatchers.ts |   21.21 |      100 |       0 |   21.21 | 22-50             
  ...andContext.ts |     100 |      100 |     100 |     100 |                   
  render.tsx       |       0 |        0 |       0 |       0 | 1-149             
  ...e-testing.tsx |       0 |        0 |       0 |       0 | 1-54              
  ...iderConfig.ts |       0 |        0 |       0 |       0 | 1-19              
 src/ui            |   15.44 |    98.36 |   33.33 |   15.44 |                   
  App.tsx          |   33.89 |      100 |       0 |   33.89 | 50-86,92-99       
  AppContainer.tsx |     5.1 |      100 |       0 |     5.1 | 151-160,189-2488  
  ...tionNudge.tsx |       8 |      100 |       0 |       8 | 27-102            
  colors.ts        |   39.92 |      100 |   26.78 |   39.92 | ...86-287,291-292 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...derOptions.ts |     100 |      100 |     100 |     100 |                   
  keyMatchers.ts   |   95.65 |    96.29 |     100 |   95.65 | 29-30             
  ...ntsEnabled.ts |     100 |      100 |     100 |     100 |                   
  ...submission.ts |     100 |      100 |     100 |     100 |                   
  ...tic-colors.ts |     100 |      100 |     100 |     100 |                   
  textConstants.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/commands   |   65.47 |     76.1 |   62.85 |   65.47 |                   
  aboutCommand.ts  |   74.81 |       24 |     100 |   74.81 | ...05,112-113,140 
  authCommand.ts   |   74.95 |     84.4 |   83.33 |   74.95 | ...39-642,652-676 
  ...urlCommand.ts |      30 |      100 |       0 |      30 | 20-40             
  bugCommand.ts    |   79.16 |     37.5 |     100 |   79.16 | 32-35,42,79-88    
  chatCommand.ts   |   63.38 |    77.27 |      50 |   63.38 | ...87-509,526-536 
  clearCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...essCommand.ts |     100 |    88.88 |     100 |     100 | 71                
  copyCommand.ts   |   98.27 |    94.44 |     100 |   98.27 | 37                
  debugCommands.ts |   13.29 |      100 |       0 |   13.29 | ...48,455,462,469 
  ...icsCommand.ts |    62.5 |    57.14 |   33.33 |    62.5 | ...88,320,427-432 
  ...ryCommand.tsx |   16.86 |      100 |       0 |   16.86 | ...38-148,155-179 
  docsCommand.ts   |     100 |      100 |     100 |     100 |                   
  ...extCommand.ts |   93.18 |    77.77 |     100 |   93.18 | 108-113           
  editorCommand.ts |     100 |      100 |     100 |     100 |                   
  ...onsCommand.ts |   97.61 |    89.28 |     100 |   97.61 | 22,53,130         
  helpCommand.ts   |     100 |      100 |     100 |     100 |                   
  ideCommand.ts    |   66.35 |    68.96 |   55.55 |   66.35 | ...22-225,233-240 
  initCommand.ts   |   83.33 |    71.42 |   66.66 |   83.33 | 35-39,41-85       
  keyCommand.ts    |     100 |    77.77 |     100 |     100 | 47                
  ...ileCommand.ts |   11.11 |      100 |       0 |   11.11 | 23-134            
  ...ingCommand.ts |   10.96 |      100 |       0 |   10.96 | ...59-528,545-556 
  logoutCommand.ts |   15.62 |      100 |       0 |   15.62 | 21-85             
  mcpCommand.ts    |   82.35 |    82.22 |   83.33 |   82.35 | ...09-410,428-429 
  memoryCommand.ts |   88.82 |    83.87 |     100 |   88.82 | 69-83,96-101,152  
  modelCommand.ts  |   25.71 |      100 |       0 |   25.71 | 21-51             
  mouseCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...onsCommand.ts |     100 |      100 |     100 |     100 |                   
  ...iesCommand.ts |   97.02 |    82.85 |     100 |   97.02 | 27,40-41          
  ...acyCommand.ts |   61.53 |      100 |       0 |   61.53 | 22-26             
  ...ileCommand.ts |   61.47 |    73.04 |   69.23 |   61.47 | ...1044,1065-1081 
  ...derCommand.ts |   53.12 |    30.55 |      80 |   53.12 | ...58-262,270-275 
  quitCommand.ts   |   34.48 |      100 |       0 |   34.48 | 16-35             
  ...oreCommand.ts |   92.53 |     87.5 |     100 |   92.53 | ...,90-91,120-125 
  setCommand.ts    |   82.21 |    77.27 |      80 |   82.21 | ...11-816,858-871 
  ...ngsCommand.ts |     100 |      100 |     100 |     100 |                   
  ...hubCommand.ts |     100 |      100 |     100 |     100 |                   
  statsCommand.ts  |   94.33 |     90.9 |     100 |   94.33 | 26-34             
  statusCommand.ts |   13.63 |      100 |       0 |   13.63 | 20-87             
  ...entCommand.ts |   83.46 |    79.71 |   83.33 |   83.46 | ...18-624,651-664 
  ...tupCommand.ts |     100 |      100 |     100 |     100 |                   
  themeCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...matCommand.ts |   26.66 |      100 |       0 |   26.66 | 33-92             
  toolsCommand.ts  |   84.98 |     74.6 |     100 |   84.98 | ...85-294,307-308 
  types.ts         |     100 |      100 |     100 |     100 |                   
  ...ileCommand.ts |   61.11 |      100 |       0 |   61.11 | 16-22             
  vimCommand.ts    |   44.44 |      100 |       0 |   44.44 | 14-24             
 ...ommands/schema |   96.22 |    91.02 |    92.3 |   96.22 |                   
  index.ts         |   96.45 |    91.61 |     100 |   96.45 | ...08-412,423-424 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 src/ui/components |   10.63 |     35.1 |     2.4 |   10.63 |                   
  AboutBox.tsx     |    4.03 |      100 |       0 |    4.03 | 27-161            
  AsciiArt.ts      |     100 |      100 |     100 |     100 |                   
  AuthDialog.tsx   |    6.29 |      100 |       0 |    6.29 | 27-194            
  ...nProgress.tsx |   16.66 |      100 |       0 |   16.66 | 18-62             
  ...Indicator.tsx |   15.15 |      100 |       0 |   15.15 | 17-47             
  ...firmation.tsx |    7.31 |      100 |       0 |    7.31 | 45-179            
  ...tsDisplay.tsx |    7.69 |      100 |       0 |    7.69 | 23-34,38-156      
  CliSpinner.tsx   |   38.46 |      100 |       0 |   38.46 | 16-24             
  Composer.tsx     |     9.8 |      100 |       0 |     9.8 | 24-73             
  ...entPrompt.tsx |   18.75 |      100 |       0 |   18.75 | 21-51             
  ...ryDisplay.tsx |   21.05 |      100 |       0 |   21.05 | 17-35             
  ...ryDisplay.tsx |    4.93 |      100 |       0 |    4.93 | 26-112            
  ...geDisplay.tsx |       0 |        0 |       0 |       0 | 1-37              
  ...gProfiler.tsx |   17.88 |      100 |       0 |   17.88 | ...71-116,120-199 
  ...esDisplay.tsx |   10.52 |      100 |       0 |   10.52 | 24-82             
  ...ogManager.tsx |   11.03 |      100 |       0 |   11.03 | 54-393            
  ...ngsDialog.tsx |    6.53 |      100 |       0 |    6.53 | 27-189            
  ...rBoundary.tsx |   10.16 |        0 |       0 |   10.16 | ...16-161,179-191 
  ...ustDialog.tsx |   15.73 |      100 |       0 |   15.73 | 31-123            
  Footer.tsx       |    8.94 |      100 |     100 |    8.94 | ...30-508,512-525 
  ...ngSpinner.tsx |    40.9 |      100 |       0 |    40.9 | 31-47             
  Header.tsx       |    17.5 |      100 |       0 |    17.5 | 22-62             
  Help.tsx         |    3.17 |      100 |       0 |    3.17 | 17-179            
  ...emDisplay.tsx |   19.23 |      100 |       0 |   19.23 | 51-179            
  InputPrompt.tsx  |   38.78 |     37.2 |   66.66 |   38.78 | ...6-914,928-1077 
  ...tsDisplay.tsx |    4.41 |      100 |       0 |    4.41 | 26-37,41-249      
  ...utManager.tsx |       0 |        0 |       0 |       0 | 1-97              
  ...ileDialog.tsx |    6.89 |      100 |       0 |    6.89 | 20-119            
  ...Indicator.tsx |   14.54 |      100 |       0 |   14.54 | 24-81             
  ...ingDialog.tsx |    4.52 |      100 |       0 |    4.52 | ...9,84-90,93-354 
  ...geDisplay.tsx |       0 |        0 |       0 |       0 | 1-40              
  ...tsDisplay.tsx |    6.28 |      100 |       0 |    6.28 | 33-52,56-214      
  ...fications.tsx |    14.1 |      100 |       0 |    14.1 | 28-105            
  ...odeDialog.tsx |    7.31 |      100 |       0 |    7.31 | 30-140            
  ...ustDialog.tsx |    6.21 |      100 |       0 |    6.21 | 30-237            
  PrepareLabel.tsx |   13.33 |      100 |       0 |   13.33 | 20-48             
  ...ailDialog.tsx |   11.58 |      100 |       0 |   11.58 | 57-68,71-343      
  ...ineEditor.tsx |    2.58 |      100 |       0 |    2.58 | 25-65,69-358      
  ...istDialog.tsx |    2.99 |      100 |       0 |    2.99 | 35-369            
  ...derDialog.tsx |    3.84 |      100 |       0 |    3.84 | 22-272            
  ...delDialog.tsx |    2.99 |      100 |       0 |    2.99 | 23-361            
  ...Indicator.tsx |       0 |        0 |       0 |       0 | 1-21              
  ...eKeyInput.tsx |       0 |        0 |       0 |       0 | 1-138             
  ...ryDisplay.tsx |      50 |      100 |       0 |      50 | 15-17             
  ...ngsDialog.tsx |    1.87 |      100 |       0 |    1.87 | ...9-108,111-1262 
  ...ionDialog.tsx |   13.95 |      100 |       0 |   13.95 | 35-125            
  ...Indicator.tsx |   44.44 |      100 |       0 |   44.44 | 12-17             
  ...MoreLines.tsx |      28 |      100 |       0 |      28 | 18-40             
  StatsDisplay.tsx |    6.82 |      100 |       0 |    6.82 | ...85-160,168-339 
  ...nsDisplay.tsx |    7.76 |      100 |       0 |    7.76 | 49-164            
  ThemeDialog.tsx  |    4.85 |      100 |       0 |    4.85 | 34-338            
  Tips.tsx         |      16 |      100 |       0 |      16 | 17-45             
  TodoPanel.tsx    |    5.55 |      100 |       0 |    5.55 | 26-74,77-245      
  ...tsDisplay.tsx |    7.42 |      100 |       0 |    7.42 | 30-53,56-228      
  ToolsDialog.tsx  |    7.86 |      100 |       0 |    7.86 | 23-119            
  ...ification.tsx |   36.36 |      100 |       0 |   36.36 | 15-22             
  ...ionDialog.tsx |    7.52 |      100 |       0 |    7.52 | 18-122            
  todo-utils.ts    |       0 |        0 |       0 |       0 | 1-7               
 ...leCreateWizard |   19.52 |       50 |       0 |   19.52 |                   
  ...aramsStep.tsx |    5.82 |      100 |       0 |    5.82 | 27-244            
  ...ationStep.tsx |    4.82 |      100 |       0 |    4.82 | 27-294            
  ...onfigStep.tsx |   11.23 |      100 |       0 |   11.23 | 25-119            
  ...electStep.tsx |    6.84 |      100 |       0 |    6.84 | 26-190            
  ...ationMenu.tsx |       0 |        0 |       0 |       0 | 1-101             
  ...eSaveStep.tsx |    6.28 |      100 |       0 |    6.28 | 33-255            
  ...ssSummary.tsx |   12.12 |      100 |       0 |   12.12 | 22-87             
  ...electStep.tsx |   16.92 |      100 |       0 |   16.92 | 27-94             
  TextInput.tsx    |     5.6 |      100 |       0 |     5.6 | 27-168            
  constants.ts     |     100 |      100 |     100 |     100 |                   
  index.tsx        |    6.27 |      100 |       0 |    6.27 | 28-296            
  types.ts         |     100 |      100 |     100 |     100 |                   
  utils.ts         |    5.22 |      100 |       0 |    5.22 | ...46-350,355-372 
  validation.ts    |   11.23 |      100 |       0 |   11.23 | ...97-104,107-111 
 ...gentManagement |     7.7 |      100 |       0 |     7.7 |                   
  ...entWizard.tsx |    4.06 |      100 |       0 |    4.06 | 33-238            
  ...ionWizard.tsx |    2.81 |      100 |       0 |    2.81 | 28-362            
  ...eteDialog.tsx |    6.59 |      100 |       0 |    6.59 | 21-126            
  ...tEditForm.tsx |    3.72 |      100 |       0 |    3.72 | 24-249            
  ...tListMenu.tsx |    3.97 |      100 |       0 |    3.97 | 25-236            
  ...tMainMenu.tsx |   18.75 |      100 |       0 |   18.75 | 19-49             
  ...gerDialog.tsx |    3.89 |      100 |       0 |    3.89 | 26-444            
  ...tShowView.tsx |    4.03 |      100 |       0 |    4.03 | 21-162            
  index.ts         |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...comeOnboarding |   10.51 |        0 |       0 |   10.51 |                   
  ...ethodStep.tsx |   16.86 |      100 |       0 |   16.86 | 37-122            
  ...ationStep.tsx |    5.42 |      100 |       0 |    5.42 | 28-180            
  ...etionStep.tsx |    5.08 |      100 |       0 |    5.08 | 22-164            
  ...electStep.tsx |    7.95 |      100 |       0 |    7.95 | 30-131            
  ...electStep.tsx |   23.07 |      100 |       0 |   23.07 | 33-92             
  SkipExitStep.tsx |    12.5 |      100 |       0 |    12.5 | 18-59             
  ...omeDialog.tsx |   12.38 |      100 |       0 |   12.38 | 37-146            
  WelcomeStep.tsx  |    10.2 |      100 |       0 |    10.2 | 23-74             
  index.ts         |       0 |        0 |       0 |       0 | 1-13              
 ...nents/messages |   13.25 |    85.71 |    7.14 |   13.25 |                   
  ...onMessage.tsx |   13.72 |      100 |       0 |   13.72 | 24-80             
  DiffRenderer.tsx |    3.33 |      100 |       0 |    3.33 | ...79-360,363-381 
  ErrorMessage.tsx |   22.22 |      100 |       0 |   22.22 | 16-31             
  ...niMessage.tsx |   16.07 |      100 |       0 |   16.07 | 27-83             
  ...geContent.tsx |   20.83 |      100 |       0 |   20.83 | 26-46             
  InfoMessage.tsx  |   26.31 |      100 |       0 |   26.31 | 17-32             
  ...rlMessage.tsx |     100 |       50 |     100 |     100 | 26                
  ...ckDisplay.tsx |      20 |      100 |       0 |      20 | 43-64             
  ...onMessage.tsx |    3.87 |      100 |       0 |    3.87 | 43-507            
  ...upMessage.tsx |   10.36 |      100 |       0 |   10.36 | ...2,65-80,84-254 
  ToolMessage.tsx  |    8.62 |      100 |       0 |    8.62 | ...98-332,335-338 
  UserMessage.tsx  |     100 |      100 |     100 |     100 |                   
  ...llMessage.tsx |   36.36 |      100 |       0 |   36.36 | 17-25             
  ...ngMessage.tsx |   26.31 |      100 |       0 |   26.31 | 17-32             
 ...ponents/shared |   31.87 |    56.35 |    61.9 |   31.87 |                   
  ...ctionList.tsx |    5.55 |      100 |       0 |    5.55 | 53-184            
  MaxSizedBox.tsx  |    2.37 |      100 |       0 |    2.37 | 23-50,99-625      
  ...tonSelect.tsx |   13.63 |      100 |       0 |   13.63 | 57-100            
  ...lableList.tsx |    8.49 |      100 |       0 |    8.49 | 45-153            
  ...lizedList.tsx |    2.29 |      100 |       0 |    2.29 | 56-486            
  text-buffer.ts   |    51.8 |    62.01 |   83.33 |    51.8 | ...1823-1873,1911 
  ...er-actions.ts |   30.78 |    38.59 |      50 |   30.78 | ...98-806,810-812 
 ...mponents/views |   12.08 |      100 |       0 |   12.08 |                   
  ChatList.tsx     |    14.7 |      100 |       0 |    14.7 | 18-51             
  ...sionsList.tsx |   10.52 |      100 |       0 |   10.52 | 19-77             
 src/ui/constants  |     100 |      100 |     100 |     100 |                   
  ...ollections.ts |     100 |      100 |     100 |     100 |                   
 src/ui/containers |       0 |        0 |       0 |       0 |                   
  ...ontroller.tsx |       0 |        0 |       0 |       0 | 1-340             
  UIStateShell.tsx |       0 |        0 |       0 |       0 | 1-15              
 src/ui/contexts   |   59.91 |    75.51 |      50 |   59.91 |                   
  ...chContext.tsx |    64.7 |      100 |      50 |    64.7 | 24-29             
  FocusContext.tsx |       0 |        0 |       0 |       0 | 1-11              
  ...ssContext.tsx |   82.86 |    80.58 |      92 |   82.86 | ...1234,1266-1269 
  MouseContext.tsx |   78.88 |    66.66 |     100 |   78.88 | ...98-102,108-118 
  ...erContext.tsx |       0 |        0 |       0 |       0 | 1-120             
  ...owContext.tsx |   19.64 |      100 |       0 |   19.64 | 33,36,39-87       
  ...meContext.tsx |   46.92 |       25 |   28.57 |   46.92 | ...91,195-196,201 
  ...lProvider.tsx |   89.16 |    69.81 |     100 |   89.16 | ...79-380,387-388 
  ...onContext.tsx |    6.73 |      100 |       0 |    6.73 | ...88-282,287-294 
  ...teContext.tsx |       0 |        0 |       0 |       0 | 1-61              
  ...gsContext.tsx |      50 |      100 |       0 |      50 | 15-20             
  ...ngContext.tsx |   42.85 |      100 |       0 |   42.85 | 15-22             
  TodoContext.tsx  |   55.55 |      100 |       0 |   55.55 | 19-22,24-27       
  TodoProvider.tsx |    6.94 |      100 |       0 |    6.94 | 24-105            
  ...llContext.tsx |     100 |      100 |       0 |     100 |                   
  ...lProvider.tsx |    6.75 |      100 |       0 |    6.75 | 28-122            
  ...nsContext.tsx |      25 |      100 |       0 |      25 | 187-198,201-206   
  ...teContext.tsx |   27.77 |      100 |       0 |   27.77 | 220-229,232-237   
  ...deContext.tsx |   11.11 |      100 |       0 |   11.11 | 29-81,84-89       
 src/ui/editors    |   94.11 |    85.71 |   66.66 |   94.11 |                   
  ...ngsManager.ts |   94.11 |    85.71 |   66.66 |   94.11 | 55,69-70          
 src/ui/hooks      |   54.87 |    79.16 |   65.32 |   54.87 |                   
  ...dProcessor.ts |   78.52 |    77.57 |     100 |   78.52 | ...04-507,519-538 
  index.ts         |       0 |        0 |       0 |       0 | 1-10              
  ...dProcessor.ts |    96.4 |    75.67 |     100 |    96.4 | ...18-219,224-225 
  ...dProcessor.ts |   29.58 |    52.38 |      50 |   29.58 | ...75-376,381-760 
  ...Completion.ts |   92.77 |    89.28 |     100 |   92.77 | ...91-192,225-228 
  ...uthCommand.ts |    6.45 |      100 |       0 |    6.45 | 15-135            
  ...tIndicator.ts |   80.95 |     87.5 |     100 |   80.95 | 37,39-49          
  ...chedScroll.ts |   16.66 |      100 |       0 |   16.66 | 14-32             
  ...ketedPaste.ts |      20 |      100 |       0 |      20 | 20-38             
  ...ompletion.tsx |   92.76 |    83.33 |     100 |   92.76 | ...22-223,227-234 
  useCompletion.ts |    92.4 |     87.5 |     100 |    92.4 | ...,95-96,100-101 
  ...leMessages.ts |       5 |      100 |       0 |       5 | 29-65,68-118      
  ...fileDialog.ts |   16.12 |      100 |       0 |   16.12 | 17-47             
  ...orSettings.ts |   11.11 |      100 |       0 |   11.11 | 29-81             
  ...AutoUpdate.ts |    9.52 |      100 |       0 |    9.52 | 18-58             
  ...ionUpdates.ts |   68.44 |    87.09 |   66.66 |   68.44 | ...79-185,200-217 
  ...erDetector.ts |     100 |      100 |     100 |     100 |                   
  useFocus.ts      |     100 |      100 |     100 |     100 |                   
  ...olderTrust.ts |     100 |      100 |     100 |     100 |                   
  ...miniStream.ts |   51.24 |    49.63 |      40 |   51.24 | ...1442,1472-1574 
  ...BranchName.ts |     100 |    89.47 |     100 |     100 | 58,61             
  ...oryManager.ts |   96.26 |     92.1 |     100 |   96.26 | ...66-167,210-211 
  ...stListener.ts |   12.12 |      100 |       0 |   12.12 | 17-50             
  ...putHistory.ts |    92.5 |    85.71 |     100 |    92.5 | 62-63,71,93-95    
  ...storyStore.ts |     100 |    94.11 |     100 |     100 | 66                
  useKeypress.ts   |   21.05 |      100 |       0 |   21.05 | 24-41             
  ...rdProtocol.ts |   36.36 |      100 |       0 |   36.36 | 24-31             
  ...fileDialog.ts |    5.71 |      100 |       0 |    5.71 | 27-135            
  ...gIndicator.ts |     100 |      100 |     100 |     100 |                   
  useLogger.ts     |   93.75 |      100 |     100 |   93.75 | 26                
  ...oryMonitor.ts |     100 |      100 |     100 |     100 |                   
  useMouse.ts      |   77.77 |    66.66 |     100 |   77.77 | 22-25             
  ...eSelection.ts |    3.13 |      100 |       0 |    3.13 | 36-103,106-315    
  ...oviderInfo.ts |       0 |        0 |       0 |       0 | 1-80              
  ...odifyTrust.ts |    9.09 |      100 |       0 |    9.09 | 46-137            
  ...raseCycler.ts |    84.9 |    76.92 |     100 |    84.9 | 43-45,48-49,65-67 
  ...cySettings.ts |   87.28 |     82.6 |     100 |   87.28 | ...21-122,133-144 
  ...Management.ts |    2.48 |      100 |       0 |    2.48 | 21-62,74-423      
  ...Completion.ts |   29.41 |       40 |     100 |   29.41 | ...14-227,236-242 
  ...iderDialog.ts |    7.89 |      100 |       0 |    7.89 | 27-110            
  ...odelDialog.ts |    9.37 |      100 |       0 |    9.37 | 25-86             
  ...lScheduler.ts |   67.51 |    80.64 |   77.77 |   67.51 | ...73-475,571-581 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-7               
  useResponsive.ts |     100 |      100 |     100 |     100 |                   
  ...ompletion.tsx |   69.56 |      100 |     100 |   69.56 | 45-47,51-66,78-81 
  ...ectionList.ts |   87.25 |    88.29 |     100 |   87.25 | ...09-410,419-422 
  useSession.ts    |       0 |        0 |       0 |       0 | 1-23              
  ...ngsCommand.ts |   18.75 |      100 |       0 |   18.75 | 10-25             
  ...ellHistory.ts |   91.66 |    79.41 |     100 |   91.66 | ...69,117-118,128 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-62              
  ...ompletion.tsx |   80.06 |    82.92 |      75 |   80.06 | ...37-838,840-841 
  ...leCallback.ts |     100 |      100 |     100 |     100 |                   
  ...tateAndRef.ts |   59.09 |      100 |     100 |   59.09 | 23-31             
  ...oryRefresh.ts |     100 |      100 |     100 |     100 |                   
  ...rminalSize.ts |   11.42 |      100 |       0 |   11.42 | 13-55             
  ...emeCommand.ts |    6.03 |      100 |       0 |    6.03 | 26-151            
  useTimer.ts      |   88.09 |    85.71 |     100 |   88.09 | 44-45,51-53       
  ...ntinuation.ts |       0 |        0 |       0 |       0 | 1-270             
  ...ePreserver.ts |   48.48 |      100 |      75 |   48.48 | 33-50             
  ...oolsDialog.ts |    4.67 |      100 |       0 |    4.67 | 24-145            
  ...Onboarding.ts |    2.96 |      100 |       0 |    2.96 | 76-348            
  ...eMigration.ts |   10.34 |      100 |       0 |   10.34 | 14-72             
  vim.ts           |   83.57 |     79.5 |     100 |   83.57 | ...38,742-750,759 
 src/ui/layouts    |    5.34 |      100 |       0 |    5.34 |                   
  ...AppLayout.tsx |    5.34 |      100 |       0 |    5.34 | 57-74,77-641      
 ...noninteractive |      75 |      100 |    6.66 |      75 |                   
  ...eractiveUi.ts |      75 |      100 |    6.66 |      75 | 17-19,23-24,27-28 
 src/ui/privacy    |   25.78 |      100 |       0 |   25.78 |                   
  ...acyNotice.tsx |   10.97 |      100 |       0 |   10.97 | 22-123            
  ...acyNotice.tsx |   14.28 |      100 |       0 |   14.28 | 16-59             
  ...acyNotice.tsx |   12.19 |      100 |       0 |   12.19 | 16-62             
  ...acyNotice.tsx |   41.33 |      100 |       0 |   41.33 | 78-91,99-193      
  ...acyNotice.tsx |   21.95 |      100 |       0 |   21.95 | 20-59,62-64       
 src/ui/reducers   |   78.63 |     90.9 |      50 |   78.63 |                   
  appReducer.ts    |     100 |      100 |     100 |     100 |                   
  ...ionReducer.ts |       0 |        0 |       0 |       0 | 1-52              
 src/ui/state      |   73.41 |    69.23 |     100 |   73.41 |                   
  extensions.ts    |   73.41 |    69.23 |     100 |   73.41 | ...21,123-126,128 
 src/ui/themes     |   99.13 |    89.38 |      96 |   99.13 |                   
  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 |                   
  green-screen.ts  |     100 |      100 |     100 |     100 |                   
  no-color.ts      |     100 |      100 |     100 |     100 |                   
  ...c-resolver.ts |     100 |      100 |     100 |     100 |                   
  ...tic-tokens.ts |     100 |      100 |     100 |     100 |                   
  ...-of-purple.ts |     100 |      100 |     100 |     100 |                   
  theme-compat.ts  |     100 |       50 |     100 |     100 | 79                
  theme-manager.ts |   89.74 |    82.53 |     100 |   89.74 | ...04-310,315-316 
  theme.ts         |   99.41 |      100 |   85.71 |   99.41 | 185-186           
  xcode.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/utils      |   43.49 |    86.66 |   63.41 |   43.49 |                   
  ...Colorizer.tsx |    5.76 |      100 |       0 |    5.76 | ...16-128,140-232 
  ...olePatcher.ts |      78 |    77.77 |     100 |      78 | 58-69             
  ...nRenderer.tsx |    9.39 |      100 |       0 |    9.39 | 26-165,174-183    
  ...wnDisplay.tsx |    5.73 |      100 |       0 |    5.73 | ...96-420,431-435 
  ...eRenderer.tsx |   10.63 |      100 |       0 |   10.63 | ...32-247,260-395 
  ...ketedPaste.ts |   55.55 |      100 |       0 |   55.55 | 11-12,15-16       
  clipboard.ts     |   97.29 |    84.61 |     100 |   97.29 | 40                
  ...boardUtils.ts |   32.25 |     37.5 |     100 |   32.25 | ...55-114,129-145 
  commandUtils.ts  |   93.44 |    89.79 |     100 |   93.44 | ...31,135,137-138 
  computeStats.ts  |     100 |      100 |     100 |     100 |                   
  displayUtils.ts  |     100 |      100 |     100 |     100 |                   
  formatters.ts    |   90.47 |    95.23 |     100 |   90.47 | 57-60             
  fuzzyFilter.ts   |     100 |    96.42 |     100 |     100 | 75                
  highlight.ts     |   65.43 |      100 |   66.66 |   65.43 | 77-110            
  input.ts         |     100 |    85.71 |     100 |     100 | 18                
  ...olDetector.ts |    9.09 |       50 |   16.66 |    9.09 | ...51-152,155-156 
  ...nUtilities.ts |   69.84 |    85.71 |     100 |   69.84 | 75-91,100-101     
  mouse.ts         |   85.16 |    73.68 |     100 |   85.16 | ...18-219,223-224 
  ...mConstants.ts |     100 |      100 |     100 |     100 |                   
  ...opDetector.ts |       0 |        0 |       0 |       0 | 1-209             
  responsive.ts    |    69.9 |    73.33 |      80 |    69.9 | ...95-103,106-121 
  ...putHandler.ts |   87.36 |    90.32 |     100 |   87.36 | 52-53,74-83       
  ...alContract.ts |     100 |      100 |     100 |     100 |                   
  terminalLinks.ts |     100 |      100 |     100 |     100 |                   
  ...lSequences.ts |     100 |      100 |     100 |     100 |                   
  terminalSetup.ts |    4.03 |      100 |       0 |    4.03 | 40-340            
  textUtils.ts     |   74.77 |    94.59 |   72.72 |   74.77 | ...14-115,135-137 
  ...Formatters.ts |   17.39 |      100 |       0 |   17.39 | 14-21,29-36,50-52 
  ...icsTracker.ts |     100 |    66.66 |     100 |     100 | 32-34             
  ui-sizing.ts     |   21.05 |      100 |       0 |   21.05 | 11-23,26-31       
  updateCheck.ts   |     100 |    93.75 |     100 |     100 | 28,39             
 src/utils         |   57.49 |    88.44 |   81.39 |   57.49 |                   
  ...ionContext.ts |   79.59 |       75 |     100 |   79.59 | 37-40,62-63,78-81 
  bootstrap.ts     |   94.11 |    88.88 |     100 |   94.11 | 71-72             
  checks.ts        |   33.33 |      100 |       0 |   33.33 | 23-28             
  cleanup.ts       |   72.72 |      100 |      75 |   72.72 | 43-52             
  commands.ts      |    50.9 |    63.63 |     100 |    50.9 | 25-26,45,57-84    
  commentJson.ts   |   92.17 |     92.5 |     100 |   92.17 | 92-100            
  ...ScopeUtils.ts |   19.23 |      100 |       0 |   19.23 | 23-40,46-73       
  ...icSettings.ts |   88.61 |    88.88 |     100 |   88.61 | ...37,40-43,61-64 
  ...arResolver.ts |   96.42 |    96.15 |     100 |   96.42 | 111-112           
  errors.ts        |   94.59 |       88 |     100 |   94.59 | 49-50,88-89       
  events.ts        |     100 |      100 |     100 |     100 |                   
  gitUtils.ts      |    92.5 |    82.35 |     100 |    92.5 | 61-62,77-80       
  ...AutoUpdate.ts |   67.05 |    77.08 |   71.42 |   67.05 | ...13-214,261-326 
  ...lationInfo.ts |     100 |      100 |     100 |     100 |                   
  math.ts          |   66.66 |      100 |       0 |   66.66 | 15                
  package.ts       |   88.88 |    83.33 |     100 |   88.88 | 33-34             
  readStdin.ts     |   79.24 |       90 |      80 |   79.24 | 31-38,50-52       
  relaunch.ts      |     100 |      100 |     100 |     100 |                   
  resolvePath.ts   |   66.66 |       25 |     100 |   66.66 | 12-13,16,18-19    
  sandbox.ts       |    5.46 |      100 |   18.18 |    5.46 | 31-42,103-1199    
  ...ionCleanup.ts |   94.58 |    87.69 |     100 |   94.58 | ...74-175,256-257 
  sessionUtils.ts  |    9.23 |      100 |       0 |    9.23 | 43-99,106-120     
  settingsUtils.ts |   84.14 |    90.52 |   93.33 |   84.14 | ...12-439,478-479 
  ...ttingSaver.ts |    1.92 |      100 |       0 |    1.92 | 7-28,36-81        
  spawnWrapper.ts  |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |     100 |      100 |     100 |     100 |                   
  stdinSafety.ts   |   93.24 |    86.48 |     100 |   93.24 | ...62-163,167,242 
  ...entEmitter.ts |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |     100 |      100 |     100 |     100 |                   
  version.ts       |     100 |       50 |     100 |     100 | 11                
  windowTitle.ts   |     100 |      100 |     100 |     100 |                   
 src/utils/privacy |    46.3 |    68.57 |   52.63 |    46.3 |                   
  ...taRedactor.ts |   60.66 |    70.58 |   55.55 |   60.66 | ...77-479,485-506 
  ...acyManager.ts |       0 |        0 |       0 |       0 | 1-178             
 ...ed-integration |    22.4 |        0 |       0 |    22.4 |                   
  acp.ts           |   14.63 |        0 |       0 |   14.63 | ...31-332,335-342 
  ...temService.ts |   20.58 |      100 |       0 |   20.58 | ...34,37-46,48-49 
  schema.ts        |     100 |      100 |     100 |     100 |                   
  ...ntegration.ts |    4.45 |      100 |       0 |    4.45 | ...1439,1454-1504 
-------------------|---------|----------|---------|---------|-------------------
Core Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   71.16 |    79.11 |   73.74 |   71.16 |                   
 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/adapters      |     100 |      100 |     100 |     100 |                   
  ...eamAdapter.ts |     100 |      100 |     100 |     100 |                   
 src/agents        |   77.47 |     68.1 |      90 |   77.47 |                   
  ...vestigator.ts |       0 |        0 |       0 |       0 | 1-152             
  executor.ts      |   88.23 |    67.03 |     100 |   88.23 | ...03-704,740-746 
  invocation.ts    |   96.34 |    76.47 |     100 |   96.34 | 61,65-66          
  registry.ts      |       0 |        0 |       0 |       0 | 1-83              
  types.ts         |     100 |      100 |     100 |     100 |                   
  utils.ts         |   78.94 |       80 |     100 |   78.94 | 32-35             
 src/auth          |   65.13 |    79.54 |   75.53 |   65.13 |                   
  ...evice-flow.ts |    7.21 |      100 |       0 |    7.21 | ...49-268,274-282 
  ...evice-flow.ts |   46.65 |    57.14 |   63.63 |   46.65 | ...95-484,494-580 
  oauth-errors.ts  |   94.15 |    83.33 |     100 |   94.15 | ...68,609,635-636 
  precedence.ts    |   76.75 |    78.15 |   94.44 |   76.75 | ...1028,1034-1037 
  ...evice-flow.ts |    8.33 |        0 |       0 |    8.33 | ...69-206,214-220 
  token-store.ts   |   77.96 |    88.09 |    90.9 |   77.96 | ...51-272,297-298 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/code_assist   |   68.24 |     79.6 |      78 |   68.24 |                   
  codeAssist.ts    |   16.25 |       50 |   33.33 |   16.25 | ...1,80-87,95-108 
  converter.ts     |   94.96 |    93.02 |     100 |   94.96 | ...88,202,219-220 
  ...al-storage.ts |     100 |    79.41 |     100 |     100 | 47-49,80-83       
  oauth2.ts        |    63.4 |    75.29 |   78.57 |    63.4 | ...16-717,722-723 
  server.ts        |   51.89 |    72.72 |   53.84 |   51.89 | ...99-240,243-246 
  setup.ts         |   82.92 |    73.91 |     100 |   82.92 | ...27-129,153-159 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/commands      |     100 |      100 |     100 |     100 |                   
  extensions.ts    |     100 |      100 |     100 |     100 |                   
 src/config        |   75.75 |    81.25 |   59.62 |   75.75 |                   
  config.ts        |   73.37 |    80.83 |   48.32 |   73.37 | ...1860,1866-1870 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  endpoints.ts     |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  models.ts        |     100 |      100 |     100 |     100 |                   
  ...ileManager.ts |    94.8 |    85.07 |     100 |    94.8 | ...57-358,364,367 
  ...rSingleton.ts |   77.45 |    82.85 |   41.66 |   77.45 | ...44,247-250,258 
  storage.ts       |   93.25 |    95.65 |   91.66 |   93.25 | 27-28,49-50,75-76 
  ...entManager.ts |   57.91 |    65.57 |     100 |   57.91 | ...57-458,476-500 
  types.ts         |       0 |        0 |       0 |       0 |                   
 ...nfirmation-bus |   68.39 |    88.46 |   66.66 |   68.39 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-2               
  message-bus.ts   |   67.48 |    91.66 |   72.72 |   67.48 | ...04-238,247-255 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/core          |    65.3 |    73.26 |   69.52 |    65.3 |                   
  baseLlmClient.ts |   97.26 |       90 |     100 |   97.26 | 55-56,244-245     
  ...ntegration.ts |    96.5 |    95.65 |     100 |    96.5 | ...28-129,209-210 
  client.ts        |   62.21 |    77.85 |   69.81 |   62.21 | ...2070,2075-2086 
  ...ion-config.ts |     100 |      100 |     100 |     100 |                   
  ...tGenerator.ts |   91.08 |    80.76 |     100 |   91.08 | ...32,148,163-166 
  ...lScheduler.ts |   77.07 |    75.48 |   90.24 |   77.07 | ...1880,1884-1890 
  geminiChat.ts    |   52.92 |    57.07 |   56.79 |   52.92 | ...2872,2895-2896 
  geminiRequest.ts |     100 |      100 |     100 |     100 |                   
  ...nAIWrapper.ts |   88.88 |      100 |   83.33 |   88.88 | 56-59             
  logger.ts        |   81.26 |    81.81 |     100 |   81.26 | ...64-378,419-430 
  ...tGenerator.ts |   10.89 |      100 |       0 |   10.89 | ...93-194,197-200 
  ...olExecutor.ts |   66.43 |    79.16 |   55.55 |   66.43 | ...51-152,197-231 
  prompts.ts       |   67.98 |    65.62 |      70 |   67.98 | ...95,311,352-355 
  subagent.ts      |   52.01 |    65.42 |   57.14 |   52.01 | ...1969,1981-1982 
  ...chestrator.ts |    89.1 |    73.56 |   95.23 |    89.1 | ...17,620-621,626 
  ...tScheduler.ts |       0 |        0 |       0 |       0 | 1                 
  tokenLimits.ts   |   90.27 |    73.07 |     100 |   90.27 | ...72,77,79,83,93 
  ...Governance.ts |    94.2 |     90.9 |     100 |    94.2 | 34-35,51-52       
  turn.ts          |    92.2 |    73.68 |     100 |    92.2 | ...29-430,460-461 
 src/debug         |   78.28 |    87.83 |   89.65 |   78.28 |                   
  ...ionManager.ts |   77.88 |    78.04 |      85 |   77.88 | ...33-234,251-255 
  DebugLogger.ts   |   91.07 |    90.32 |      88 |   91.07 | ...72,211-215,252 
  FileOutput.ts    |   91.79 |    93.02 |     100 |   91.79 | ...,93-97,117-118 
  ...ionManager.ts |       0 |      100 |     100 |       0 | 18-64             
  ...FileOutput.ts |       0 |      100 |     100 |       0 | 15-37             
  index.ts         |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 |                   
 src/filters       |   99.19 |    98.79 |     100 |   99.19 |                   
  EmojiFilter.ts   |   99.19 |    98.79 |     100 |   99.19 | 208-209           
 src/hooks         |   88.88 |    33.33 |     100 |   88.88 |                   
  ...ssion-hook.ts |   88.88 |    33.33 |     100 |   88.88 | 24,30             
 src/ide           |   72.88 |    84.43 |      74 |   72.88 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  detect-ide.ts    |     100 |      100 |     100 |     100 |                   
  ide-client.ts    |   54.56 |    75.51 |   56.66 |   54.56 | ...62-470,498-506 
  ide-installer.ts |   90.55 |    85.18 |     100 |   90.55 | ...35,142-146,159 
  ideContext.ts    |    83.8 |      100 |     100 |    83.8 | 75-91             
  process-utils.ts |   89.13 |    81.48 |     100 |   89.13 | ...69-170,211-212 
 src/interfaces    |       0 |        0 |       0 |       0 |                   
  index.ts         |       0 |        0 |       0 |       0 |                   
  ....interface.ts |       0 |        0 |       0 |       0 |                   
 src/mcp           |   78.78 |     77.9 |   71.95 |   78.78 |                   
  ...oken-store.ts |   87.38 |    90.47 |   81.25 |   87.38 | ...33-334,337-338 
  ...h-provider.ts |   87.14 |      100 |      25 |   87.14 | ...96,100,104-105 
  ...h-provider.ts |   73.14 |    53.19 |     100 |   73.14 | ...04-811,818-820 
  ...en-storage.ts |    81.5 |    88.88 |   68.18 |    81.5 | ...95-196,201-202 
  oauth-utils.ts   |   72.19 |    85.29 |   91.66 |   72.19 | ...64-285,310-333 
  ...n-provider.ts |   87.87 |    94.73 |   33.33 |   87.87 | ...36,140,144-145 
  token-store.ts   |     100 |      100 |     100 |     100 |                   
 .../token-storage |   87.55 |    87.94 |   93.02 |   87.55 |                   
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   86.61 |    87.09 |   92.85 |   86.61 | ...64-172,180-181 
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   82.55 |    83.11 |   84.61 |   82.55 | ...60,262,314-315 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/parsers       |   68.08 |       75 |   83.33 |   68.08 |                   
  ...CallParser.ts |   68.08 |       75 |   83.33 |   68.08 | ...1018,1024-1039 
 src/policy        |    89.8 |    82.73 |    90.9 |    89.8 |                   
  config.ts        |   91.01 |    84.21 |     100 |   91.01 | ...05,150,155-157 
  index.ts         |     100 |      100 |     100 |     100 |                   
  policy-engine.ts |     100 |    97.67 |     100 |     100 | 23                
  ...-stringify.ts |   82.55 |     64.1 |      50 |   82.55 | ...22-126,139-140 
  toml-loader.ts   |   87.16 |    83.78 |     100 |   87.16 | ...03-204,215-223 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/prompt-config |   74.43 |    83.81 |   85.05 |   74.43 |                   
  ...lateEngine.ts |   91.75 |    85.91 |     100 |   91.75 | ...48-249,264-267 
  index.ts         |       0 |      100 |     100 |       0 | 5-41              
  prompt-cache.ts  |   99.06 |     97.4 |     100 |   99.06 | 211-212           
  ...-installer.ts |   83.11 |    82.47 |     100 |   83.11 | ...1173,1253-1254 
  prompt-loader.ts |   87.27 |    90.42 |   76.92 |   87.27 | ...22-423,429-430 
  ...t-resolver.ts |   34.85 |    64.17 |   53.84 |   34.85 | ...20-771,774-802 
  ...pt-service.ts |   82.35 |    83.33 |   78.94 |   82.35 | ...37,568,580-581 
  ...delegation.ts |   58.33 |       50 |     100 |   58.33 | 24-34             
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...onfig/defaults |   50.17 |    46.75 |     100 |   50.17 |                   
  core-defaults.ts |   37.54 |    39.02 |     100 |   37.54 | ...72,283,289-297 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...est-loader.ts |   81.81 |    79.31 |     100 |   81.81 | ...02-108,116-120 
  ...t-warnings.ts |      92 |    33.33 |     100 |      92 | 17-18             
  ...r-defaults.ts |    41.7 |    39.02 |     100 |    41.7 | ...40,251,257-262 
  ...e-defaults.ts |     100 |      100 |     100 |     100 |                   
  tool-defaults.ts |      50 |       40 |     100 |      50 | ...11-216,229-234 
 src/prompts       |   26.41 |      100 |      25 |   26.41 |                   
  mcp-prompts.ts   |   18.18 |      100 |       0 |   18.18 | 11-19             
  ...t-registry.ts |   28.57 |      100 |   28.57 |   28.57 | ...42,48-55,68-73 
 src/providers     |   68.76 |    77.55 |   67.21 |   68.76 |                   
  BaseProvider.ts  |   80.78 |    79.55 |   80.76 |   80.78 | ...1154,1191-1192 
  ...eratorRole.ts |     100 |      100 |     100 |     100 |                   
  IModel.ts        |       0 |        0 |       0 |       0 |                   
  IProvider.ts     |       0 |        0 |       0 |       0 |                   
  ...derManager.ts |     100 |      100 |     100 |     100 |                   
  ITool.ts         |       0 |        0 |       0 |       0 |                   
  ...ngProvider.ts |   87.91 |     89.6 |   90.62 |   87.91 | ...1106,1137-1139 
  ...derWrapper.ts |   56.67 |    63.86 |   51.28 |   56.67 | ...1356,1363-1370 
  ...tGenerator.ts |    17.3 |      100 |       0 |    17.3 | ...59,62-79,82-85 
  ...derManager.ts |   60.16 |    73.07 |   60.46 |   60.16 | ...1437-1438,1441 
  errors.ts        |   78.57 |    63.63 |      60 |   78.57 | ...43,150-170,191 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...ders/anthropic |   79.62 |    80.33 |   74.13 |   79.62 |                   
  ...icProvider.ts |   81.86 |     83.1 |    74.5 |   81.86 | ...2694,2702-2703 
  ...aConverter.ts |   52.53 |    44.11 |   71.42 |   52.53 | ...57,263,280-288 
 ...oviders/gemini |   56.39 |    67.94 |   48.78 |   56.39 |                   
  ...niProvider.ts |   51.86 |    56.97 |   46.15 |   51.86 | ...1866,1875-1876 
  ...Signatures.ts |     100 |    98.38 |     100 |     100 | 182               
 ...viders/logging |   39.53 |       80 |      75 |   39.53 |                   
  ...tExtractor.ts |       0 |        0 |       0 |       0 | 1-228             
  ...nceTracker.ts |   89.47 |    84.21 |   81.81 |   89.47 | ...66-167,182-183 
 ...oviders/openai |   51.43 |    74.53 |   60.49 |   51.43 |                   
  ...ationCache.ts |   70.49 |    86.66 |   82.35 |   70.49 | ...64-166,216-217 
  ...rateParams.ts |       0 |        0 |       0 |       0 |                   
  ...AIProvider.ts |   38.67 |    65.55 |   45.55 |   38.67 | ...4946,4954-4963 
  ...API_MODELS.ts |     100 |      100 |     100 |     100 |                   
  ...lCollector.ts |   93.33 |    89.28 |     100 |   93.33 | ...51-153,173-174 
  ...Normalizer.ts |   92.75 |       96 |     100 |   92.75 | 74-78             
  ...llPipeline.ts |   64.54 |    53.33 |      75 |   64.54 | ...34-143,174-184 
  ...eValidator.ts |   94.02 |    93.75 |     100 |   94.02 | 106-109           
  ...sesRequest.ts |   83.56 |    93.24 |     100 |   83.56 | ...60,293,298-303 
  ...moteTokens.ts |   89.55 |     92.3 |     100 |   89.55 | 101-107           
  ...oviderInfo.ts |    86.2 |    73.52 |     100 |    86.2 | ...31-133,144-145 
  ...uestParams.ts |   90.56 |    75.86 |     100 |   90.56 | ...15-116,118-119 
  ...nsesStream.ts |    88.7 |     87.5 |     100 |    88.7 | ...87,210-217,241 
  ...aConverter.ts |    24.2 |    42.85 |   28.57 |    24.2 | ...59-260,277-285 
  ...lResponses.ts |   71.98 |    73.91 |      75 |   71.98 | ...97-301,321-335 
  test-types.ts    |       0 |        0 |       0 |       0 |                   
  toolNameUtils.ts |   96.79 |    95.45 |      50 |   96.79 | 102,127,239-241   
 ...enai-responses |   64.92 |    75.65 |   43.75 |   64.92 |                   
  CODEX_MODELS.ts  |     100 |      100 |     100 |     100 |                   
  CODEX_PROMPT.ts  |   33.33 |      100 |       0 |   33.33 | 36-39             
  ...esProvider.ts |   76.92 |    79.68 |   54.54 |   76.92 | ...67,883,887-888 
  ...romContent.ts |   84.93 |    66.66 |     100 |   84.93 | 45-49,71-75,94    
  index.ts         |       0 |        0 |       0 |       0 | 1                 
  ...aConverter.ts |    8.12 |       20 |   14.28 |    8.12 | ...53-277,280-289 
 .../openai-vercel |   66.69 |    67.29 |   66.19 |   66.69 |                   
  ...elProvider.ts |   63.59 |       64 |   53.33 |   63.59 | ...1933,1943-1998 
  errors.ts        |   93.23 |    82.05 |     100 |   93.23 | ...50-151,165-169 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...Conversion.ts |   71.63 |    73.17 |   83.33 |   71.63 | ...45,548-549,553 
  ...aConverter.ts |   50.95 |       40 |   71.42 |   50.95 | ...58-259,276-284 
  toolIdUtils.ts   |     100 |      100 |     100 |     100 |                   
 ...ders/reasoning |    42.1 |       90 |      70 |    42.1 |                   
  ...oningUtils.ts |    42.1 |       90 |      70 |    42.1 | ...45-203,235-310 
 ...ers/test-utils |     100 |      100 |     100 |     100 |                   
  ...TestConfig.ts |     100 |      100 |     100 |     100 |                   
 ...ers/tokenizers |    66.1 |    55.55 |      75 |    66.1 |                   
  ...cTokenizer.ts |   57.89 |       25 |     100 |   57.89 | 28-29,34-39       
  ITokenizer.ts    |       0 |        0 |       0 |       0 |                   
  ...ITokenizer.ts |      70 |       80 |   66.66 |      70 | 52-55,62-71       
 ...roviders/types |       0 |        0 |       0 |       0 |                   
  ...iderConfig.ts |       0 |        0 |       0 |       0 |                   
  ...derRuntime.ts |       0 |        0 |       0 |       0 |                   
 ...roviders/utils |   86.69 |     87.5 |   95.65 |   86.69 |                   
  authToken.ts     |   33.33 |       50 |      50 |   33.33 | 14-22,30-35       
  ...sExtractor.ts |   95.45 |     91.3 |     100 |   95.45 | 15-16             
  dumpContext.ts   |    96.1 |    95.65 |     100 |    96.1 | 110-112           
  ...SDKContext.ts |   94.59 |       75 |     100 |   94.59 | 27,49             
  localEndpoint.ts |   89.28 |    91.42 |     100 |   89.28 | ...18-119,138-139 
  ...malization.ts |     100 |      100 |     100 |     100 |                   
  ...nsePayload.ts |   91.05 |    82.92 |     100 |   91.05 | 60-65,115-119     
  userMemory.ts    |   51.51 |    66.66 |     100 |   51.51 | 16-18,31-43       
 src/runtime       |   84.59 |     86.1 |   74.64 |   84.59 |                   
  ...imeContext.ts |     100 |      100 |     100 |     100 |                   
  ...timeLoader.ts |      85 |    71.42 |      80 |      85 | ...87-190,228-231 
  ...ntimeState.ts |   95.22 |    92.07 |     100 |   95.22 | ...35-636,652-653 
  ...ionContext.ts |   80.35 |    92.85 |      75 |   80.35 | 64-66,110-117     
  ...imeContext.ts |   90.09 |      100 |   61.53 |   90.09 | ...00,107,115-117 
  index.ts         |       0 |        0 |       0 |       0 | 1-15              
  ...imeContext.ts |    64.7 |    83.33 |     100 |    64.7 | 67-78,83-94       
  ...meAdapters.ts |   54.95 |    68.75 |   43.75 |   54.95 | ...98-108,125-152 
  ...ateFactory.ts |    96.9 |    86.48 |     100 |    96.9 | 95,110,136        
 src/services      |   81.67 |    84.79 |   76.19 |   81.67 |                   
  ...ardService.ts |   93.33 |    92.85 |     100 |   93.33 | 63,67-68          
  ...y-analyzer.ts |   76.32 |    81.17 |   77.77 |   76.32 | ...79-507,513-514 
  ...eryService.ts |   96.69 |    89.47 |     100 |   96.69 | 46,55,121-122     
  ...temService.ts |    61.9 |      100 |   66.66 |    61.9 | 54-61             
  ...ts-service.ts |      50 |      100 |       0 |      50 | 41-42,48-49       
  gitService.ts    |   70.58 |    93.33 |      60 |   70.58 | ...16-126,129-133 
  index.ts         |       0 |        0 |       0 |       0 | 1-15              
  ...ionService.ts |   99.04 |    98.41 |     100 |   99.04 | 270-271           
  ...ionService.ts |   89.31 |    84.21 |    92.3 |   89.31 | ...09,614,623-639 
  ...xt-tracker.ts |   94.87 |       90 |    87.5 |   94.87 | 54-55             
  ...er-service.ts |      42 |     90.9 |      25 |      42 | ...37-140,143-161 
  ...er-service.ts |   69.45 |    55.88 |      80 |   69.45 | ...85-289,311-314 
 ...rvices/history |   80.07 |    82.78 |   86.76 |   80.07 |                   
  ...Converters.ts |    77.2 |    77.14 |   71.42 |    77.2 | ...37-343,411-434 
  HistoryEvents.ts |       0 |        0 |       0 |       0 |                   
  ...oryService.ts |   79.63 |     83.7 |   86.79 |   79.63 | ...1369,1405-1406 
  IContent.ts      |   86.88 |    85.71 |     100 |   86.88 | ...30-231,235-238 
  ...calToolIds.ts |   96.82 |    92.59 |     100 |   96.82 | 36-37             
 src/settings      |   92.48 |    77.02 |      92 |   92.48 |                   
  ...ngsService.ts |   91.69 |       75 |   95.23 |   91.69 | ...53-354,384-388 
  ...ceInstance.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 src/storage       |   93.53 |    93.02 |   94.44 |   93.53 |                   
  ...FileWriter.ts |   83.54 |       80 |    87.5 |   83.54 | 40-41,71-81       
  ...nceService.ts |   98.67 |    96.96 |     100 |   98.67 | 293-294           
  sessionTypes.ts  |     100 |      100 |     100 |     100 |                   
 src/telemetry     |   65.57 |    83.06 |   60.33 |   65.57 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...-exporters.ts |   28.08 |        0 |       0 |   28.08 | ...14-115,118-119 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-17              
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-132             
  loggers.ts       |   63.35 |    69.76 |   59.25 |   63.35 | ...71-584,592-608 
  metrics.ts       |   62.35 |    96.15 |   66.66 |   62.35 | ...41-163,166-189 
  sdk.ts           |   72.54 |    23.07 |     100 |   72.54 | ...35,140-141,143 
  ...l-decision.ts |   33.33 |      100 |       0 |   33.33 | 17-32             
  types.ts         |   73.94 |    94.73 |   64.91 |   73.94 | ...34-636,639-643 
  uiTelemetry.ts   |   95.26 |    96.15 |   91.66 |   95.26 | 152,189-195       
 src/test-utils    |   86.74 |     82.5 |   57.47 |   86.74 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-9               
  mock-tool.ts     |   96.25 |    93.33 |   81.81 |   96.25 | 62-63,118         
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
  ...allOptions.ts |   93.45 |     90.9 |   63.63 |   93.45 | ...07,171,200-203 
  runtime.ts       |   80.18 |       70 |   39.53 |   80.18 | ...99-301,310-312 
  tools.ts         |      82 |    76.92 |   78.94 |      82 | ...31,153,157-158 
 src/todo          |   56.28 |    81.48 |      75 |   56.28 |                   
  todoFormatter.ts |   56.28 |    81.48 |      75 |   56.28 | ...11-212,236-237 
 src/tools         |   76.24 |    78.18 |   79.95 |   76.24 |                   
  ...lFormatter.ts |     100 |      100 |     100 |     100 |                   
  ToolFormatter.ts |   20.89 |    76.19 |   33.33 |   20.89 | ...07,514-612,627 
  ...IdStrategy.ts |   91.94 |    88.88 |     100 |   91.94 | ...55-258,267-270 
  codesearch.ts    |      98 |     87.5 |   85.71 |      98 | 110-111,173       
  ...line_range.ts |   84.68 |    67.56 |      70 |   84.68 | ...81-282,290-291 
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  ...-web-fetch.ts |   93.18 |    72.41 |   77.77 |   93.18 | ...56,166-167,187 
  ...scapeUtils.ts |   61.65 |    72.97 |      50 |   61.65 | ...93,309,311-321 
  edit.ts          |   74.83 |    78.35 |   76.47 |   74.83 | ...72-773,786-827 
  ...web-search.ts |   97.91 |    85.71 |   83.33 |   97.91 | 126-127,191       
  ...y-replacer.ts |   85.71 |    84.35 |     100 |   85.71 | ...47-448,493-494 
  glob.ts          |   90.51 |    80.35 |   88.88 |   90.51 | ...51-252,351-352 
  ...-web-fetch.ts |   92.44 |    87.37 |    92.3 |   92.44 | ...93-394,495-496 
  ...invocation.ts |   54.74 |    38.88 |      75 |   54.74 | ...29-133,165-210 
  ...web-search.ts |     100 |      100 |     100 |     100 |                   
  grep.ts          |   59.51 |    77.34 |   72.22 |   59.51 | ...67-971,981-982 
  ...rt_at_line.ts |   81.55 |    76.08 |      70 |   81.55 | ...05-306,314-315 
  ...-subagents.ts |   87.28 |    69.56 |   88.88 |   87.28 | ...1,81-89,98,153 
  ls.ts            |   97.33 |    91.07 |     100 |   97.33 | 146-151           
  ...nt-manager.ts |   79.04 |    66.66 |      80 |   79.04 | ...31-138,146-147 
  mcp-client.ts    |   54.67 |     60.8 |   58.06 |   54.67 | ...1342,1346-1349 
  mcp-tool.ts      |   94.21 |    93.75 |   86.95 |   94.21 | ...39-249,311-312 
  memoryTool.ts    |   79.39 |    82.75 |    87.5 |   79.39 | ...55-356,399-440 
  ...iable-tool.ts |   98.34 |       80 |     100 |   98.34 | 168-169           
  read-file.ts     |   91.36 |    79.72 |    90.9 |   91.36 | ...27-228,396-397 
  ...many-files.ts |   72.67 |    77.33 |   88.88 |   72.67 | ...23-524,531-532 
  ...line_range.ts |    74.9 |     65.9 |      80 |    74.9 | ...50-351,355-356 
  ripGrep.ts       |   89.75 |    86.02 |    92.3 |   89.75 | ...47-448,469-470 
  shell.ts         |   86.66 |    80.83 |   89.47 |   86.66 | ...69-771,784-785 
  task.ts          |   80.65 |    69.04 |   92.85 |   80.65 | ...89,792,795-804 
  todo-events.ts   |    62.5 |      100 |       0 |    62.5 | 23-24,27-28,31-32 
  todo-pause.ts    |   87.09 |       80 |     100 |   87.09 | 64-69,73-78,93-98 
  todo-read.ts     |   85.29 |    95.45 |     100 |   85.29 | 112-113,123-138   
  todo-schemas.ts  |     100 |      100 |     100 |     100 |                   
  todo-store.ts    |   86.66 |       80 |     100 |   86.66 | 48-49,55-56,63-64 
  todo-write.ts    |   87.28 |    75.75 |    87.5 |   87.28 | ...17,264-265,290 
  ...tion-types.ts |     100 |      100 |     100 |     100 |                   
  tool-context.ts  |     100 |      100 |     100 |     100 |                   
  tool-error.ts    |   87.75 |      100 |       0 |   87.75 | 105-112           
  tool-names.ts    |     100 |      100 |     100 |     100 |                   
  tool-registry.ts |   72.28 |       71 |   73.68 |   72.28 | ...68-676,684-685 
  toolNameUtils.ts |      80 |     92.1 |     100 |      80 | 59-60,64-65,69-82 
  tools.ts         |   67.74 |    91.37 |   66.66 |   67.74 | ...14-815,818-822 
  write-file.ts    |   75.57 |    64.36 |   73.33 |   75.57 | ...04-605,614-653 
 src/types         |     100 |      100 |     100 |     100 |                   
  modelParams.ts   |     100 |      100 |     100 |     100 |                   
 src/utils         |   80.14 |    86.21 |   84.29 |   80.14 |                   
  LruCache.ts      |       0 |        0 |       0 |       0 | 1-41              
  bfsFileSearch.ts |   88.88 |       90 |     100 |   88.88 | 83-91             
  browser.ts       |    8.69 |      100 |       0 |    8.69 | 17-53             
  delay.ts         |     100 |      100 |     100 |     100 |                   
  editor.ts        |   97.64 |    94.23 |     100 |   97.64 | 159,228,231-232   
  ...entContext.ts |     100 |      100 |     100 |     100 |                   
  errorParsing.ts  |      88 |    78.26 |     100 |      88 | ...07,249,252,258 
  ...rReporting.ts |   83.72 |    84.61 |     100 |   83.72 | 82-86,107-115     
  errors.ts        |   55.55 |    71.42 |   38.46 |   55.55 | ...92-108,112-118 
  events.ts        |     100 |      100 |     100 |     100 |                   
  fetch.ts         |   29.87 |    66.66 |      25 |   29.87 | ...37,40-84,87-92 
  fileUtils.ts     |    95.2 |       90 |     100 |    95.2 | ...34-238,450-456 
  formatters.ts    |   54.54 |       50 |     100 |   54.54 | 12-16             
  ...eUtilities.ts |   96.11 |       96 |     100 |   96.11 | 36-37,67-68       
  ...rStructure.ts |   95.96 |    94.93 |     100 |   95.96 | ...14-117,345-347 
  getPty.ts        |    12.5 |      100 |       0 |    12.5 | 21-34             
  ...noreParser.ts |    91.6 |    85.45 |     100 |    91.6 | ...05-206,210-211 
  ...ineChanges.ts |   58.56 |    79.41 |      80 |   58.56 | ...18-256,264-270 
  gitUtils.ts      |   90.24 |    90.47 |     100 |   90.24 | 40-41,71-72       
  ide-trust.ts     |      60 |      100 |       0 |      60 | 14-15             
  ...rePatterns.ts |     100 |    96.55 |     100 |     100 | 248               
  ...ionManager.ts |     100 |       90 |     100 |     100 | 23                
  ...edit-fixer.ts |       0 |        0 |       0 |       0 | 1-156             
  ...yDiscovery.ts |   86.23 |    76.66 |   77.77 |   86.23 | ...02-403,406-407 
  ...tProcessor.ts |    93.4 |    86.51 |    92.3 |    93.4 | ...87-388,397-398 
  ...Inspectors.ts |   61.53 |      100 |      50 |   61.53 | 18-23             
  output-format.ts |   36.36 |      100 |       0 |   36.36 | ...52-153,163-184 
  ...erCoercion.ts |   83.78 |    81.15 |     100 |   83.78 | ...79-180,242-243 
  partUtils.ts     |     100 |      100 |     100 |     100 |                   
  pathReader.ts    |       0 |        0 |       0 |       0 | 1-60              
  paths.ts         |   86.99 |    86.58 |     100 |   86.99 | ...22-223,237-238 
  ...rDetection.ts |   57.62 |    63.15 |     100 |   57.62 | ...9,92-93,99-100 
  retry.ts         |   68.36 |    78.26 |   81.81 |   68.36 | ...17-620,625-626 
  ...thResolver.ts |   84.87 |    83.87 |     100 |   84.87 | ...06,129,178-181 
  ...nStringify.ts |     100 |      100 |     100 |     100 |                   
  sanitization.ts  |     100 |      100 |     100 |     100 |                   
  ...aValidator.ts |   83.52 |    82.75 |     100 |   83.52 | 70-81,125-126     
  ...r-launcher.ts |   78.57 |     87.5 |   66.66 |   78.57 | ...33,135,153-188 
  session.ts       |     100 |      100 |     100 |     100 |                   
  shell-markers.ts |     100 |      100 |     100 |     100 |                   
  shell-parser.ts  |   26.31 |    55.55 |      50 |   26.31 | ...82-296,303-333 
  shell-utils.ts   |   86.64 |    90.34 |     100 |   86.64 | ...33-435,438-443 
  summarizer.ts    |     100 |    88.88 |     100 |     100 | 92                
  ...emEncoding.ts |   97.14 |    91.42 |     100 |   97.14 | 108-109,161       
  testUtils.ts     |   53.33 |      100 |   33.33 |   53.33 | ...53,59-64,70-72 
  textUtils.ts     |    12.5 |      100 |       0 |    12.5 | 15-34             
  thoughtUtils.ts  |     100 |      100 |     100 |     100 |                   
  tool-utils.ts    |   80.41 |    69.69 |     100 |   80.41 | ...25-126,136-137 
  ...putLimiter.ts |   85.22 |    76.31 |     100 |   85.22 | ...61-166,210-217 
  unicodeUtils.ts  |     100 |      100 |     100 |     100 |                   
  ...untManager.ts |   91.96 |    88.23 |     100 |   91.96 | 37-39,76-78,94-96 
  ...aceContext.ts |   96.82 |    95.34 |    92.3 |   96.82 | 94-95,109-110     
 ...ils/filesearch |   96.18 |    91.26 |     100 |   96.18 |                   
  crawlCache.ts    |     100 |      100 |     100 |     100 |                   
  crawler.ts       |   96.22 |     92.3 |     100 |   96.22 | 66-67             
  fileSearch.ts    |   93.22 |    86.95 |     100 |   93.22 | ...26-227,229-230 
  ignore.ts        |     100 |      100 |     100 |     100 |                   
  result-cache.ts  |     100 |    91.66 |     100 |     100 | 46                
-------------------|---------|----------|---------|---------|-------------------

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

@acoliver acoliver changed the title Fix issue #1150: Opus thinking blocks disappear after tool calls Fix Anthropic thinking with tool calls Jan 17, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)

1205-1287: Redaction policy can be bypassed when orphaned thinking is merged.
When stripFromContext = 'all' (or includeInContext = false), a tool_call message that borrows orphaned thinking will include the full thought because shouldRedactThinking only checks the current index. That leaks reasoning back into the request and violates the redaction policy.

🐛 Suggested fix (propagate redaction to borrowed thinking)
-          // Check if this message's thinking should be redacted (stripped but preserved as placeholder)
-          const shouldRedactThinking =
-            redactedThinkingIndices.has(contentIndex);
+          // Track if we attach orphaned thinking from a previous message
+          let orphanedThinkingIndex: number | null = null;
@@
-                if (
-                  prevThinkingBlocks.length > 0 &&
-                  prevNonThinkingBlocks.length === 0
-                ) {
+                if (
+                  prevThinkingBlocks.length > 0 &&
+                  prevNonThinkingBlocks.length === 0
+                ) {
+                  orphanedThinkingIndex = contentIndex - i;
                   this.getLogger().debug(
                     () =>
                       `[AnthropicProvider] Found orphaned thinking block ${i} messages back, merging with tool_use message at index ${contentIndex}`,
                   );
                   anthropicThinkingBlocks = prevThinkingBlocks;
                   break;
                 }
               }
             }
           }
+
+          const shouldRedactThinking =
+            shouldStripAll ||
+            redactedThinkingIndices.has(contentIndex) ||
+            (orphanedThinkingIndex !== null &&
+              redactedThinkingIndices.has(orphanedThinkingIndex));
 
           if (anthropicThinkingBlocks.length > 0) {
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad2ae2a and ad3de35.

📒 Files selected for processing (2)
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2025-12-14T16:16:39.939Z
Learning: MiniMax M2 model (hf:MiniMax/MiniMax-M2) requires reasoning.stripFromContext set to "none" to preserve interleaved thinking tokens in conversation history, as dropping thinking content harms agent reliability.
📚 Learning: 2026-01-13T19:28:00.789Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
📚 Learning: 2025-12-18T14:06:22.557Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2025-12-18T14:06:22.557Z
Learning: OpenAIResponsesProvider (packages/core/src/providers/openai-responses/OpenAIResponsesProvider.ts) currently bypasses the ephemeral truncation system by using direct `JSON.stringify(toolResponseBlock.result)` and needs to be updated to support ephemeral settings like the other providers.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
📚 Learning: 2025-11-16T22:51:26.374Z
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
📚 Learning: 2025-12-14T16:16:39.939Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2025-12-14T16:16:39.939Z
Learning: MiniMax M2 model (hf:MiniMax/MiniMax-M2) requires reasoning.stripFromContext set to "none" to preserve interleaved thinking tokens in conversation history, as dropping thinking content harms agent reliability.

Applied to files:

  • packages/core/src/providers/anthropic/AnthropicProvider.ts
🧬 Code graph analysis (2)
packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts (3)
packages/core/src/test-utils/runtime.ts (1)
  • createProviderWithRuntime (82-108)
packages/core/src/providers/test-utils/providerTestConfig.ts (1)
  • TEST_PROVIDER_CONFIG (23-25)
packages/core/src/services/history/IContent.ts (2)
  • IContent (21-40)
  • ThinkingBlock (177-191)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
🔇 Additional comments (8)
packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts (7)

1-78: Solid SDK/prompt mocking setup.
Mocks keep the suite deterministic and isolate provider behavior.


79-146: Runtime + settings wiring looks correct.
The setup cleanly mirrors provider runtime usage and reasoning ephemerals.


147-158: Helper for provider call options is clean and reusable.
Nice way to keep tests concise and consistent.


160-230: Good coverage for long-lookback thinking presence.
This captures the regression scenario cleanly.


232-284: Covers non-thinking sourceField flow well.
Ensures reasoning remains enabled in mixed-source histories.


286-359: Redacted placeholder assertion is on point.
Validates Anthropic-required redacted_thinking insertion.


361-497: Complex multi-tool-call scenario is well exercised.
This test should prevent regressions in orphaned-thinking handling.

packages/core/src/providers/anthropic/AnthropicProvider.ts (1)

936-1020: Cross-message tool-call scan is a good guardrail.
The lookback + logging improves observability and preserves thinking continuity.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Anthropic extended thinking requires every assistant message to start
with a thinking/redacted_thinking block when thinking is enabled.
Previously we only merged thinking-only messages into subsequent
tool-call messages, causing 400 errors when the next message was
text-only.

Changes:
- AnthropicProvider: merge thinking-only AI messages into the next AI
  message regardless of whether it contains tool calls
- useGeminiStream: filter out functionCall parts when submitting tool
  responses to avoid creating duplicate tool_use blocks
- geminiChat: improved history normalization for tool interactions
- ContentConverters: preserve thinking block signatures during conversion

Fixes #1150
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)

1120-1186: Fix missing thinking block fallback for tool_use messages when thinking is enabled.

When shouldIncludeThinking is true and tool calls exist, the code only logs a warning if no signed thinking blocks are found (even after lookback). It then continues to emit tool_use without a preceding thinking or redacted_thinking block. This violates Anthropic's API contract: the assistant's message must start with a thinking block when extended thinking is enabled, or the API returns an invalid_request error.

Inject a redacted_thinking block with a signature hash as fallback in this scenario:

🛠️ Suggested fix
          if (
            anthropicThinkingBlocks.length === 0 &&
            shouldIncludeThinking &&
            toolCallBlocks.length > 0
          ) {
            this.getLogger().warn(
              () =>
                `[AnthropicProvider] Missing thinking blocks with signatures for tool_use message at index ${contentIndex}. Injecting redacted placeholder.`,
            );
+           const fallbackSignature = createHash('sha256')
+             .update(toolCallBlocks.map((tc) => tc.id).join(':'))
+             .digest('hex');
+           contentArray.push({
+             type: 'redacted_thinking',
+             data: fallbackSignature,
+           });
          }
♻️ Duplicate comments (1)
packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts (1)

30-43: Test union should include redacted_thinking to match usage.

The local AnthropicContentBlock union omits redacted_thinking, but later checks use it, which can trigger TS2367 in stricter configs.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d914933 and 6254d97.

📒 Files selected for processing (12)
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
  • packages/cli/src/ui/hooks/useGeminiStream.ts
  • packages/core/src/core/geminiChat.runtime.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/services/history/ContentConverters.test.ts
  • packages/core/src/services/history/ContentConverters.ts
  • packages/core/src/services/history/HistoryService.test.ts
  • packages/core/src/services/history/IContent.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150-repro.test.ts
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.
📚 Learning: 2026-01-13T19:28:00.789Z
Learnt from: acoliver
Repo: vybestack/llxprt-code PR: 0
File: :0-0
Timestamp: 2026-01-13T19:28:00.789Z
Learning: In the llxprt-code codebase (`packages/core/src/providers/anthropic/AnthropicProvider.ts`), Anthropic's API returns `contentBlock.input` as an already-parsed JavaScript object, not a JSON string. The code was incorrectly calling `JSON.stringify(contentBlock.input)` before passing it to `processToolParameters()`, which was designed for OpenAI-style string parameters. This causes arrays and other complex types to be corrupted into strings (e.g., `paths` array becomes a string `"[\"**/*.toml\"]"` instead of actual array). The fix is to use `contentBlock.input` directly without stringifying for Anthropic provider.

Applied to files:

  • packages/core/src/services/history/HistoryService.test.ts
  • packages/core/src/services/history/ContentConverters.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/services/history/ContentConverters.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
📚 Learning: 2025-11-16T22:51:26.374Z
Learnt from: e2720pjk
Repo: vybestack/llxprt-code PR: 583
File: packages/core/src/providers/openai/OpenAIProvider.ts:935-959
Timestamp: 2025-11-16T22:51:26.374Z
Learning: In the llxprt-code codebase (packages/core/src/providers/openai/OpenAIProvider.ts), tools like `run_shell_command` use internal streaming only for real-time UI updates during execution, but each tool execution produces exactly ONE final `ToolResponseBlock` containing the full result. The streaming chunks are never sent to the LLM and are not converted into multiple tool messages. The OpenAI Chat Completions API requires that each tool call (tool_call_id) corresponds to exactly one message with role 'tool', so duplicate tool response detection that removes subsequent tool messages with the same tool_call_id is correct and necessary for API compliance.

Applied to files:

  • packages/cli/src/ui/hooks/useGeminiStream.ts
  • packages/core/src/core/geminiChat.runtime.test.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.thinking.test.ts
  • packages/core/src/core/geminiChat.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.ts
  • packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
🧬 Code graph analysis (4)
packages/core/src/services/history/ContentConverters.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
packages/core/src/core/geminiChat.ts (2)
packages/core/src/services/history/IContent.ts (2)
  • ThinkingBlock (177-191)
  • IContent (21-40)
packages/core/src/services/history/ContentConverters.ts (1)
  • ContentConverters (36-455)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
packages/core/src/services/history/IContent.ts (1)
  • ThinkingBlock (177-191)
packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts (2)
packages/core/src/providers/anthropic/AnthropicProvider.ts (1)
  • AnthropicProvider (76-2624)
packages/core/src/services/history/IContent.ts (2)
  • IContent (21-40)
  • ThinkingBlock (177-191)
🔇 Additional comments (14)
packages/core/src/services/history/IContent.ts (1)

232-240: LGTM! Thinking block validation correctly enforces signature requirements.

The validation logic properly distinguishes between Anthropic thinking blocks (which require signatures per the API contract) and other thinking sources. The early return for empty thoughts is a good defensive check.

packages/core/src/services/history/HistoryService.test.ts (1)

746-759: LGTM! Good coverage for the new unsigned thinking block validation.

This test correctly verifies that Anthropic thinking blocks (identified by sourceField: 'thinking') without a signature are treated as invalid content and filtered from curated history. This aligns with the validation changes in IContent.ts.

packages/cli/src/ui/hooks/useGeminiStream.ts (1)

1423-1428: LGTM! Correct filtering of functionCall parts from tool response submission.

This change properly prevents functionCall parts from being resent when submitting tool responses as a continuation. Tool calls originate from the model and should not be included in user/tool role messages sent back to the API. The filtering ensures only functionResponse and other relevant parts are submitted.

packages/core/src/core/geminiChat.runtime.test.ts (2)

278-369: LGTM! Comprehensive test for thinking block retention with tool calls.

This test correctly verifies that when reasoning.includeInContext is enabled, thinking blocks are preserved alongside tool calls in the curated history. The test:

  • Mocks a response containing both thinking and tool_call blocks
  • Verifies the thinking block appears in the same history entry as the tool call
  • Uses appropriate assertions to confirm the expected behavior

This provides good coverage for the PR's objective of preserving thinking visibility across tool-call turns.


137-138: LGTM! Setting reasoning.includeInContext to true enables thinking block preservation for this test context.

packages/cli/src/ui/hooks/useGeminiStream.test.tsx (2)

687-784: LGTM! Excellent test coverage for the functionCall filtering behavior.

This test properly validates that when tool responses are submitted:

  1. functionCall parts are filtered out from the payload
  2. functionResponse and text parts are retained and sent to the stream

The test setup mirrors realistic scenarios where response parts may contain both the original function call and its response, ensuring the implementation correctly handles this case.


543-543: LGTM! Adding explicit errorType: undefined satisfies the interface requirements and makes the test fixtures type-complete.

packages/core/src/services/history/ContentConverters.test.ts (4)

2-7: LGTM! Import addition of ThinkingBlock enables proper type assertions in the new thinking-related tests.


187-214: LGTM! Good test coverage for thinking signature preservation from Gemini content.

This test verifies that when converting Gemini content with thinking parts to IContent:

  • The thoughtSignature maps to signature
  • The thought: true indicator results in sourceField: 'thought'
  • The thought text is preserved correctly

216-243: LGTM! Proper test for Anthropic thinking metadata preservation.

This test correctly validates that explicit llxprtSourceField: 'thinking' metadata (used for Anthropic thinking blocks) is preserved during Gemini→IContent conversion, ensuring cross-provider thinking block handling works correctly.


369-392: LGTM! Comprehensive test for IContent→Gemini thinking conversion.

This test verifies the reverse direction: when converting IContent with a ThinkingBlock back to Gemini format:

  • signature maps to thoughtSignature
  • sourceField: 'thinking' maps to llxprtSourceField: 'thinking'
  • thought: true is set on the part

This completes the round-trip test coverage for thinking block metadata.

packages/core/src/services/history/ContentConverters.ts (1)

109-125: Thinking metadata propagation looks solid.

The updated mapping preserves signature and sourceField cleanly in both directions.

Also applies to: 228-241

packages/core/src/providers/anthropic/AnthropicProvider.issue1150.test.ts (1)

160-291: Good regression coverage for issue #1150 scenarios.

The multi-turn/tool-call test setup looks thorough and aligns well with the bug’s reproduction cases.

packages/core/src/core/geminiChat.ts (1)

165-179: Thought-part handling and history attachment look good.

The ThoughtPart guard + thought-block extraction/attachment aligns with includeInContext behavior and keeps history consistent.

Also applies to: 2509-2615

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer:e2e:ok Trusted contributor; maintainer-approved E2E run required for 0.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opus seems to stop thinking after the first few messages

2 participants