Fixing Caching Bug... Again (#78)
* feat: add provider/model formatting and robust model display parsing โจ **โจ Features** - Add formatProviderName and formatModelName helpers to modelCapabilities to produce human-friendly provider and model labels. - Add extractBackendNameFromTooltip in modelPicker to robustly parse backend names from tooltips with vendor fallback. **๐ ๏ธ Refactor** - Update LiteLLMProviderBase to use the new formatting helpers, construct stable display IDs and unified tooltips, and simplify item details for consistent UI labels. **๐งช Tests** - Update model display test expectations and add tests for formatProviderName/formatModelName; also adjust integration test type declarations for consistency. **๐งน Chores** - Bump package.json version to 1.6.1-dev1. - Change post-session-validation script to run "npm run format" and "npm run lint" instead of the `:check` variants. **๐ Docs** - Update project-planner prompt to save plans under `.plans/pending` and remove obsolete deliverables text from plan-generation instructions. * refactor: standardize model display labels and metadata โจ **โจ Features** - Add ExtendedModelInformation type and formatModelDisplayLabel helper to centralize model UI labeling and vendor display. - Update LiteLLMProviderBase to expose rawModelName, vendor, backendName, tooltip and detail so consumers render consistent model info. - Normalize provider handling and token fields by using providerLower for family derivation and derived.maxInputTokens for maxInputTokens. **๐ Fixes** - Update post-session validation message to recommend running "npm run format" and "npm run lint" (remove :check variants) so commands match current scripts. **๐งน Chores** - Bump package.json version to 1.6.1-dev5. **๐งช Tests** - Adjust unit tests to validate new display label formatting and backendName/description values. * chore: release 1.6.1 โ update changelog, bump version, deps & dependabot ๐ **โจ Features** - Add 1.6.1 changelog entry documenting model display labels, provider metadata, and token normalization. **๐ Fixes** - Document post-session guidance to run `npm run format` and `npm run lint` in the changelog. **๐งน Chores** - Bump package.json version to 1.6.1 to mark the release. - Update PostHog dependencies (`posthog-js` and `posthog-node`) to newer patch versions. - Tighten Dependabot: switch npm and GitHub Actions updates to weekly and reduce open PR limit to 5. * feat: ๐ improve streaming parsing and retry handling **โจ Features** - Add buffered parsing for `/responses` tool calls so fragmented tool arguments are assembled before emission. This improves support for LiteLLM response streams and Gemini-style native function calls. - Preserve deterministic part ordering across thinking, text, tool calls, response metadata, data parts, and finish events. This helps VS Code consume streamed parts more reliably. - Introduce a retry path for context overflow errors that re-trims prompts with a hard budget override and retries once. If overflow persists, surface a `LanguageModelError` so VS Code can compact the conversation. **๐ Fixes** - Prevent stale or partial tool-call buffers from leaking across aborted streams and new requests. This reduces corrupted tool-call emissions after reconnects or resets. - Resolve model picker selections by stored model ID instead of label matching alone. This fixes cases where displayed labels include vendor prefixes or other formatting. - Improve overflow detection with broader error matching for known provider codes and message patterns. This makes retry behavior more consistent across backends. **๐งน Chores** - Bump VS Code engine and typings requirements to 1.114.0 and mark the package as preview. This aligns the extension with the newer host API surface. - Add `.devcontainer/devcontainer-lock.json` to ignore rules and register the post-session validation hook for `SubagentStop`. This keeps local dev artifacts and automation behavior tidy. * fix: ๐ drop cache_control metadata from transport and token counting **๐ Fixes** - Add a shared `isCacheControlMimeType` helper and use it to silently drop opaque cache-control parts before they reach outbound LLM payloads. - Prevent `application/vnd.cache-control+json` variants from being decoded as message text in both V1 and V2 conversion paths. - Exclude cache-control metadata from V2 token counting so prompt-cache markers do not inflate the budget. - Update regression tests to verify cache-control parts are stripped while legitimate text and JSON data parts still pass through. **๐งช Tests** - Add coverage for bare `cache_control`, `application/vnd.cache-control+json`, and mixed-content messages to guard against metadata leakage. * fix: ๐ improve streaming error logging and telemetry **๐ Fixes** - Replace `console.error` with structured logger warnings when tool-call argument parsing fails, and emit a safe empty input fallback so the response stream keeps flowing. - Add bounded SSE frame parse warnings in `decodeStream`, including payload previews and suppressed logging after repeated bad frames. - Enrich V2 chat request failures with request ID, model, duration, telemetry failure capture, and failure metric reporting. - Add unit coverage for tool-call parse fallback, request-failure telemetry, and SSE parse warning behavior. * feat: โจ overhaul V2 responses conversion and validation **โจ Features** - Add a direct V2-to-responses converter that preserves part ordering, tool calls, and structured tool results without first downgrading to transport messages. - Serialize tool results as tool messages with support for text, JSON, and data payloads, while keeping adjacent trailing text as its own message when needed. - Drop cache-control data parts and keep image parts as OpenAI `image_url` content items to better match LiteLLM/OpenAI expectations. **๐ Fixes** - Tighten V2 validation to reject empty messages and require tool calls to be followed by matching tool results in subsequent user messages. - Prevent flat concatenation of mixed tool-result payloads so structured results remain distinguishable in the emitted OpenAI payload. - Add coverage for tool-result ordering, structured serialization, and the updated validation behavior. **๐งน Chores** - Bump package version from `1.6.2-dev5` to `1.6.2-dev6`. * feat: ๐ release 1.6.2 **โจ Features** - Overhaul the V2 responses pipeline to correctly handle `LanguageModelDataPart`, `LanguageModelThinkingPart`, and other VS Code carrier objects. This improves conversion and validation for response processing. **๐ Fixes** - Improve streaming error logging and telemetry to capture more detail on connection drops and parse failures. This makes stream issues easier to diagnose. - Drop `cache_control` metadata from transport and token counting to prevent carrier objects from corrupting prompts or inflating token usage. * fix: ๐ก๏ธ drop cache-control carrier parts across streaming and conversion **๐ Fixes** - Drop `cache_control` VS Code data carrier parts in the stream interpreter and emitter so opaque prompt-cache metadata is not re-sent into future LLM input. - Filter cache-control data parts from V1/V2 tool result serialization and tool-result text collection to prevent metadata leakage while preserving legitimate text output. - Keep non-cache-control data parts flowing through as before, and add trace logs for dropped carrier parts to aid debugging. **๐งช Tests** - Update streaming tests to verify cache-control carrier objects are suppressed and other data carrier objects still pass through. - Add emitter tests to ensure cache-control parts are not reported to VS Code. - Add utility coverage for V1/V2 tool-result serialization to confirm cache-control payloads are removed while real tool output remains intact. **๐งน Chores** - Remove VS Code test extension auto-installation from `.vscode-test.mjs`. - Bump the package version to `1.6.3-dev1`. * Rel 1.6.3 prep
A
amwdrizz committed
6a9551a7f84a6f449b27f8ed71d1e5ce76ee4e4a
Parent: b962fd5
Committed by GitHub <noreply@github.com>
on 4/30/2026, 1:28:38 PM