SIGN IN SIGN UP

🚀 Release v2.1.0 — VS Code-native config, legacy migration, and hardening (#87)

* Base clean up & Setup

* bugfix for incorrect setting and resetting of selected reasoning, added debug logging for reasoning levels.

* feat: Enhance reasoning capabilities and telemetry integration

- Added support for new reasoning efforts including "max" to the SupportedReasoningEffort type.
- Updated LiteLLMModelInfo to include additional reasoning effort fields and supported parameters.
- Refactored model capability detection to derive reasoning efforts from explicit fields and supported_openai_params.
- Introduced a centralized telemetry mock utility for consistent testing across providers.
- Modified unit tests for commit, completion, and base providers to utilize telemetry mocks.
- Created new parameter validation tests for supported_openai_params.
- Adjusted integration tests to ensure correct behavior on configuration changes.
- Enhanced reasoning effort fallback logic with improved logging.
- Added comprehensive tests for reasoning capabilities and configuration schema.

* 📊 Enriched token usage reporting and reserved output budget

Normalize usage payloads to OpenAI API spec (prompt_tokens_details,
completion_tokens_details), add fallback tool-call token counting,
report reserved output tokens and total token window to VS Code
and telemetry, remove duplicate zero-token /responses metric, and
improve transport-level prompt token accuracy by counting the actual
trimmed request body.

* 🛠️ Add forceResponsesEndpoint config and fix ESLint generic constructor error

- Add forceResponsesEndpoint option (defaults to true) to force /responses endpoint
- Add allowChatCompletionsFallback option for fallback behavior
- Fix @typescript-eslint/consistent-generic-constructors error in provider base
- Update version to 2.1.0-dev7

* 🧬 Derive provider group names from base URLs

* feat: 🚀 improve commit generation routing and token usage telemetry

**✨ Features**
- Route commit-message generation through VS Code's model request API first so provider-group configuration is preserved.
- Add smart output token reservation that scales between 16k and 64k and stays within the remaining context window.
- Merge partial usage frames and emit final usage envelopes for more stable token telemetry.

**🐛 Fixes**
- Retry once without `stream_options.include_usage` when upstream rejects that parameter.
- Log sanitized request payload summaries on failures to aid debugging without exposing full prompts.

**🧪 Tests**
- Cover smart reservation, VS Code routing, retry behavior, request-failure logging, and partial usage merging.
- Update utility and discovery tests to match the refined grouping and model-selection flow.

**🧹 Chores**
- Bump the package version to `2.1.0-dev12`.
- Switch telemetry mock imports to type-only and tidy test formatting.

* feat: centralize streaming token capture and remove experimental usage flag

**✨ Features**
- Add `StreamTokenCapture` to intercept streamed response parts, track text/reasoning/tool tokens, and merge upstream usage data. It now emits enriched usage payloads or falls back to internal counts when providers omit usage frames.
- Detect real `ThinkingPart` support at runtime and preserve older VS Code compatibility with italicized reasoning fallback.
- Improve inline completion token estimation by using the model-aware tokenizer instead of a rough character-based heuristic.

**🐛 Fixes**
- Stop emitting usage metadata directly from `ResponsesClient`; usage now flows through the wrapped stream capture path.
- Make usage merging monotonic across multiple frames so later deltas do not regress counts.

**🧹 Chores**
- Remove the experimental `litellm-connector.emitUsageData` setting and related telemetry/config wiring.
- Update package version and clean up docs text, including the marketplace/readme notes and flow diagram.

**🧪 Tests**
- Add coverage for `StreamTokenCapture` behavior, including reasoning detection, usage enrichment, monotonic merges, and pass-through forwarding.
- Update existing responses/chat/config tests to match the new streaming and ThinkingPart behavior.

* fix: abort streaming requests on cancellation and inactivity timeout ⚡

**🐛 Fixes**
- Thread an `AbortController` through Responses API requests so VS Code cancellation stops `fetch` immediately. This also aborts long-running requests after the configured inactivity timeout with a clearer warning.
- Update SSE decoding and chat streaming to react to abort signals while reading. This prevents stalled streams from hanging the provider after timeout or cancellation.

**🧪 Tests**
- Add coverage for passing an `AbortSignal` into `fetch`, cancelling in-flight requests, and timing out idle responses. These tests verify the new abort behavior end to end.

**🧹 Chores**
- Refresh the devcontainer setup with newer common-utils, extra workspace volume mounts, and additional VS Code extensions for testing and Mermaid previews.
- Bump the package version and add a Mermaid flowchart documenting the request routing/fallback path.

* feat: cache models per config to preserve VS Code picker state ✨

**✨ Features**
- Cache discovered models by providerName + baseUrl so repeated lookups reuse the same model objects and keep picker selections stable.
- Detect meaningful model drift before reusing cached entries, and clear the per-config cache when model caches are reset.

**🧪 Tests**
- Add drift-detection coverage for same-config reuse, cross-config rediscovery, and cache invalidation after clearModelCache.

**🧹 Chores**
- Move coverage test orchestration into a standalone script, make clean scripts safe for mounted volumes, and fix devcontainer volume ownership.
- Register prettier in VS Code settings and bump the preview version to 2.1.0-dev22.

* refactor: split provider base into discovery, request, and transport services 🧩

**🔧 Refactors**
- Extract model discovery, request construction, and transport logic into dedicated base classes to reduce `LiteLLMProviderBase` complexity and improve separation of concerns.
- Preserve per-configuration caching, capability derivation, and backend resolution in the new discovery layer so picker behavior stays stable.
- Route OpenAI and V2 request building through `RequestBuilder` to centralize tool handling, parameter filtering, and token limits.
- Simplify response transport by reusing the LiteLLM chat client path and keeping overflow retry handling in one place.

**🧪 Tests**
- Add coverage for discovery caching, request building, and transport retry behavior.
- Tighten model lookup callbacks with explicit typings to satisfy stricter TypeScript checks.

* feat: improve model discovery and capability tagging ✨

**✨ Features**
- Derive the provider group name from the configured provider name or base URL hostname when discovery metadata is incomplete.
- Pass model capability overrides through discovery so generated VS Code capabilities and tags reflect configured exceptions.

**🐛 Fixes**
- Clear the parameter probe cache on provider reset and await transport requests to keep async flow consistent.
- Update request building to match tool mode handling and token limit behavior expected by the transport layer.

**🧪 Tests**
- Rework discovery, display, transport, and model tag tests to cover the new discovery flow and capability helper APIs.
- Add coverage for reasoning and PDF tags, plus override-driven tool and vision tags.

**🧹 Chores**
- Bump the package version to `2.1.0-dev23`.
- Allow `tee` in VS Code settings alongside `npx prettier`.

* chore: bump dev version and tidy formatting ✨

**🧹 Chores**
- Bump the package version from `2.1.0-dev23` to `2.1.0-dev24` for the next dev release.
- Reformat several test stubs and call sites in `liteLLMProviderBase.test.ts` to keep the file consistent.
- Wrap the capability override lookup in `modelDiscovery.ts` for readability without changing behavior.

* feat: ♻️ migrate /responses stream handling into the shared interpreter

**✨ Features**
- Move `response.output_item.delta` and `response.output_item.done` handling into `liteLLMStreamInterpreter.ts` so /responses tool calls are interpreted in the shared streaming path.
- Preserve anonymous tool buffering for providers that stream arguments before a stable `call_id`, and add regression coverage for both keyed and anonymous tool call flows.

**🧹 Chores**
- Remove the retired `ResponsesClient` implementation and update adapter exports, tests, and docs to reflect the new architecture.
- Keep the existing model list and reasoning-effort state stable by avoiding destructive cache clears and by omitting a schema `default` that would reset the VS Code picker.

* fix: preserve reasoning-effort selection across model refreshes ✨

**🐛 Fixes**
- Cache model discovery for five minutes on all calls, not just silent probes, so VS Code no longer sees a new model list on every chat turn.
- Emit the model-change event only when the model ID set actually changes, preventing unnecessary re-queries and reasoning-effort resets.
- Merge provider config with per-model `modelConfiguration`, and restore the schema default so the active effort is shown correctly in the picker.
- Remove the catch-all override and rely on the proxy `/model/info` response for reasoning-effort support.

**🧪 Tests**
- Update model override and reasoning-effort tests to match the new cache, schema, and default-handling behavior.

**🧹 Chores**
- Bump the dev version and convert VS Code imports to type-only where they are used for types only.

* feat: 🧩 add a master toggle for model overrides

**✨ Features**
- Add `litellm-connector.enableModelOverrides` to let users disable the entire model override system. When off, model capabilities come directly from LiteLLM `/model/info` data.
- Gate override lookup paths on the new setting so bundled and user-defined overrides are ignored when the feature is disabled.
- Clear bundled override rules by default, making proxy-reported capabilities the source of truth unless overrides are explicitly enabled.

**📚 Docs**
- Document the new setting in the README and settings table.
- Update the feature list to explain the override gate and its behavior.

**🧪 Tests**
- Update model override tests for the empty bundled override set and the new enable/disable behavior.
- Add coverage for `findOverride`, `getEffectiveEfforts`, and `getDefaultEffort` when overrides are disabled.

**🧹 Chores**
- Add the new config flag to `LiteLLMConfig` and VS Code schema generation.
- Bump the preview version to `2.1.0-dev33`.

* updating llm response example

* fix: 🛡️ add discovery backoff for repeated model discovery failures

**🐛 Fixes**
- Add a shared discovery backoff controller that increases delay on each consecutive discovery failure and blocks after 10 hits.
- Apply the backoff in model discovery so unhealthy backends stop rapid polling and surface a blocked error during cooldown.
- Reset the shared backoff when caches are cleared, and keep in-flight discovery cleanup in a `finally` block.

**🧪 Tests**
- Add coverage for delay escalation, block behavior, quiet-window reset, shared controller usage, and cache-driven reset.

**🧹 Chores**
- Bump the package version to `2.1.0-dev34`.

* feat: improve multi-backend model discovery and add prompt audit tooling ✨

**✨ Features**
- Add a new `Audit Prompts` user prompt to scan `.prompt.md` and `.agent.md` files for duplicate names, broken references, scope conflicts, and template gaps.
- Update the Project Planner agent tool list to use the consolidated VS Code tool aliases and GitHub PR helpers.

**🐛 Fixes**
- Make model discovery accumulate models across backend groups instead of overwriting the previous list, preventing VS Code discovery loops.
- Add a fallback lookup through per-config cache entries so routed models can still resolve to the correct backend and URL.
- Keep active backend tracking merged across sessions so legacy discovery paths continue to work.

**🧪 Tests**
- Add coverage for multi-backend discovery, backend routing resolution, and active backend tracking.

**🧹 Chores**
- Bump the extension version to `2.1.0-dev35`.
- Change `litellm-connector.enableModelOverrides` to default to `false` so override rules are opt-in.

* check-in post iteration 1 for fixing multibackends

* feat: migrate LiteLLM configuration to VS Code Language Models UI ✨

**✨ Features**
- Replace legacy backend management with VS Code's Language Models view and show a one-time migration notice on activation. Users can jump straight to the new UI or fall back to settings when the command is unavailable.
- Route commit-message generation exclusively through `vscode.lm.selectChatModels` and surface a clear error when the VS Code route fails. This removes the direct provider fallback path.
- Derive backend routing from the URL hostname and use the configured group label for display categories. This keeps model IDs stable and avoids duplicate or orphaned groups in the picker.

**🐛 Fixes**
- Preserve cancellation from retry sleeps and nested helpers so user-initiated cancels stop the retry loop immediately.
- Prevent SSE reader cancellation errors from being swallowed in a way that can interfere with stream cleanup.
- Resolve token counting and model requests from the discovered backend for a model instead of re-querying legacy backend lists. Cache keys now normalize trimmed base URLs and trailing slashes to avoid misses.

**🧪 Tests**
- Update command, discovery, and provider tests for the new per-group routing flow and the removed legacy management commands.
- Seed discovered backend metadata in provider tests so request and token-count paths can resolve correctly.
- Disable PostHog telemetry during coverage runs to avoid fetch mock interference and accidental network calls.

**🧹 Chores**
- Remove obsolete manage/reset command wiring and related legacy fallback code.
- Tidy telemetry shutdown/dispose behavior and bump the dev version to `2.1.0-dev42`.

* fix: 🐛 isolate model discovery state per group and stop refresh loops

**🐛 Fixes**
- Split `_lastModelList` into per-group storage so each configuration updates only its own slice. This prevents one group's discovery from trampling another's models and causing duplicate or missing entries.
- Return `[]` immediately for vendor-level discovery calls before any state mutation or change event firing. This breaks the VS Code re-discovery loop that was triggered by empty vendor-level refreshes.
- Keep cache updates non-destructive by removing only stale IDs from the same group and preserve other groups' model info. This avoids transient cache gaps that could reset model selection or reasoning-effort state.
- Add regression tests for vendor-level early return and per-group isolation. These cover the no-discovery path, prevent infinite loop regressions, and verify combined model lists still include all groups.

* chore: remove deprecated inline completions and model picker plumbing 🧹

**🧹 Chores**
- Remove the inline completions command, registrar, provider, and related tests to eliminate the deprecated feature path. This also drops its activation wiring from the extension entrypoint.
- Delete the commit-message model picker command and simplify the package contribution metadata and settings descriptions. This leaves commit model selection as a direct config override.
- Bump the extension version to `2.1.0-dev45` and trim test expectations that no longer match the new discovery behavior.

* refactor: drop legacy backend management in favor of VS Code LM config

**🧹 Chores**
- Remove the legacy check-connection and reset commands from the extension manifest and command registration.
- Delete ConfigManager APIs for persisting, listing, updating, and cleaning up backends now that provider settings come from VS Code per-group configuration payloads.
- Stop showing the old “not configured” activation prompt; onboarding now relies on the migration notice and the Language Models UI.

**🧪 Tests**
- Update completion and error-handling tests to assert the new “No model available” behavior instead of configuration-missing errors.
- Remove obsolete backend/config command tests and add a reusable mock Memento helper for `globalState` and `workspaceState`.

* feat!: migrate LiteLLM to VS Code provider-group configuration

**💥 Breaking Changes**
- Remove legacy workspace-settings config, config manager APIs, and type fields tied to `litellm-connector.baseUrl`, `backends`, and `apiKeySecretRef`. Backend connection details now come only from VS Code 1.120+ per-group `options.configuration`.
- Delete the old multi-backend discovery fallback and legacy backend resolution path. Requests now fail fast when no discovered model/backend is available.
- Drop obsolete schema entries and update `LiteLLMClient` to use the new connection-level config shape.

**📚 Docs**
- Update the README, AGENTS guidance, and changelog to describe the new configuration flow and migration steps.
- Remove legacy workspace-setting references from the settings documentation and examples.

**🧪 Tests**
- Rewrite config, adapter, provider, and integration tests for the new config shape and empty-discovery behavior.
- Adjust assertions around disabled backends, missing model discovery, and request routing without legacy fallbacks.

**🧹 Chores**
- Bump the dev version and ignore the `.investigate` directory.

* Refactor Transport tests and enhance configuration handling

- Added tests for `sendRequestToLiteLLM` to check for missing baseUrl and apiKey.
- Verified that a client is constructed with call-time configuration.
- Updated `convertProviderConfiguration` in ConfigManager to accept empty groupName when baseUrl is set and ignore stale providerName.
- Removed outdated token telemetry tests as they are no longer applicable.
- Adjusted tsconfig.json to set rootDir to the project root and included TypeScript files for compilation.

* 🛠️ Fix sparse tool capability detection

Restore tool support derivation when supported_openai_params is sparse by honoring tool_choice and supports_*_calling flags. Add regression coverage for empty-params + explicit tool flags.

* Version bump from last change set

* chore: clean up worktree artifacts and bump dev version 🧹

**🧹 Chores**
- Add `.worktrees` and `main-registry-rebuild` to gitignore, Prettier, ESLint, and TypeScript excludes so local worktree files stay out of tooling and commits.
- Remove the obsolete `MasterPlan.md` instructions file now that the worktree setup is handled elsewhere.
- Bump the package version from `2.1.0-dev63` to `2.1.0-dev64` for the next development build.
- Replace the inline `ConfigManager` import type with a shared alias in provider base types to keep the dependency declarations cleaner.

* feat: ✨ sanitize tool names for Bedrock-compatible message handling

**✨ Features**
- Add `sanitizeToolName` to enforce Bedrock’s 64-character tool name limit and naming rules. This prevents invalid tool call names from reaching outbound message converters and streaming interpreters.
- Apply tool name sanitization in the v1/v2 OpenAI message converters and LiteLLM stream interpreter. This keeps assistant tool calls compliant across both non-streaming and streaming paths.
- Add truncation and normalization logging for tool name fixes. This makes it easier to trace whether a name was altered by the model or by outbound conversion.

**🧪 Tests**
- Add unit coverage for tool name sanitization edge cases, including long names, numeric prefixes, empty values, and special-character normalization. These tests lock in Bedrock-safe behavior.
- Add message converter tests to verify sanitized tool names are emitted correctly. This protects the OpenAI conversion path from regressing.
- Add LiteLLM commit provider tests and a mock LiteLLM server test suite. These cover streaming, telemetry, cancellation, error handling, and integration-style request flows.

**🧹 Chores**
- Bump the package version to `2.1.0-dev65`. This reflects the new sanitization work and expanded test coverage.
- Update `@types/vscode` and add the `vscode` dependency. This keeps the extension API typings aligned with the current VS Code runtime.

* feat: ✨ add structured logging guidance and tokenizer observability

**📚 Docs**
- Add a logging-level decision table that defines when to use `error`, `warn`, `info`, `debug`, and `trace` for `StructuredLogger` calls.
- Add reusable prompt templates for logging-only, tests-only, and combined test-and-log workflows with repository-specific rules.

**✨ Features**
- Instrument `HeuristicTokenizer` with structured logs for non-object rejections, string/value counts, tool calls, data parts, and nested content traversal.
- Standardize log payloads to capture the inputs that drove each decision while keeping the output suitable for triage.

**🧪 Tests**
- Add unit tests covering non-object inputs, value/tool/data/content branches, zero-length strings, and nested token counting.
- Expand message tokenization coverage for string content, array content, mixed parts, and nested content arrays.

* test: expand messageConverter coverage 🧪

**🧪 Tests**
- Move the existing tool name sanitization tests into `src/adapters/test/messageConverter.test.ts` to match the adapter test layout.
- Add broad coverage for `serializeToolResultItem` and `appendDataPart` paths, including text, data, JSON, image, cache-control, undefined, and mixed-content cases.
- Mock VS Code `LanguageModelTextPart` and `LanguageModelDataPart` constructors to verify behavior with and without the `globalThis.vscode` API.
- Assert `normalizeToolCallId` is applied to tool result messages so call IDs are consistently transformed.

**🧹 Chores**
- Bump the package version from `2.1.0-dev65` to `2.1.0-dev66`.

* feat: 🚀 migrate legacy LiteLLM configs on activation

**✨ Features**
- Add a `LegacyConfigMigration` flow to detect old single-backend and multi-backend settings, migrate them into provider groups, and clean up legacy config/secrets afterward.
- Trigger migration during extension activation and refresh model information once the new groups are created.
- Emit telemetry for each migrated backend so legacy upgrade progress can be tracked.

**🧪 Tests**
- Add focused unit tests for group naming, legacy config detection, backend extraction, and migration state handling.
- Remove the oversized legacy converter test file in favor of the new migration coverage.

**🧹 Chores**
- Bump the dev version and update TypeScript-related and PostHog dependencies.
- Remove the stale changelog entry to keep release notes consistent.

* test: broaden coverage across streaming, observability, and activation flows 🧪

**🧪 Tests**
- Add edge-case coverage for streaming part emission, including non-string text values, opaque data parts, and ignored control parts.
- Validate audit trail warning serialization and structured logger level routing for warn/error channel methods.
- Expand extension activation coverage for process error listeners, migration prompts, modern config persistence, telemetry events, and refresh behavior.

**🧹 Chores**
- Bump the dev version to `2.1.0-dev68`.
- Add a `coverage:serve` script and the `serve` dev dependency to review coverage reports locally.

* ci: include dev/* branches in workflow triggers

**🧪 CI**
- Run the GitHub Actions workflow for dev/* branches in addition to the existing bugfix, enhance, and feat branches. This keeps validation active for development branches before pull requests.

* fix: normalize tool call IDs for stricter provider limits (issue #83) 🛠️

**🐛 Fixes**
- Rework \`normalizeToolCallId\` to generate \`fc_\`-prefixed IDs in the 42–63 char safe range, padding short IDs and trimming long ones deterministically.
- Preserve stable output for empty, prefixed, and sanitized IDs so tool calls stay compatible across OpenAI-like providers and strict models.
- Update default maxLen from 40 to 56 for padding stability and to support 42-character minimum requirement.

**🧪 Tests**
- Update utility, adapter, and streaming tests to assert the new minimum/maximum ID length rules and deterministic padding behavior.

**🧹 Chores**
- Replace \`rm -rf\` cleanup scripts with \`find ... -delete\` to make cache cleanup more portable and resilient.

* fix: estimate tokens for image and PDF data parts (closes #76) 🖼️

- Add estimateMediaTokenCost() helper with conservative heuristics
- Update countTokensForV2Messages() to estimate image/PDF tokens
- Update HeuristicTokenizer.countPartTokens() for media types
- Add comprehensive tests for image/PDF token estimation

Images: 85 base tokens + scaling by data size (bytes/750)
PDFs: max(100, bytes/4) for text-equivalent estimate

Resolves context window overflow errors when processing binary media.

* chore: tighten TypeScript linting and typings ✨

**🧹 Chores**
- Add stricter TypeScript ESLint rules for source and test files, including unused-vars warnings and floating-promise checks, to catch issues earlier.
- Switch legacy config imports to type-only imports and silence a few intentional unused test fixtures to keep lint output clean.
- Update mock server and test response typings to use array shorthand, and bump the dev version to `2.1.0-dev69`.

* chore(release): publish 2.1.0 and document provider-group migration

**🧹 Chores**
- Bump the extension to `2.1.0` and mark the release as non-preview.
- Update `README.md` and `README.marketplace.md` to reflect the new VS Code Language Models provider-group configuration flow, including the removal of legacy workspace settings and the commit model override requirement.
- Expand `CHANGELOG.md` with the 2.1.0 release notes, breaking-change guidance, and legacy migration steps.
- Document the new legacy config migration behavior in `AGENTS.md` so the upgrade path is captured alongside the implementation.

* docs: 📝 add v2.1.0 GitHub release notes

* chore: update Codecov action and dev dependencies

**🧪 CI**
- Bump the Codecov GitHub Action from v6 to v7 for both coverage and test result uploads.

**🧹 Chores**
- Refresh several dev dependency versions in `package.json`, including VS Code test, publishing, telemetry, and test tooling packages.
- Reformat `package.json` to the current JSON layout as part of the dependency update.
A
amwdrizz committed
33ae100be9f4371b45698eb88a1e6452cb58824f
Parent: ec6aa27
Committed by GitHub <noreply@github.com> on 6/10/2026, 10:32:06 PM