Skip to content

chore: version packages#46

Merged
MyPrototypeWhat merged 1 commit into
mainfrom
changeset-release/main
Jul 13, 2026
Merged

chore: version packages#46
MyPrototypeWhat merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@context-chef/ai-sdk-middleware@2.1.0

Minor Changes

  • #45 09ba1d6 Thanks @MyPrototypeWhat! - Session isolation, lossless-er tool output flattening, and tighter peer ranges.

    • Session isolation: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per session instead of per middleware instance. Pass providerOptions: { contextChef: { sessionId } } on each call; calls without a sessionId share one default session (prior behavior). New maxSessions option caps concurrently tracked sessions (default 256, LRU-evicted). Previously a middleware created at module scope leaked Janitor state across every conversation it served.
    • stringifyToolOutput no longer silently drops non-text content parts: file/media parts flatten to a [tool result file: <mediaType>] placeholder so compression and truncation see that they exist. The truncator's duplicate text extraction now delegates to the same implementation.
    • Tighten peerDependency ranges from >=4 / >=7 to ^4.0.0 / ^7.0.0. The middleware depends on LanguageModelV4* type shapes from @ai-sdk/provider v4 — an unbounded range would let a future major install silently and fail at runtime.
    • Compression flattening now reuses flattenForCompression from @context-chef/core (behavior unchanged).
    • An invalid sessionId (empty string, non-string, or a malformed contextChef namespace) now warns once and routes to the default session instead of failing silently. The Janitor missing-compression-config nag fires once per middleware instead of once per session.

Patch Changes

  • Updated dependencies [09ba1d6]:
    • @context-chef/core@3.9.0

@context-chef/core@3.9.0

Minor Changes

  • #45 09ba1d6 Thanks @MyPrototypeWhat! - Fix Gemini tool call correlation, harden Janitor compression failure paths, and add shared middleware infrastructure.

    • fromGemini now synthesizes tool call IDs with per-name counters spanning the whole conversation and correlates each functionResponse to the oldest unconsumed call of the same name (FIFO). Previously the correlation state was scoped to a single message, so responses arriving in a later content entry always fell back to the -0 suffix — repeat calls of the same tool produced duplicate IDs and misattributed results.
    • When the compression model throws, the raw error is no longer appended to the LLM-bound fallback summary. It now goes to the configured logger (default console) instead, keeping stack traces out of model context.
    • A throwing/rejecting onCompress hook no longer aborts compile(). It is caught and logged via logger; the compression result is kept. Hooks that follow the documented "must not throw" contract see no behavior change.
    • onBeforeCompress (and the deprecated onBudgetExceeded) now degrade the same way: a throwing hook is caught, logged via logger, and treated as if it returned null — default compression proceeds. Both hooks now share one failure stance: a broken hook never fails compile().
    • The text-placeholder vocabulary is centralized in Prompts: new getAttachmentPlaceholder (previously janitor-internal), getToolResultFilePlaceholder, and getToolResultPartPlaceholder. Formats are unchanged — this gives each convention a single source instead of scattered string literals.
    • New export SessionPool<T> — a keyed instance pool with LRU eviction, used by the middleware packages to hold one Janitor per conversation. maxSize is validated (throws RangeError unless a positive integer — a non-positive cap would silently evict every entry on insert, disabling pooling). Companion exports DEFAULT_SESSION_KEY, normalizeSessionKey, and dedupeConstructionWarnings back the middlewares' shared session-key normalization and construction-nag dedupe.
    • New export flattenForCompression(messages) — the canonical role-flattening implementation required by the summarizeHistory compress-callback contract (tool results → user messages, tool calls → assistant text).
    • OpenAIAdapter.compile replaces its per-message JSON.parse(JSON.stringify(...)) deep clone with a direct clone that skips undefined properties — same output, no string serialization detour (noticeable with base64 attachments). The clone honors toJSON, so a Date still lands as its ISO string.

@context-chef/tanstack-ai@0.6.0

Minor Changes

  • #45 09ba1d6 Thanks @MyPrototypeWhat! - Conversation isolation: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per ctx.conversationId instead of per middleware instance. Calls without a conversationId share one default slot (prior behavior). New maxSessions option caps concurrently tracked conversations (default 256, LRU-evicted). Previously a middleware instance reused across chat() calls leaked Janitor state across every conversation it served. Compression flattening now reuses flattenForCompression from @context-chef/core (behavior unchanged).

    An empty-string conversationId now warns once and routes to the default slot (previously it was silently treated as a distinct conversation, diverging from the AI SDK middleware's semantics). The Janitor missing-compression-config nag fires once per middleware instead of once per conversation.

Patch Changes

  • Updated dependencies [09ba1d6]:
    • @context-chef/core@3.9.0

@MyPrototypeWhat
MyPrototypeWhat merged commit 4cc85f6 into main Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant