SIGN IN SIGN UP

🧭🚀 Modern Provider-Group Config + 2.0.0 Release Readiness (#80)

* feat: add v2 provider session discovery and reasoning config support

**✨ Features**
- Add configuration-based backend session discovery for the v2 chat provider. This enables VS Code 1.119+ to resolve a single backend from group configuration without relying on legacy workspace settings.
- Propagate reasoning effort from model configuration and model options into OpenAI request payloads. This lets reasoning-capable models honor per-request effort settings end to end.
- Gate chat provider registration by VS Code version so newer clients use the v2 provider while older clients keep the legacy path.

**🐛 Fixes**
- Guard against missing fetch responses in the LiteLLM client to fail fast with a clear error instead of dereferencing an undefined response.
- Make SecretStorage handling tolerant of partial test stubs by falling back to an in-memory implementation when the provided storage is incomplete.

**🧪 Tests**
- Add coverage for provider request building, reasoning-effort fallback behavior, and configuration-based model discovery.
- Add ConfigManager tests for resolving backend sessions from provider configuration and for ignoring configs without a base URL.
- Update client tests to use real `Response` objects and async fetch stubs for more realistic fetch behavior.

* chore: tighten TypeScript and ESLint checks 🧹

**🧹 Chores**
- Update the VS Code engine requirement and bump the preview version to `2.0.0-dev2`. This aligns the extension with a newer host version.
- Enable stricter TypeScript compiler checks for implicit returns, switch fallthrough, and unused parameters. This helps catch more bugs at compile time.
- Narrow ESLint scope to `src` TypeScript files, add coverage to ignores, and apply type-aware rules with stricter unsafe usage checks. This raises lint coverage for production and test code while reducing noise elsewhere.
- Promote several lint rules from off/warn to error or warn, including TSLint comment bans and array/empty function handling. This makes code quality enforcement more consistent.

* refactor: simplify array typings across TypeScript codebase

**🧹 Chores**
- Replace verbose `Array<T>` forms with `T[]` and `readonly T[]` throughout adapters, config, utils, and tests. This keeps the type signatures consistent and easier to read.
- Update `tsconfig.json` comments by disabling the listed strictness options instead of changing their values. This preserves the settings for easier re-enabling later.

* refactor: tighten runtime guards and remove unsafe casts 🛡️

**🧹 Refactors**
- Replace `any`-style casts with `unknown`-first narrowing across adapters, providers, telemetry, and utils. This makes JSON parsing, request mutation, and metadata handling safer under TypeScript.
- Add runtime checks before reporting VS Code usage parts and emitting streamed parts. This prevents invalid values from being sent when the host API is missing or less typed than expected.
- Harden token counting and budget-trimming helpers with message shape validation. This avoids accessing missing fields on malformed chat messages.
- Clean up version extraction and secret storage stubs with explicit types and small helper methods. This improves maintainability and reduces type warnings in activation and configuration code.

**🧪 Tests**
- Update adapter tests to assert on typed request payloads and headers instead of unchecked `any` access. This keeps the tests aligned with the stricter production code.
- Strengthen streaming and responses client tests with explicit part typing and error checks. This ensures the new guards still preserve expected behavior.

* feat: 🧩 Unify LiteLLM chat provider for VS Code 1.120 rich response parts

### ✨ Features
- Unify the chat provider into a single `LiteLLMChatProvider` (no V1/V2/V3 siblings) so chat behavior matches across VS Code 1.120.
- Add structured rich response parts (text, thinking/reasoning, data, tool calls) using the VS Code 1.120 Language Model APIs.
- Add per-group provider configuration support and ensure providers read `options.configuration` on every call to support multiple groups concurrently.
- Ensure all discovered `LanguageModelChatInformation` entries set `isUserSelectable: true` and include `category: { label, order }` so models appear and stay properly grouped in the picker.
- Add `reasoningEffort` navigation grouping in the configuration schema so the effort picker works inline in the chat UI.
- Add a new `messageConverter` to convert V2 message parts into the OpenAI-compatible shape while preserving V2 ordering and normalizing tool call IDs.

### 🐛 Fixes
- Preserve cache-control boundaries in `trimV2MessagesForBudget` so cached context isn’t trimmed away when budget is tight.
- Propagate `reasoning_effort` verbatim through the responses adapter so reasoning effort works consistently across `/responses` requests.

### 🧹 Chores
- Update VS Code engine target to `^1.120.0` and run tests against VS Code Insiders to match the required API surface.
- Adjust ESLint rules for tests/mocks and add scoped suppression for deprecated legacy compatibility code paths scheduled for removal in 1.125.
- Improve command typings/returns for disposable registrations and update test mocks to use `sandbox.stub()` consistently.
- Refresh docs/README guidance to reflect unified provider architecture and rich response parts.

### ⚠️ Legacy
- Keep the pre-1.120 workspace-settings backend discovery shim as an OBSOLETE compatibility path (scheduled for deletion in VS Code 1.125).

* feat: 🚀 add regex-based reasoning model overrides + effort fallback retries

### ✨ Features
- Introduce `litellm-connector.modelOverrides` as an array of `{ match, supportsReasoning, reasoningEfforts, defaultEffort, notes }` so users can declaratively control reasoning capabilities by model-id regex.
- Add bundled reasoning overrides (`src/config/modelOverrides.json`) and merge them with user overrides (user entries take precedence on regex match).
- Implement `EffortFallbackCache` and provider-level retry logic to automatically downgrade `reasoning_effort` on reasoning-related 4xx errors, with a cap and session notifications.

### 🧹 Chores
- Update configuration loading to use a cached workspace configuration object and move model override parsing into a dedicated loader module.
- Improve CI test coverage command to detect `xvfb-run` availability at runtime before running `vscode-test`.

### 🧪 Tests
- Add unit tests for override loading/merging/validation and for the new reasoning-effort fallback behavior and notification deduping.
- Update existing provider and model capability tests to reflect the new override shape and reasoning-effort behavior.

* 🧭🔄 Align LiteLLM discovery with modern provider groups

 - refresh model discovery after configuration changes via a debounced onDidChangeConfiguration hook
 - route `litellm-connector.manage` directly to multi-backend management flow
 - tighten modern provider config conversion (require provider/group name, valid http(s) baseUrl, and apiKey)
 - preserve backend/group labels in discovered models so picker grouping reflects configured provider identity
instead of generic fallback
 - keep classic backend resolution as a fallback when VS Code group configuration is missing/incomplete
 - update provider/config command docs, package contribution schema, and regression/unit tests for the new flow

* Doc & Release pre-prep

* resolve small bug
A
amwdrizz committed
933f1ce932c39d53974ac78df1a84081dbb7c193
Parent: 6a9551a
Committed by GitHub <noreply@github.com> on 5/14/2026, 2:06:02 AM