Skip to content

Conversation

@acoliver
Copy link
Collaborator

@acoliver acoliver commented Jan 2, 2026

Summary

This PR fixes two related issues with authentication state management and provider switching:

Issue #975: OAuth logout does not invalidate cached tokens

Problem: When using OAuth authentication (e.g., Anthropic OAuth), logging out and logging back in with a different account did not take effect until switching away from the provider and back. The old credentials continued to be used for API calls due to multiple caching layers that weren't properly invalidated.

Root Cause: The auth system has runtime-scoped state caching (legacy-singleton, provider-manager-singleton, and runtime-specific IDs). On logout, only the current runtime's cache was flushed, leaving stale tokens in other scopes.

Solution:

  1. Added invalidateCache() method to AuthPrecedenceResolver that flushes all known runtime scopes
  2. Updated BaseProvider.clearAuthCache() to call the resolver's invalidateCache() (was previously a no-op)
  3. Enhanced OAuthManager.clearProviderAuthCaches() to flush all known runtime scopes

Issue #974: Provider switching improperly clears context

Problem: When switching providers (e.g., OpenAI → Anthropic → OpenAI), context-related ephemeral settings like context-limit, max_tokens, and streaming were being cleared, causing unexpected behavior.

Root Cause: switchActiveProvider() cleared ALL ephemeral settings except activeProvider, without considering which settings should persist across switches.

Solution:

  1. Added DEFAULT_PRESERVE_EPHEMERALS constant with context-related settings that should persist
  2. Modified switchActiveProvider() to merge default preserved ephemerals with any caller-specified ones

Changes

packages/core/src/auth/precedence.ts

  • Added invalidateCache() method to AuthPrecedenceResolver

packages/core/src/providers/BaseProvider.ts

  • Updated clearAuthCache() to call resolver's invalidateCache()

packages/cli/src/auth/oauth-manager.ts

  • Enhanced clearProviderAuthCaches() to flush all known runtime scopes

packages/cli/src/runtime/runtimeSettings.ts

  • Added DEFAULT_PRESERVE_EPHEMERALS constant
  • Updated switchActiveProvider() to preserve context-related settings

Test Coverage

Testing

  • ✅ All 2547+ tests pass
  • ✅ Lint passes
  • ✅ TypeCheck passes
  • ✅ Format passes
  • ✅ Build succeeds
  • ✅ Manual test with synthetic profile: node scripts/start.js --profile-load synthetic "write me a haiku"

Closes

closes #975
closes #974

Summary by CodeRabbit

  • Bug Fixes

    • Logout now fully clears cached authentication across all runtime contexts, preventing stale in-memory tokens.
    • Provider switching preserves essential ephemeral settings (context-limit, max tokens, streaming) so key preferences survive switches.
  • Tests

    • Added tests validating authentication cache invalidation and provider-context preservation across provider switches.

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

This commit fixes two related issues with authentication and provider switching:

Issue #975: OAuth logout does not invalidate cached tokens
- Added invalidateCache() method to AuthPrecedenceResolver that flushes
  all known runtime scopes (legacy-singleton, provider-manager-singleton,
  and the current runtime context)
- Updated BaseProvider.clearAuthCache() to call the resolver's
  invalidateCache() instead of being a no-op
- Enhanced OAuthManager.clearProviderAuthCaches() to flush all known
  runtime scopes, not just the current runtime context

Issue #974: Provider switching improperly clears context
- Added DEFAULT_PRESERVE_EPHEMERALS constant with context-related settings
  (context-limit, max_tokens, streaming)
- Modified switchActiveProvider() to merge default preserved ephemerals
  with any caller-specified ones, ensuring user preferences persist
  across provider switches

Both fixes include comprehensive test coverage to prevent regressions.

closes #975
closes #974
@github-actions github-actions bot added the maintainer:e2e:ok Trusted contributor; maintainer-approved E2E run label Jan 2, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Walkthrough

Adds multi-scope OAuth cache invalidation on logout and preserves a default set of ephemeral runtime settings across provider switches to avoid stale tokens and unintended context clearing.

Changes

Cohort / File(s) Summary
OAuth logout & cache invalidation
packages/cli/src/auth/oauth-manager.ts, packages/core/src/auth/precedence.ts, packages/core/src/providers/BaseProvider.ts
Logout now flushes runtime auth scopes for multiple known runtime IDs (legacy singleton, provider-manager singleton, and active runtime context when available). AuthPrecedenceResolver gains invalidateCache(); BaseProvider.clearAuthCache() calls it. Per-scope errors are logged without aborting logout.
OAuth logout tests
packages/core/src/auth/oauth-logout-cache-invalidation.spec.ts
New tests validate that logout invalidates in-memory caches so subsequent auth resolution fetches fresh tokens and that invalidateCache() is usable via provider cache-clear paths.
Provider-switch ephemeral preservation
packages/cli/src/runtime/runtimeSettings.ts
Adds DEFAULT_PRESERVE_EPHEMERALS = ['context-limit', 'max_tokens', 'streaming']. switchActiveProvider() accepts preserveEphemerals?: string[] and merges caller-specified keys with the defaults to preserve these ephemerals across provider switches.
Provider context preservation tests
packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts
New tests for Issue #974 asserting that context-limit, max_tokens, and streaming are preserved across provider switches while other ephemeral settings are cleared.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant CLI as CLI / Command
participant OAuthMgr as OAuthManager
participant Provider as BaseProvider
participant AuthRes as AuthPrecedenceResolver
participant Runtime as Runtime scopes/store

CLI->>OAuthMgr: auth logout()
OAuthMgr->>OAuthMgr: remove token from tokenStore
OAuthMgr->>Provider: clearProviderAuthCaches()
Provider->>AuthRes: clearAuthCache() / invalidateCache()
Note right of AuthRes #DDEBF7: iterate knownRuntimeIds (legacy, provider-manager, active)
AuthRes->>Runtime: flushRuntimeAuthScope(runtimeId) (per-id)
Runtime-->>AuthRes: success / error (logged)
AuthRes-->>Provider: done
Provider-->>OAuthMgr: cache-clear complete
OAuthMgr-->>CLI: logout finished

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 I hopped through code with nimble paws,

flushed old tokens from hidden draws,
kept context keys the hop preserved,
fresh logins now are rightly served,
carrots, cookies, and fewer flaws.

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely summarizes the main changes: fixing two related OAuth/provider issues (#975, #974) with specific focus on cache invalidation and ephemeral preservation.
Description check ✅ Passed PR description comprehensively covers objectives, root causes, solutions, file changes, and test coverage. All key sections present with clear explanations and testing results.
Linked Issues check ✅ Passed Changes fully address both linked issues: #975 fixed via invalidateCache() and enhanced clearProviderAuthCaches(); #974 fixed via DEFAULT_PRESERVE_EPHEMERALS and switchActiveProvider() updates with comprehensive test coverage.
Out of Scope Changes check ✅ Passed All code changes directly align with resolving the two linked issues; no unrelated modifications or refactoring detected in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings

📜 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 5f93680 and d405998.

📒 Files selected for processing (2)
  • packages/core/src/auth/oauth-logout-cache-invalidation.spec.ts
  • packages/core/src/auth/precedence.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core/src/auth/precedence.ts
  • packages/core/src/auth/oauth-logout-cache-invalidation.spec.ts
⏰ 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 (macOS)
  • GitHub Check: Slow E2E - Win
  • GitHub Check: E2E Test (Linux) - sandbox:docker

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
Copy link
Contributor

github-actions bot commented Jan 2, 2026

I'll analyze this PR that addresses two authentication and provider switching issues. Let me first understand the changes and then provide a structured review.

Thanks for providing that PR summary and files! I now have a good understanding of the issues being fixed. Let me analyze the implementation and provide feedback on the quality of this PR.

This PR addresses two important authentication and provider switching issues. Here's my analysis:

Issue #975: OAuth logout cache invalidation

Problem: OAuth logout wasn't properly invalidating cached tokens, causing stale credentials to persist across provider switches until you switched away and back.

Root Cause: Multiple caching layers (legacy-singleton, provider-manager-singleton, and runtime-specific scopes) existed but only the current runtime's cache was flushed during logout.

Solution:

  1. Added invalidateCache() method to AuthPrecedenceResolver that flushes all known runtime scopes
  2. Updated BaseProvider.clearAuthCache() to call the resolver's invalidateCache() (was previously a no-op)
  3. Enhanced OAuthManager.clearProviderAuthCaches() to flush all known runtime scopes

Key Implementation:

// precedence.ts - added invalidateCache method
invalidateCache?(): void {
  // Flush all known runtime scopes
  this.flushKnownRuntimeScopes();
}

// BaseProvider.ts - updated clearAuthCache
clearAuthCache(): void {
  this.authResolver.invalidateCache?.();
}

// oauth-manager.ts - enhanced cache clearing
const runtimeId = runtimeContext?.runtimeId;
if (runtimeId) {
  flushRuntimeAuthScope(runtimeId); 
}

Issue #974: Provider switching context preservation

Problem: When switching providers, context-related ephemeral settings like context-limit, max_tokens, and streaming were being cleared unexpectedly.

Root Cause: switchActiveProvider() cleared ALL ephemeral settings except activeProvider, without considering which settings should persist.

Solution:

  1. Added DEFAULT_PRESERVE_EPHEMERALS constant with context-related settings
  2. Modified switchActiveProvider() to merge default preserved ephemerals with any caller-specified ones

Key Implementation:

// runtimeSettings.ts - added preserved ephemerals
const DEFAULT_PRESERVE_EPHEMERALS = [
  'context-limit',
  'max_tokens', 
  'streaming',
];

export async function switchActiveProvider(providerName: string, options = {}) {
  const preserveEphemerals = [
    ...DEFAULT_PRESERVE_EPHEMERALS,
    ...(options.preserveEphemerals ?? []),
  ];
  // ... rest of function
}

Test Coverage

The PR includes comprehensive test coverage:

  • oauth-logout-cache-invalidation.spec.ts - Tests cache invalidation across runtime scopes
  • provider-context-preservation.spec.ts - Tests context preservation during provider switches

The tests verify:

  • OAuth logout properly invalidates all runtime-scoped caches
  • BaseProvider can trigger resolver cache invalidation
  • Context-related settings are preserved during provider switches

Assessment

The fixes are well-designed and address the root causes:

  1. OAuth Cache Invalidation: The multi-layered caching approach is thoroughly addressed by invalidating all known scopes rather than just the current context.

  2. Context Preservation: The default preserved ephemerals list makes sense for user preferences that should persist across providers, while still allowing explicit override.

  3. Edge Cases: The implementations handle missing runtime contexts gracefully and maintain backward compatibility.

  4. Regressions: The changes are minimal and targeted, with the invalidateCache() method being optional to maintain compatibility.

The implementation follows existing code patterns and includes proper error handling. The test coverage appears comprehensive for the documented scenarios.

Overall, these are solid fixes that resolve the reported issues without introducing significant complexity or breaking changes.

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: 2

🧹 Nitpick comments (2)
packages/cli/src/runtime/runtimeSettings.ts (2)

1464-1476: Consider using const assertion for better type safety.

The constant is well-documented and addresses Issue #974 correctly. However, using a const assertion would provide compile-time immutability and better type inference.

🔎 Suggested improvement
-const DEFAULT_PRESERVE_EPHEMERALS = [
+const DEFAULT_PRESERVE_EPHEMERALS = [
   'context-limit',
   'max_tokens',
   'streaming',
-];
+] as const;

This prevents accidental mutations and provides stricter type checking while keeping the same runtime behavior.


1490-1494: Consider deduplicating the preserved ephemerals array.

The merge logic correctly implements the requirement to preserve default context-related settings. The current implementation allows potential duplicates if a caller specifies keys that are already in DEFAULT_PRESERVE_EPHEMERALS, though this doesn't cause functional issues.

🔎 Optional improvement to prevent duplicates
-  // Merge default preserved ephemerals with any caller-specified ones
-  const preserveEphemerals = [
-    ...DEFAULT_PRESERVE_EPHEMERALS,
-    ...(options.preserveEphemerals ?? []),
-  ];
+  // Merge default preserved ephemerals with any caller-specified ones (deduplicated)
+  const preserveEphemerals = [
+    ...new Set([
+      ...DEFAULT_PRESERVE_EPHEMERALS,
+      ...(options.preserveEphemerals ?? []),
+    ])
+  ];

This ensures each key appears only once, making the code more robust against future changes.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e1b7f4 and 5f93680.

📒 Files selected for processing (6)
  • packages/cli/src/auth/oauth-manager.ts
  • packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts
  • packages/cli/src/runtime/runtimeSettings.ts
  • packages/core/src/auth/oauth-logout-cache-invalidation.spec.ts
  • packages/core/src/auth/precedence.ts
  • packages/core/src/providers/BaseProvider.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Don't use any - Always specify proper types. Use unknown if the type is truly unknown and add proper type guards.
Do not use console.log or console.debug - Use the sophisticated logging system instead. Log files are written to ~/.llxprt/debug/
Fix all linting errors, including warnings about any types

Files:

  • packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts
  • packages/core/src/providers/BaseProvider.ts
  • packages/core/src/auth/precedence.ts
  • packages/core/src/auth/oauth-logout-cache-invalidation.spec.ts
  • packages/cli/src/auth/oauth-manager.ts
  • packages/cli/src/runtime/runtimeSettings.ts
🧠 Learnings (1)
📚 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/cli/src/runtime/runtimeSettings.ts
🧬 Code graph analysis (1)
packages/core/src/auth/precedence.ts (1)
packages/core/src/index.ts (2)
  • getActiveProviderRuntimeContext (266-266)
  • flushRuntimeAuthScope (82-82)
⏰ 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 (ubuntu-latest, 24.x)
  • GitHub Check: Test (windows-latest, 24.x)
  • GitHub Check: Test (macos-latest, 24.x)
  • GitHub Check: E2E Test (Linux) - sandbox:none
  • GitHub Check: E2E Test (Linux) - sandbox:docker
  • GitHub Check: Slow E2E - Win
  • GitHub Check: E2E Test (macOS)
🔇 Additional comments (3)
packages/core/src/providers/BaseProvider.ts (1)

478-493: LGTM! Well-implemented cache invalidation.

The updated clearAuthCache() method properly invokes authResolver.invalidateCache() with appropriate defensive checks. The documentation clearly describes the behavior change and references the relevant plan/requirement.

packages/cli/src/auth/oauth-manager.ts (1)

1386-1414: LGTM! Robust multi-scope cache invalidation.

The enhanced clearProviderAuthCaches() method properly:

  • Flushes multiple known runtime scopes (legacy-singleton, provider-manager-singleton, and current context)
  • Uses appropriate error handling for both context retrieval and individual scope flushing
  • Logs debug information without interrupting the logout flow
  • Aligns with the cache invalidation approach in the core precedence resolver
packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts (1)

1-106: LGTM! Well-structured tests for context preservation.

The test suite clearly documents and verifies the expected behavior for Issue #974:

  • Defines the list of context-related settings that should be preserved
  • Verifies that context-limit, max_tokens, and streaming are preserved during provider switches
  • Ensures that other ephemeral settings (like auth-key and temperature) are still cleared appropriately

The tests provide good documentation of the fix and will help prevent regressions.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Code Coverage Summary

Package Lines Statements Functions Branches
CLI 46.31% 46.31% 55.37% 75.34%
Core 69.97% 69.97% 72.55% 78.74%
CLI Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   46.31 |    75.34 |   55.37 |   46.31 |                   
 src               |   32.69 |    46.59 |      50 |   32.69 |                   
  gemini.tsx       |   14.72 |    66.66 |   28.57 |   14.72 | ...,285-1066,1074 
  ...ractiveCli.ts |   69.23 |    47.72 |   33.33 |   69.23 | ...50-251,284-292 
  ...liCommands.ts |   97.22 |       60 |     100 |   97.22 | 39-40             
  ...ActiveAuth.ts |      36 |    35.71 |      80 |      36 | ...64-169,186-195 
 src/auth          |   46.79 |    65.37 |   64.58 |   46.79 |                   
  ...andlerImpl.ts |   90.72 |    84.61 |   71.42 |   90.72 | ...48-149,155-159 
  ...henticator.ts |    92.3 |    95.23 |   66.66 |    92.3 | 80-88             
  ...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 |   42.02 |    53.79 |   70.83 |   42.02 | ...1560,1568-1769 
  ...h-provider.ts |   36.15 |    31.81 |      40 |   36.15 | ...52-490,498-534 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/commands      |   70.45 |      100 |      25 |   70.45 |                   
  extensions.tsx   |   55.55 |      100 |       0 |   55.55 | 21-31,35          
  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        |   84.74 |    79.57 |   79.06 |   84.74 |                   
  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.23 |    81.72 |      76 |   78.23 | ...1755,1758-1762 
  extension.ts     |   80.06 |    89.26 |   78.78 |   80.06 | ...87-788,791-792 
  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.59 |    75.73 |      72 |   86.59 | ...73-774,828-829 
  ...ingsSchema.ts |     100 |      100 |     100 |     100 |                   
  ...tedFolders.ts |   97.94 |    95.45 |     100 |   97.94 | 86,180-181        
 ...fig/extensions |    63.6 |     87.5 |   83.78 |    63.6 |                   
  ...Enablement.ts |   95.37 |    95.52 |     100 |   95.37 | ...87-189,233-235 
  github.ts        |   44.11 |    86.79 |   54.54 |   44.11 | ...57-344,395-448 
  update.ts        |   62.33 |    46.15 |   66.66 |   62.33 | ...19-145,161-169 
  ...ableSchema.ts |     100 |      100 |     100 |     100 |                   
  variables.ts     |   95.34 |    89.47 |     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.09 |    72.04 |   70.24 |   67.09 |                   
  ...imeAdapter.ts |   97.03 |    89.65 |     100 |   97.03 | ...38,344-345,541 
  ...etFailover.ts |   98.93 |    93.54 |     100 |   98.93 | 205               
  messages.ts      |      20 |      100 |       0 |      20 | ...0,38-66,74-102 
  ...pplication.ts |   82.64 |    71.31 |      70 |   82.64 | ...59-662,673-674 
  ...extFactory.ts |   91.28 |    72.41 |     100 |   91.28 | ...63-266,351-358 
  ...meSettings.ts |   55.44 |    66.55 |   56.06 |   55.44 | ...2169,2194-2248 
 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      |   60.13 |    76.19 |     100 |   60.13 |                   
  ...alSettings.ts |   59.58 |    77.55 |     100 |   59.58 | ...16-427,430-436 
  ...aramParser.ts |   71.42 |    57.14 |     100 |   71.42 | 21-22,24-25,30-31 
 src/test-utils    |   57.56 |    78.57 |   42.85 |   57.56 |                   
  ...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-37              
  ...e-testing.tsx |       0 |        0 |       0 |       0 | 1-54              
  ...iderConfig.ts |       0 |        0 |       0 |       0 | 1-19              
 src/ui            |    18.1 |    98.38 |   34.78 |    18.1 |                   
  App.tsx          |   33.89 |      100 |       0 |   33.89 | 49-85,91-98       
  AppContainer.tsx |    4.97 |      100 |       0 |    4.97 | 136-145,148-1837  
  ...tionNudge.tsx |    6.75 |      100 |       0 |    6.75 | 26-101            
  colors.ts        |   40.67 |      100 |   28.57 |   40.67 | ...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.72 |    75.32 |   63.95 |   65.72 |                   
  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 |   91.86 |    88.88 |     100 |   91.86 | 86-94,96          
  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 |   65.08 |    72.03 |      90 |   65.08 | ...08-913,932-945 
  ...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    |   81.68 |    77.27 |      80 |   81.68 | ...77-782,824-837 
  ...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 |   79.57 |    72.04 |   83.33 |   79.57 | ...67-880,883-896 
  ...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.82 |    35.95 |     2.5 |   10.82 |                   
  AboutBox.tsx     |    4.06 |      100 |       0 |    4.06 | 27-160            
  AsciiArt.ts      |     100 |      100 |     100 |     100 |                   
  AuthDialog.tsx   |    6.47 |      100 |       0 |    6.47 | 27-187            
  ...nProgress.tsx |   16.66 |      100 |       0 |   16.66 | 18-62             
  ...Indicator.tsx |   15.15 |      100 |       0 |   15.15 | 17-47             
  ...firmation.tsx |    7.43 |      100 |       0 |    7.43 | 45-177            
  ...tsDisplay.tsx |    7.69 |      100 |       0 |    7.69 | 23-34,38-156      
  CliSpinner.tsx   |   38.46 |      100 |       0 |   38.46 | 16-24             
  Composer.tsx     |   10.86 |      100 |       0 |   10.86 | 24-68             
  ...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.9 |      100 |       0 |    11.9 | 47-302            
  ...ngsDialog.tsx |    6.53 |      100 |       0 |    6.53 | 27-189            
  ...rBoundary.tsx |    9.48 |        0 |       0 |    9.48 | ...15-158,176-188 
  ...ustDialog.tsx |    15.9 |      100 |       0 |    15.9 | 31-121            
  Footer.tsx       |    8.94 |      100 |     100 |    8.94 | ...30-508,512-525 
  ...ngSpinner.tsx |   38.09 |      100 |       0 |   38.09 | 30-46             
  Header.tsx       |    17.5 |      100 |       0 |    17.5 | 22-62             
  Help.tsx         |    3.17 |      100 |       0 |    3.17 | 17-179            
  ...emDisplay.tsx |   18.32 |      100 |       0 |   18.32 | 50-180            
  InputPrompt.tsx  |   37.68 |    37.34 |   66.66 |   37.68 | ...5-883,897-1040 
  ...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.36 |      100 |       0 |    6.36 | 29-45,49-207      
  ...fications.tsx |   12.98 |      100 |       0 |   12.98 | 27-104            
  ...odeDialog.tsx |    7.31 |      100 |       0 |    7.31 | 30-140            
  ...ustDialog.tsx |    5.88 |      100 |       0 |    5.88 | 29-228            
  PrepareLabel.tsx |   13.33 |      100 |       0 |   13.33 | 20-48             
  ...derDialog.tsx |    3.84 |      100 |       0 |    3.84 | 22-272            
  ...delDialog.tsx |    2.99 |      100 |       0 |    2.99 | 23-361            
  ...eKeyInput.tsx |       0 |        0 |       0 |       0 | 1-98              
  ...ryDisplay.tsx |      50 |      100 |       0 |      50 | 15-17             
  ...ngsDialog.tsx |    1.87 |      100 |       0 |    1.87 | ...9-108,111-1258 
  ...ionDialog.tsx |   14.28 |      100 |       0 |   14.28 | 35-121            
  ...Indicator.tsx |   44.44 |      100 |       0 |   44.44 | 12-17             
  ...MoreLines.tsx |      28 |      100 |       0 |      28 | 18-40             
  StatsDisplay.tsx |     6.5 |      100 |       0 |     6.5 | ...84-159,167-336 
  ...nsDisplay.tsx |    7.76 |      100 |       0 |    7.76 | 49-164            
  ThemeDialog.tsx  |       5 |      100 |       0 |       5 | 34-328            
  Tips.tsx         |      16 |      100 |       0 |      16 | 17-45             
  TodoPanel.tsx    |    4.48 |      100 |       0 |    4.48 | ...20-345,348-511 
  ...tsDisplay.tsx |    7.51 |      100 |       0 |    7.51 | 30-53,56-225      
  ToolsDialog.tsx  |    8.23 |      100 |       0 |    8.23 | 23-115            
  ...ification.tsx |   36.36 |      100 |       0 |   36.36 | 15-22             
  ...ionDialog.tsx |    8.13 |      100 |       0 |    8.13 | 18-114            
  todo-utils.ts    |     100 |      100 |     100 |     100 |                   
 ...nents/messages |   13.12 |    85.71 |    7.14 |   13.12 |                   
  ...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 |   14.54 |      100 |       0 |   14.54 | 26-82             
  ...geContent.tsx |   19.04 |      100 |       0 |   19.04 | 25-43             
  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.36 |      100 |       0 |    8.36 | ...95-328,331-334 
  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 |   17.12 |     18.6 |   15.38 |   17.12 |                   
  ...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 |    7.61 |      100 |       0 |    7.61 | 44-152            
  ...lizedList.tsx |    2.04 |      100 |       0 |    2.04 | 55-485            
  text-buffer.ts   |   33.26 |     18.6 |   22.22 |   33.26 | ...1903-1906,1911 
  ...er-actions.ts |    0.78 |      100 |       0 |    0.78 | 26-39,78-814      
 ...mponents/views |    12.9 |      100 |       0 |    12.9 |                   
  ChatList.tsx     |    12.9 |      100 |       0 |    12.9 | 17-46             
 src/ui/constants  |   89.28 |      100 |       0 |   89.28 |                   
  ...ollections.ts |   89.28 |      100 |       0 |   89.28 | 224-245           
 src/ui/containers |       0 |        0 |       0 |       0 |                   
  ...ontroller.tsx |       0 |        0 |       0 |       0 | 1-341             
  UIStateShell.tsx |       0 |        0 |       0 |       0 | 1-15              
 src/ui/contexts   |   59.93 |    74.39 |      50 |   59.93 |                   
  ...chContext.tsx |    64.7 |      100 |      50 |    64.7 | 24-29             
  FocusContext.tsx |       0 |        0 |       0 |       0 | 1-11              
  ...ssContext.tsx |   83.02 |    79.02 |      92 |   83.02 | ...1231,1263-1266 
  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.51 |       25 |   28.57 |   46.51 | ...89,193-194,199 
  ...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 | 138-149,152-157   
  ...teContext.tsx |   27.77 |      100 |       0 |   27.77 | 182-191,194-199   
  ...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      |   19.65 |    43.04 |   17.17 |   19.65 |                   
  ...dProcessor.ts |    2.53 |        0 |       0 |    2.53 | 31,60-515         
  index.ts         |       0 |        0 |       0 |       0 | 1-10              
  ...dProcessor.ts |    13.2 |      100 |      50 |    13.2 | 33-61,79-308      
  ...dProcessor.ts |    2.67 |      100 |       0 |    2.67 | 73-714            
  ...Completion.ts |   22.22 |      100 |      50 |   22.22 | ...34-157,162-242 
  ...uthCommand.ts |    6.45 |      100 |       0 |    6.45 | 15-135            
  ...tIndicator.ts |    12.5 |      100 |       0 |    12.5 | 19-66             
  ...chedScroll.ts |   16.66 |      100 |       0 |   16.66 | 14-32             
  ...ketedPaste.ts |      20 |      100 |       0 |      20 | 20-38             
  ...ompletion.tsx |   53.04 |    27.27 |     100 |   53.04 | ...06-245,258-274 
  useCompletion.ts |   45.56 |      100 |     100 |   45.56 | ...8,52-77,81-107 
  ...leMessages.ts |       5 |      100 |       0 |       5 | 29-65,68-118      
  ...orSettings.ts |   11.11 |      100 |       0 |   11.11 | 29-81             
  ...AutoUpdate.ts |    9.52 |      100 |       0 |    9.52 | 18-58             
  ...ionUpdates.ts |    4.36 |      100 |       0 |    4.36 | 36-48,51-244      
  ...erDetector.ts |   22.72 |      100 |       0 |   22.72 | 27-43             
  useFocus.ts      |    25.8 |      100 |       0 |    25.8 | 19-48             
  ...olderTrust.ts |   10.46 |      100 |       0 |   10.46 | 24-112            
  ...miniStream.ts |   49.83 |    45.66 |      40 |   49.83 | ...1369,1394-1496 
  ...BranchName.ts |   11.66 |      100 |       0 |   11.66 | 14-79             
  ...oryManager.ts |    5.22 |      100 |       0 |    5.22 | 53-212            
  ...stListener.ts |   12.12 |      100 |       0 |   12.12 | 17-50             
  ...putHistory.ts |    3.75 |      100 |       0 |    3.75 | 24-111            
  ...storyStore.ts |    4.61 |      100 |       0 |    4.61 | 24-112            
  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 |   12.24 |      100 |       0 |   12.24 | 14-64             
  useLogger.ts     |   93.75 |      100 |     100 |   93.75 | 26                
  ...oryMonitor.ts |      25 |      100 |       0 |      25 | 19-41             
  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 |    9.43 |      100 |       0 |    9.43 | 24-80             
  ...cySettings.ts |    3.38 |      100 |       0 |    3.38 | 17-26,36-156      
  ...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 |   21.22 |    29.41 |   66.66 |   21.22 | ...74-479,481-491 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-7               
  useResponsive.ts |   28.57 |      100 |       0 |   28.57 | 23-33             
  ...ompletion.tsx |   69.56 |      100 |     100 |   69.56 | 45-47,51-66,78-81 
  ...ectionList.ts |    2.94 |      100 |       0 |    2.94 | ...01-229,243-448 
  useSession.ts    |       0 |        0 |       0 |       0 | 1-23              
  ...ngsCommand.ts |   18.75 |      100 |       0 |   18.75 | 10-25             
  ...ellHistory.ts |    6.48 |      100 |       0 |    6.48 | 22-70,73-138      
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-62              
  ...ompletion.tsx |   32.05 |    31.57 |      25 |   32.05 | ...89-797,822-860 
  ...leCallback.ts |       0 |        0 |       0 |       0 | 1-70              
  ...tateAndRef.ts |   59.09 |      100 |     100 |   59.09 | 23-31             
  ...oryRefresh.ts |   10.34 |      100 |       0 |   10.34 | 17-48             
  ...rminalSize.ts |   11.42 |      100 |       0 |   11.42 | 13-55             
  ...emeCommand.ts |    6.03 |      100 |       0 |    6.03 | 26-151            
  useTimer.ts      |    7.14 |      100 |       0 |    7.14 | 16-65             
  ...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            
  ...eMigration.ts |   10.34 |      100 |       0 |   10.34 | 14-72             
  vim.ts           |    6.13 |      100 |       0 |    6.13 | ...76-111,129-784 
 src/ui/layouts    |    5.44 |      100 |       0 |    5.44 |                   
  ...AppLayout.tsx |    5.44 |      100 |       0 |    5.44 | 57-74,77-629      
 ...noninteractive |      75 |      100 |    6.66 |      75 |                   
  ...eractiveUi.ts |      75 |      100 |    6.66 |      75 | 17-19,23-24,27-28 
 src/ui/privacy    |   26.08 |      100 |       0 |   26.08 |                   
  ...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 |   42.46 |      100 |       0 |   42.46 | 78-91,99-186      
  ...acyNotice.tsx |   21.95 |      100 |       0 |   21.95 | 20-59,62-64       
 src/ui/reducers   |   77.87 |     90.9 |      50 |   77.87 |                   
  appReducer.ts    |     100 |      100 |     100 |     100 |                   
  ...ionReducer.ts |       0 |        0 |       0 |       0 | 1-52              
 src/ui/state      |   21.51 |      100 |       0 |   21.51 |                   
  extensions.ts    |   21.51 |      100 |       0 |   21.51 | 68-130            
 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      |   44.08 |    86.39 |   63.11 |   44.08 |                   
  ...Colorizer.tsx |    5.88 |      100 |       0 |    5.88 | ...16-128,140-229 
  ...olePatcher.ts |      78 |    77.77 |     100 |      78 | 58-69             
  ...nRenderer.tsx |      10 |      100 |       0 |      10 | 26-155,164-173    
  ...wnDisplay.tsx |    6.02 |      100 |       0 |    6.02 | ...73-397,408-412 
  ...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  |   92.79 |    88.63 |     100 |   92.79 | ...11,115,117-118 
  computeStats.ts  |     100 |      100 |     100 |     100 |                   
  displayUtils.ts  |     100 |      100 |     100 |     100 |                   
  formatters.ts    |   90.47 |       95 |     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 |   12.34 |       50 |   16.66 |   12.34 | ...10-111,114-115 
  ...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.33 |     100 |     100 | 27,38             
 src/utils         |   52.96 |    89.69 |   85.43 |   52.96 |                   
  ...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 |     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 |   52.71 |    95.23 |      50 |   52.71 | 88-153            
  ...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       |       0 |        0 |       0 |       0 | 1-1161            
  ...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 |                   
  ...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.35 |        0 |       0 |   22.35 |                   
  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.43 |      100 |       0 |    4.43 | ...1442,1457-1507 
-------------------|---------|----------|---------|---------|-------------------
Core Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   69.97 |    78.74 |   72.55 |   69.97 |                   
 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.18 |     79.6 |      78 |   68.18 |                   
  codeAssist.ts    |   16.25 |       50 |   33.33 |   16.25 | ...1,80-87,95-108 
  converter.ts     |    94.9 |    93.02 |     100 |    94.9 | ...84,198,215-216 
  ...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/config        |   75.26 |    80.35 |    60.4 |   75.26 |                   
  config.ts        |   72.79 |    79.46 |   47.58 |   72.79 | ...1817,1823-1827 
  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 
  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 |   70.23 |    88.46 |   72.72 |   70.23 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-2               
  message-bus.ts   |   69.42 |    91.66 |      80 |   69.42 | ...91-225,234-242 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/core          |   65.04 |    72.85 |   68.76 |   65.04 |                   
  baseLlmClient.ts |   97.26 |       90 |     100 |   97.26 | 55-56,244-245     
  ...ntegration.ts |   96.29 |       95 |     100 |   96.29 | ...18-119,199-200 
  client.ts        |   66.92 |       79 |   69.23 |   66.92 | ...1988,1992-2003 
  ...ion-config.ts |     100 |      100 |     100 |     100 |                   
  ...tGenerator.ts |   91.08 |    80.76 |     100 |   91.08 | ...32,148,163-166 
  ...lScheduler.ts |   76.93 |       75 |   94.73 |   76.93 | ...1810,1814-1820 
  geminiChat.ts    |   45.03 |    53.72 |      50 |   45.03 | ...2680,2703-2704 
  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 |   63.28 |    62.74 |   65.21 |   63.28 | ...06-440,449-465 
  prompts.ts       |   65.07 |    62.96 |      60 |   65.07 | ...81,297,335-388 
  subagent.ts      |   55.76 |    65.87 |   58.49 |   55.76 | ...1820,1832-1833 
  ...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          |   88.42 |    73.21 |     100 |   88.42 | ...24-425,455-456 
 src/debug         |   78.24 |    87.85 |   90.19 |   78.24 |                   
  ...ionManager.ts |   78.12 |     77.5 |   88.88 |   78.12 | ...21-222,239-243 
  DebugLogger.ts   |   89.47 |    89.28 |      85 |   89.47 | ...77,214,270-273 
  FileOutput.ts    |   96.82 |    95.23 |     100 |   96.82 | 82-83,107-108     
  ...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.15 |    98.76 |     100 |   99.15 |                   
  EmojiFilter.ts   |   99.15 |    98.76 |     100 |   99.15 | 190-191           
 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.61 |      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 |    82.14 |     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.5 |    77.04 |   71.95 |    78.5 |                   
  ...oken-store.ts |   87.38 |    90.47 |   81.25 |   87.38 | ...33-334,337-338 
  ...h-provider.ts |   83.01 |      100 |      25 |   83.01 | ...69,73,77,81-82 
  ...h-provider.ts |   73.14 |    53.68 |     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   |   70.33 |    81.48 |    90.9 |   70.33 | ...62-283,308-331 
  ...n-provider.ts |   89.28 |    95.65 |      40 |   89.28 | ...37,141,145-146 
  token-store.ts   |     100 |      100 |     100 |     100 |                   
 .../token-storage |   90.08 |    86.86 |   95.34 |   90.08 |                   
  ...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 |   87.43 |    80.82 |    92.3 |   87.43 | ...20,222,274-275 
  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        |    88.1 |    81.29 |   86.95 |    88.1 |                   
  config.ts        |   91.01 |    84.21 |     100 |   91.01 | ...05,150,155-157 
  index.ts         |       0 |        0 |       0 |       0 | 1-5               
  policy-engine.ts |     100 |    97.67 |     100 |     100 | 23                
  ...-stringify.ts |   80.23 |    60.52 |      50 |   80.23 | ...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.73 |    84.16 |    87.8 |   74.73 |                   
  ...lateEngine.ts |    93.9 |    88.52 |     100 |    93.9 | ...29,165,172,192 
  index.ts         |       0 |      100 |     100 |       0 | 5-41              
  prompt-cache.ts  |   99.04 |    97.26 |     100 |   99.04 | 204-205           
  ...-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 |   84.49 |     83.5 |   93.75 |   84.49 | ...21,550,562-563 
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...onfig/defaults |   50.11 |    46.75 |     100 |   50.11 |                   
  core-defaults.ts |    37.3 |    39.02 |     100 |    37.3 | ...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     |   62.94 |    78.66 |   64.48 |   62.94 |                   
  BaseProvider.ts  |   80.78 |    79.46 |   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 |    88.61 |   90.62 |   87.91 | ...1106,1137-1139 
  ...derWrapper.ts |   32.82 |    70.51 |   38.46 |   32.82 | ...1268,1275-1282 
  ...tGenerator.ts |    17.3 |      100 |       0 |    17.3 | ...59,62-79,82-85 
  ...derManager.ts |   60.16 |    72.96 |   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 |   74.45 |    77.86 |   74.54 |   74.45 |                   
  ...icProvider.ts |   76.56 |    81.25 |      75 |   76.56 | ...2349,2357-2358 
  ...aConverter.ts |   51.61 |    40.62 |   71.42 |   51.61 | ...52,258,272-280 
 ...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 |    78.94 |      75 |   39.53 |                   
  ...tExtractor.ts |       0 |        0 |       0 |       0 | 1-228             
  ...nceTracker.ts |   89.47 |    83.33 |   81.81 |   89.47 | ...66-167,182-183 
 ...oviders/openai |   52.14 |    72.85 |   60.73 |   52.14 |                   
  ...ationCache.ts |   70.49 |    86.66 |   82.35 |   70.49 | ...64-166,216-217 
  ...rateParams.ts |       0 |        0 |       0 |       0 |                   
  ...AIProvider.ts |   39.86 |    62.33 |   46.15 |   39.86 | ...4922,4930-4939 
  ...API_MODELS.ts |     100 |      100 |     100 |     100 |                   
  ...lCollector.ts |   93.13 |    88.46 |     100 |   93.13 | ...46-148,168-169 
  ...Normalizer.ts |   92.64 |    95.83 |     100 |   92.64 | 71-75             
  ...llPipeline.ts |   64.22 |    53.33 |      75 |   64.22 | ...33-142,173-183 
  ...eValidator.ts |   94.02 |    93.75 |     100 |   94.02 | 106-109           
  ...sesRequest.ts |   83.09 |    93.15 |     100 |   83.09 | ...49,282,287-292 
  ...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 |   93.81 |     82.6 |     100 |   93.81 | ...,95-96,105-106 
  ...nsesStream.ts |   88.43 |    86.66 |     100 |   88.43 | ...80,203-210,234 
  ...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 |   62.63 |    72.72 |   43.33 |   62.63 |                   
  CODEX_MODELS.ts  |     100 |      100 |     100 |     100 |                   
  CODEX_PROMPT.ts  |      80 |       50 |     100 |      80 | 33-34             
  ...esProvider.ts |   74.07 |    77.35 |      50 |   74.07 | ...48,764,768-769 
  ...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.81 |    67.42 |   66.66 |   66.81 |                   
  ...elProvider.ts |   63.81 |     64.9 |   54.34 |   63.81 | ...1934,1944-1999 
  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   |   86.15 |    84.37 |     100 |   86.15 | ...,94-95,116-117 
 ...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 |   83.53 |    86.01 |   95.83 |   83.53 |                   
  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 |   79.41 |    92.85 |     100 |   79.41 | 59-66             
  ...nsePayload.ts |    83.8 |    78.12 |     100 |    83.8 | 31-39,69-71,85-89 
  userMemory.ts    |   51.51 |       60 |     100 |   51.51 | 16-18,31-43       
 src/runtime       |   84.52 |    85.93 |   74.28 |   84.52 |                   
  ...imeContext.ts |     100 |      100 |     100 |     100 |                   
  ...timeLoader.ts |      85 |    71.42 |      80 |      85 | ...87-190,228-231 
  ...ntimeState.ts |   95.22 |       92 |     100 |   95.22 | ...35-636,652-653 
  ...ionContext.ts |   80.35 |    92.85 |      75 |   80.35 | 64-66,110-117     
  ...imeContext.ts |   89.69 |      100 |   58.33 |   89.69 | ...96,103,111-113 
  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.62 |    84.03 |   76.19 |   81.62 |                   
  ...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.29 |    84.21 |     100 |   96.29 | 41,50,100-101     
  ...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 |   90.12 |    83.33 |   92.85 |   90.12 | ...63,568,577-593 
  ...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 |   78.94 |    82.63 |   77.77 |   78.94 |                   
  ...Converters.ts |   79.88 |    80.31 |      75 |   79.88 | ...58-364,430-453 
  HistoryEvents.ts |       0 |        0 |       0 |       0 |                   
  ...oryService.ts |   79.07 |    83.14 |   86.53 |   79.07 | ...1329,1365-1366 
  IContent.ts      |   73.56 |    92.85 |   36.36 |   73.56 | ...32,299,309-329 
 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       |   20.98 |      100 |       0 |   20.98 |                   
  ...FileWriter.ts |   18.98 |      100 |       0 |   18.98 | ...68,71-81,88-94 
  sessionTypes.ts  |     100 |      100 |     100 |     100 |                   
 src/telemetry     |    59.6 |    82.87 |   52.89 |    59.6 |                   
  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.18 |    70.73 |   55.55 |   63.18 | ...70-583,591-607 
  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         |   56.47 |    94.11 |   50.87 |   56.47 | ...34-636,639-643 
  uiTelemetry.ts   |   95.26 |    96.42 |   91.66 |   95.26 | 152,189-195       
 src/test-utils    |   86.57 |     82.5 |    59.3 |   86.57 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  index.ts         |       0 |        0 |       0 |       0 | 1-9               
  mock-tool.ts     |   95.06 |    93.33 |   83.33 |   95.06 | 62-63,118-119     
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
  ...allOptions.ts |   93.45 |     90.9 |   63.63 |   93.45 | ...07,171,200-203 
  runtime.ts       |      80 |       70 |   41.46 |      80 | ...97-299,308-310 
  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         |   74.36 |     78.1 |   77.94 |   74.36 |                   
  ...lFormatter.ts |     100 |      100 |     100 |     100 |                   
  ToolFormatter.ts |   20.89 |    76.19 |   33.33 |   20.89 | ...07,514-612,627 
  ...IdStrategy.ts |      95 |    92.85 |     100 |      95 | 237-239,250-252   
  codesearch.ts    |      98 |     87.5 |   85.71 |      98 | 110-111,173       
  ...line_range.ts |   33.55 |      100 |      25 |   33.55 | ...87-221,224-227 
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  ...-web-fetch.ts |   93.14 |    72.41 |   77.77 |   93.14 | ...55,165-166,186 
  ...scapeUtils.ts |   61.65 |    72.97 |      50 |   61.65 | ...93,309,311-321 
  edit.ts          |   74.66 |    78.03 |   76.47 |   74.66 | ...68-769,782-823 
  ...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 |   94.21 |    87.75 |    92.3 |   94.21 | ...66-367,468-469 
  ...invocation.ts |   54.74 |    38.88 |      75 |   54.74 | ...29-133,165-210 
  ...web-search.ts |     100 |      100 |     100 |     100 |                   
  grep.ts          |   59.01 |    77.34 |   72.22 |   59.01 | ...57-961,971-972 
  ...rt_at_line.ts |    30.3 |      100 |      25 |    30.3 | ...06-236,239-242 
  ...-subagents.ts |   87.28 |    69.56 |   88.88 |   87.28 | ...1,81-89,98,153 
  ls.ts            |   97.42 |    91.66 |     100 |   97.42 | 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.63 |    82.75 |    87.5 |   79.63 | ...55-356,399-439 
  ...iable-tool.ts |   98.34 |       80 |     100 |   98.34 | 168-169           
  read-file.ts     |   91.27 |    79.16 |    90.9 |   91.27 | ...26-227,393-394 
  ...many-files.ts |   71.42 |     77.5 |   88.88 |   71.42 | ...55-556,563-564 
  ...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         |   79.12 |    77.86 |   82.35 |   79.12 | ...96-697,708-709 
  task.ts          |   79.34 |     63.7 |    91.3 |   79.34 | ...10,613,616-625 
  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         |   79.03 |    89.28 |   66.66 |   79.03 | ...32-733,736-740 
  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         |   82.76 |    87.58 |    85.9 |   82.76 |                   
  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             
  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 
  fetch.ts         |   30.43 |    66.66 |   33.33 |   30.43 | 22-27,35-36,39-83 
  fileUtils.ts     |    95.2 |    90.07 |     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.18 |     100 |    91.6 | ...01-202,206-207 
  ...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 |    85.8 |    75.43 |   77.77 |    85.8 | ...88-389,392-393 
  ...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.84 |      100 |       0 |   36.84 | 26-37             
  partUtils.ts     |     100 |      100 |     100 |     100 |                   
  pathReader.ts    |       0 |        0 |       0 |       0 | 1-60              
  paths.ts         |   85.32 |    84.37 |     100 |   85.32 | ...,98-99,110-111 
  ...rDetection.ts |   57.62 |    63.15 |     100 |   57.62 | ...9,92-93,99-100 
  retry.ts         |   67.28 |    76.04 |   81.81 |   67.28 | ...19-522,527-528 
  ...thResolver.ts |   84.31 |       84 |     100 |   84.31 | 62-73,96,145-148  
  ...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-utils.ts   |   95.25 |    95.38 |     100 |   95.25 | ...94-195,326-331 
  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    |   91.48 |    89.47 |     100 |   91.48 | 52-53,56-57       
  ...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
Copy link
Collaborator Author

acoliver commented Jan 2, 2026

@CodeRabbit I dont understand how this means the context (aka HistoryService) won't be cleared. I'm not clear why we would preserve the ephemeral? That seems counterproductive and irrelevant to the actual issue that switching means the History is basically cleared (aka the context) or am I missing something?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the switchActiveProvider function implementation
echo "=== switchActiveProvider implementation ==="
ast-grep --pattern $'export async function switchActiveProvider($$$) {
  $$$
}'

echo -e "\n=== Looking for DEFAULT_PRESERVE_EPHEMERALS ==="
rg -n "DEFAULT_PRESERVE_EPHEMERALS" -A 5 -B 2

echo -e "\n=== Checking what happens to history during provider switch ==="
rg -n "history|History" packages/cli/src/runtime/runtimeSettings.ts -C 3

Length of output: 4826


🏁 Script executed:

#!/bin/bash
# Read the test file to understand what's actually being tested
echo "=== provider-context-preservation.spec.ts ==="
cat packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts

Length of output: 3685


🏁 Script executed:

#!/bin/bash
# Search for HistoryService and how it's used during provider switching
echo "=== HistoryService usage ==="
fd -e ts HistoryService

echo -e "\n=== Checking how HistoryService is affected by provider switching ==="
rg -n "HistoryService" packages/cli/src/runtime/runtimeSettings.ts -C 5

Length of output: 210


🏁 Script executed:

#!/bin/bash
# Look for the original issue #974 description
echo "=== Issue #974 ==="
gh issue view 974 --repo vybestack/llxprt-code

Length of output: 1089


🏁 Script executed:

#!/bin/bash
# Read the full switchActiveProvider function implementation
echo "=== Full switchActiveProvider implementation ==="
rg -n "export async function switchActiveProvider" packages/cli/src/runtime/runtimeSettings.ts -A 150

echo -e "\n=== Check for history clearing in the function ==="
rg -n "clearHistory|clear.*history|reset.*history" packages/cli/src/runtime/runtimeSettings.ts -C 3

Length of output: 5615


🏁 Script executed:

#!/bin/bash
# Look at the runtime context and how it manages history
echo "=== Runtime context structure ==="
rg -n "interface.*RuntimeContext|type.*RuntimeContext" packages/cli/src/runtime/ -A 20

echo -e "\n=== How history is stored in runtime ==="
rg -n "\.history|history:" packages/cli/src/runtime/runtimeSettings.ts -C 3

Length of output: 8906


🏁 Script executed:

#!/bin/bash
# Check what getEphemeralKeys returns to understand what's considered "ephemeral"
echo "=== Ephemeral settings ==="
rg -n "getEphemeralKeys|ephemeralKeys" packages/cli/src/runtime/runtimeSettings.ts -C 5

Length of output: 26


🏁 Script executed:

#!/bin/bash
# Search for where HistoryService is used and if it's cleared anywhere
echo "=== HistoryService implementation ==="
cat packages/core/src/services/history/HistoryService.ts | head -100

echo -e "\n=== Searching for history clearing ==="
rg -n "\.clear\(\)|clearHistory|resetHistory|history.*clear" --type ts -C 3

echo -e "\n=== Check if history is part of config or separate ==="
rg -n "HistoryService|history.*service" packages/cli/src/runtime/ -C 2

Length of output: 67372


🏁 Script executed:

#!/bin/bash
# Look at the issue comments to understand what the reporter actually experienced
echo "=== Issue #974 comments ==="
gh issue view 974 --repo vybestack/llxprt-code --comments

Length of output: 15055


🏁 Script executed:

#!/bin/bash
# Search for what "context" means in the codebase - is it settings or conversation?
echo "=== Usage of 'context-limit' setting ==="
rg -n "context-limit" --type ts -C 2 | head -50

echo -e "\n=== Looking for conversation context vs settings context ==="
rg -n "conversation.*context|context.*conversation" --type ts -C 2 | head -30

Length of output: 6786


@acoliver Great question! I can see the confusion here. Let me clarify what's actually happening:

The Real Problem

The issue isn't that HistoryService (conversation messages) is being directly cleared during provider switching. Looking at the code, HistoryService.clear() is never called during a provider switch.

Instead, here's what's happening:

  1. context-limit and max_tokens are ephemeral settings that control how much conversation history HistoryService keeps in memory
  2. During provider switching, switchActiveProvider() clears ALL ephemeral settings except activeProvider (lines 1536-1544 in runtimeSettings.ts)
  3. When these settings are cleared, HistoryService's curation logic sees that the context limits have changed (possibly to smaller defaults) and truncates the conversation history to fit within the new limits
  4. Result: The conversation appears to be lost, even though it was truncation due to settings loss, not a direct clear

Why This Fix Works

By preserving context-limit, max_tokens, and streaming across provider switches with DEFAULT_PRESERVE_EPHEMERALS, the history curation system maintains the same limits throughout the switch, preventing the truncation that made it look like context was lost.

From CodeRabbit's Analysis

In the issue comments, CodeRabbit explained it well:

"keys are cleared unless explicitly preserved... so after the switch the curated transcript can shrink abruptly"

"the observed 'lost context' is the curated history being emptied/truncated rather than the convId being reset"

So the fix is correct - it preserves the context-sizing settings that prevent history truncation during provider switches. The conversation history itself stays intact; we're just preventing the settings that control its size from being lost.

Does this clarify the mechanism? The terminology "context" is admittedly confusing since it refers to both the conversation and the settings that control how much of it is kept!

@acoliver
Copy link
Collaborator Author

acoliver commented Jan 2, 2026

@CodeRabbit but it isnt acting like it was truncated. The model acts like it is clear. It does this even if the context wasn't full and the size is close.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Let's trace through what actually happens to the conversation/context during a provider switch

echo "=== Check if history is cleared or reset during provider switch ==="
rg -n "clear|reset" packages/cli/src/runtime/runtimeSettings.ts -C 3 | grep -A3 -B3 "history\|conversation\|context"

echo -e "\n=== Look for how context is passed to providers ==="
rg -n "getContext|context\(" packages/cli/src/runtime/runtimeSettings.ts -C 3

echo -e "\n=== Check if conversation ID is reset ==="
rg -n "conversationId|convId" packages/cli/src/runtime/runtimeSettings.ts -C 3

echo -e "\n=== Look at what the actual test file tests ==="
cat packages/cli/src/runtime/__tests__/provider-context-preservation.spec.ts

echo -e "\n=== Check how history service is initialized per provider ==="
rg -n "new HistoryService|HistoryService\(" --type ts -C 3 | head -40

echo -e "\n=== Look for provider-specific context storage ==="
rg -n "provider.*context|context.*provider" packages/core/src/providers/ --type ts -C 2 | head -50

Length of output: 11869


🏁 Script executed:

#!/bin/bash
# Check how the runtime context actually stores and manages history

echo "=== Runtime context interface ==="
rg -n "interface RuntimeContext" packages/cli/src/runtime/runtimeContext.ts -A 30

echo -e "\n=== Check if there are separate history instances per provider ==="
rg -n "historyService|history:" packages/cli/src/runtime/ --type ts -C 3 | head -60

echo -e "\n=== Look at what happens when we switch providers in practice ==="
rg -n "function.*switchActiveProvider" packages/cli/src/runtime/runtimeSettings.ts -A 80 | head -100

Length of output: 3348


🏁 Script executed:

#!/bin/bash
# Let's look at the actual Issue #974 description more carefully and any related code

echo "=== Check the switchActiveProvider function for ALL clearing operations ==="
ast-grep --pattern $'export async function switchActiveProvider($$$) {
  $$$
  clearEphemerals($$$);
  $$$
}'

echo -e "\n=== What does clearEphemerals do exactly? ==="
rg -n "function clearEphemerals|const clearEphemerals" packages/cli/src/runtime/runtimeSettings.ts -A 20

echo -e "\n=== Check if provider has its own history/context ==="
rg -n "this\.history|this\.context" packages/core/src/providers/BaseProvider.ts -C 3

Length of output: 177


🏁 Script executed:

#!/bin/bash
# Let's find out if history is stored per-provider or globally

echo "=== Find HistoryService instantiation in CLI runtime ==="
rg -n "new HistoryService|HistoryService\(\)" packages/cli/src/ --type ts -C 5

echo -e "\n=== Check if providers store their own history ==="
rg -n "historyService|this\.history" packages/core/src/providers/ --type ts -C 3 | head -80

echo -e "\n=== Look at ProviderManager to see if it creates new instances ==="
rg -n "setActiveProvider|getActiveProvider" packages/core/src/providers/ProviderManager.ts -C 10 | head -100

echo -e "\n=== Check if runtime context has history ==="
fd -e ts "runtimeContext" packages/cli/src/runtime/ --exec cat {}

Length of output: 14842


🏁 Script executed:

#!/bin/bash
# Check BaseProvider to see if it has history management

echo "=== BaseProvider class structure ==="
ast-grep --pattern $'export abstract class BaseProvider$$$implements$$${
  $$$
}'

echo -e "\n=== Look for history/context in BaseProvider ==="
cat packages/core/src/providers/BaseProvider.ts | grep -n "history\|context" -i | head -30

echo -e "\n=== Check provider runtime context ==="
rg -n "ProviderRuntimeContext|providerRuntimeContext" packages/core/src/providers/ --type ts -C 5 | head -60

Length of output: 6732


🏁 Script executed:

#!/bin/bash
# Let's look at how conversations and history are managed

echo "=== Search for conversation management ==="
rg -n "conversationId|convId" packages/core/src/providers/BaseProvider.ts -C 3

echo -e "\n=== Check if history is passed to provider methods ==="
rg -n "getCurated|history" packages/core/src/providers/BaseProvider.ts -C 5 | head -50

echo -e "\n=== Look at provider's processRequest or similar methods ==="
rg -n "processRequest|generate|chat" packages/core/src/providers/BaseProvider.ts -B 3 -A 10 | head -60

Length of output: 2503


🏁 Script executed:

#!/bin/bash
# Let's find where HistoryService is actually instantiated and stored

echo "=== Search for HistoryService in ProviderRuntimeContext ==="
cat packages/core/src/runtime/providerRuntimeContext.ts

echo -e "\n=== Search for history service in Config ==="
rg -n "historyService|HistoryService" packages/core/src/config/config.ts -C 3 | head -50

echo -e "\n=== Check how providers access history ==="
rg -n "getHistory|historyService" packages/core/src/providers/ --type ts | head -30

Length of output: 5570


🏁 Script executed:

#!/bin/bash
# Let's check if history is in the runtime services

echo "=== Look for HistoryService in runtime services ==="
rg -n "HistoryService" packages/cli/src/runtime/ --type ts -C 5

echo -e "\n=== Check getCliRuntimeServices ==="
rg -n "getCliRuntimeServices|RuntimeServices" packages/cli/src/runtime/runtimeSettings.ts -A 20 | head -60

Length of output: 2422


🏁 Script executed:

#!/bin/bash
# Let's look at the actual PR changes to understand what was being fixed

echo "=== Check what files were changed in this PR ==="
gh pr view 976 --repo vybestack/llxprt-code --json files --jq '.files[].path'

echo -e "\n=== Look at the actual diff for runtimeSettings.ts ==="
gh pr diff 976 --repo vybestack/llxprt-code -- packages/cli/src/runtime/runtimeSettings.ts | head -150

Length of output: 441


🏁 Script executed:

#!/bin/bash
# Let's look at GeminiClient to see how HistoryService is managed there

echo "=== Search for GeminiClient and HistoryService ==="
rg -n "class GeminiClient|getHistoryService|storeHistoryServiceForReuse" packages/core/src/ --type ts -C 5 | head -80

echo -e "\n=== Check if HistoryService is stored in provider instances ==="
rg -n "private.*historyService|this\.historyService" packages/core/src/providers/gemini/ --type ts -C 3 | head -50

Length of output: 5435


🏁 Script executed:

#!/bin/bash
# Let's understand the relationship between providers and history

echo "=== Check GeminiClient constructor ==="
fd -e ts "GeminiClient" packages/core/src/ --exec rg -n "constructor|new HistoryService" {} -C 5 | head -60

echo -e "\n=== Check if each provider maintains its own HistoryService ==="
rg -n "new HistoryService" packages/core/src/providers/ --type ts -C 5

Length of output: 103


🏁 Script executed:

#!/bin/bash
# Let's check what the user is actually reporting in issue #974

echo "=== Get full issue #974 description and comments ==="
gh issue view 974 --repo vybestack/llxprt-code --json body,comments --jq '.body, .comments[].body' | head -100

Length of output: 2385


🏁 Script executed:

#!/bin/bash
# Let's check what state gets cleared when switching providers

echo "=== Check clearState and clearAuthCache in ProviderManager ==="
rg -n "clearState|clearAuth" packages/core/src/providers/ProviderManager.ts -C 8

echo -e "\n=== Check what state providers maintain ==="
rg -n "clearState|clearAuth" packages/core/src/providers/BaseProvider.ts -A 10

Length of output: 2341


🏁 Script executed:

#!/bin/bash
# Let's see if history is stored globally or per-provider

echo "=== Check if HistoryService is in GeminiChat ==="
rg -n "class GeminiChat|historyService|HistoryService" packages/core/src/core/chat.ts -C 5 | head -80

echo -e "\n=== Check if chat is per-provider instance ==="
rg -n "this\.chat|new.*Chat|createChat" packages/core/src/core/client.ts -C 3 | head -60

Length of output: 2097


🏁 Script executed:

#!/bin/bash
# Let's understand what the switchActiveProvider ACTUALLY does to history

echo "=== Full setActiveProvider implementation ==="
ast-grep --pattern $'setActiveProvider($$$) {
  $$$
}'

echo -e "\n=== Check what clearState does ==="
rg -n "function clearState|clearState\(\)" packages/core/src/providers/ --type ts -A 15

Length of output: 5839


🏁 Script executed:

#!/bin/bash
# Let's check if conversation history is stored globally or per-provider

echo "=== Check where Anthropic stores conversation history ==="
rg -n "class.*Anthropic|conversation|history" packages/core/src/providers/anthropic/ --type ts -C 3 | head -80

echo -e "\n=== Check if Config stores per-provider history ==="
rg -n "getHistory|setHistory|conversationHistory" packages/core/src/config/config.ts -C 3 | head -50

echo -e "\n=== Check if conversation is passed between providers ==="
rg -n "contents.*history|conversation.*contents" packages/cli/src/runtime/runtimeSettings.ts -C 3

Length of output: 8355


🏁 Script executed:

#!/bin/bash
# Let's see if the actual conversation messages (IContent[]) are stored anywhere

echo "=== Check how conversation contents are managed ==="
rg -n "IContent\[\]|contents:|messages:" packages/core/src/providers/IProvider.ts -C 5

echo -e "\n=== Check if providers are stateless for conversations ==="
rg -n "stateless|conversation state|message history" packages/core/src/providers/BaseProvider.ts -C 3 | head -40

Length of output: 847


🏁 Script executed:

#!/bin/bash
# Critical: Let's see what actually gets passed to generateChatCompletion

echo "=== Check GenerateChatOptions interface ==="
rg -n "interface GenerateChatOptions|type GenerateChatOptions" packages/core/src/providers/IProvider.ts -A 20

echo -e "\n=== Check who passes the contents/history to providers ==="
rg -n "generateChatCompletion|contents:" packages/cli/src/ --type ts -C 3 | head -60

Length of output: 5377


@acoliver I think I've been misunderstanding the architecture. Let me clarify what I've discovered:

Key Finding: Providers Are Stateless

Looking at the code, providers don't store conversation history. The GenerateChatOptions interface shows that conversation history is passed to the provider on each call as contents: IContent[]:

export interface GenerateChatOptions {
  contents: IContent[];  // <-- Conversation history passed in
  tools?: ProviderToolset;
  // ...
}

This means the caller (CLI/UI layer) is responsible for maintaining and passing the conversation history to providers.

Where This Gets Confusing

When you reported Issue #974:

  • You switched Anthropic → OpenAI → back to Anthropic
  • The conversation context was lost

This PR's fix preserves these settings:

  • context-limit
  • max_tokens
  • streaming

But you're saying the actual conversation messages appear to be cleared, not just truncated.

The Question

Where does the CLI actually store the conversation history (the IContent[] array)?

Is it:

  1. Stored globally and passed to whichever provider is active?
  2. Stored per-provider (so each provider has its own conversation)?
  3. Stored in GeminiClient (which is Gemini-specific)?
  4. Something else?

If the conversation history is stored per-provider and gets cleared when switching away, then preserving settings wouldn't fix the problem - the actual messages would still be lost.

Can you clarify what you actually observed in your testing after applying this fix? Does the conversation history truly persist across Anthropic → OpenAI → Anthropic switches now, or are we fixing a different symptom?

- Update test comments in oauth-logout-cache-invalidation.spec.ts to
  reflect that invalidateCache() now exists and works
- Replace console.debug with DebugLogger in precedence.ts to follow
  project logging conventions
@acoliver acoliver merged commit c6aca68 into main Jan 2, 2026
20 checks passed
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

Projects

None yet

2 participants