CHANGELOG.md
CHANGELOG.md
All notable changes to the Sharti Connector plugin are documented here.
Format follows Keep a Changelog.
Modular architecture. The former monolithic generator.ts has been decomposed into purpose-focused modules:
Leveled diagnostic logging. New ShartiLogger provides five severity channels (debug, info, notice, warn, error) controlled by three user-selectable levels (minimal, normal, debug). Warnings and errors surface in the chat with emoji badges; operational detail stays in the console. Controlled by the new Log Level setting.
Aggregated turn statistics. A TurnStatAccumulator persists across multiple generate() invocations within a single conversational turn (i.e., it survives tool-handoff round-trips). At turn end it emits a compact one-line summary:
Scope isolation is achieved via a stable conversation-thread key (hash of system prompt + first user message); a bounded LRU (max 32 threads) prevents unbounded growth.
In-chat turn summary display. New Show Turn Summary in Chat toggle (default: on). When enabled, the aggregated summary above is written into the chat window at turn end. On subsequent requests the marker is stripped from assistant history before resending, so the model never sees it.
Canonical config defaults. All default values are declared once in the exported CONFIG_DEFAULTS object and referenced everywhere (schema, coercion fallbacks, request builder). Changing a default touches exactly one place.
Exported ShartiConfig type. Derived from the schematics via InferParsedConfig; gives strong static typing to every handler that reads configuration.
Generation statistics. Collects and logs per-response metrics: input/output token counts, generation speed (tok/s), time-to-first-token (TTFT), prefill throughput, and KV-cache hit size.
Truncation & content-filter notices. When the provider terminates a stream with finish_reason: "length" (max tokens exhausted) or finish_reason: "content_filter", a visible warning is appended directly in the chat message.
Custom Sampling OFF now sends a minimal payload. Toggling Custom Sampling off suppresses all non-structural parameters β sampling, tools, reasoning, priority, timeout β resulting in a bare request containing only model, messages, and streaming flags.
Custom Sampling config description updated to accurately describe the new minimal-payload behaviour.
Initial public release of the Sharti Connector plugin for LM Studio.
All notable changes to the Sharti Connector plugin are documented here.
Format follows Keep a Changelog.
Modular architecture. The former monolithic generator.ts has been decomposed into purpose-focused modules:
Leveled diagnostic logging. New ShartiLogger provides five severity channels (debug, info, notice, warn, error) controlled by three user-selectable levels (minimal, normal, debug). Warnings and errors surface in the chat with emoji badges; operational detail stays in the console. Controlled by the new Log Level setting.
Aggregated turn statistics. A TurnStatAccumulator persists across multiple generate() invocations within a single conversational turn (i.e., it survives tool-handoff round-trips). At turn end it emits a compact one-line summary:
Scope isolation is achieved via a stable conversation-thread key (hash of system prompt + first user message); a bounded LRU (max 32 threads) prevents unbounded growth.
In-chat turn summary display. New Show Turn Summary in Chat toggle (default: on). When enabled, the aggregated summary above is written into the chat window at turn end. On subsequent requests the marker is stripped from assistant history before resending, so the model never sees it.
Canonical config defaults. All default values are declared once in the exported CONFIG_DEFAULTS object and referenced everywhere (schema, coercion fallbacks, request builder). Changing a default touches exactly one place.
Exported ShartiConfig type. Derived from the schematics via InferParsedConfig; gives strong static typing to every handler that reads configuration.
Generation statistics. Collects and logs per-response metrics: input/output token counts, generation speed (tok/s), time-to-first-token (TTFT), prefill throughput, and KV-cache hit size.
Truncation & content-filter notices. When the provider terminates a stream with finish_reason: "length" (max tokens exhausted) or finish_reason: "content_filter", a visible warning is appended directly in the chat message.
Custom Sampling OFF now sends a minimal payload. Toggling Custom Sampling off suppresses all non-structural parameters β sampling, tools, reasoning, priority, timeout β resulting in a bare request containing only model, messages, and streaming flags.
Custom Sampling config description updated to accurately describe the new minimal-payload behaviour.
Initial public release of the Sharti Connector plugin for LM Studio.
Behavioral parameters decoupled from Custom Sampling. preserve_thinking, priority, and timeout are now sent unconditionally regardless of the Custom Sampling toggle. Only pure tuning/sampling parameters (temperature, top-k/p/min-p, penalties, seed, max-tokens, reasoning, thinking-budget) are suppressed when Custom Sampling is off. This ensures request routing and lifecycle controls remain active even in "bare minimum" mode.
Table-driven error handling. Provider-error-code β message mappings are now stored as lookup tables (CODE_MESSAGES, STATUS_MESSAGES) instead of a procedural switch. Adding a recognised failure mode requires one table rowβzero control-flow edits.
Stronger type safety at boundaries. Introduced precise structural types (ShartiCompletionsBody, UpstreamChunk, UpstreamDelta, UpstreamChoice, UpstreamUsage) that eliminate any casts at the OpenAI-SDK integration points. The outgoing body uses a literal stream: true so the SDK resolves its streaming overload natively.
Single reusable OpenAI client per generate() call. Previously a new client instance was created per retry attempt; now one client is instantiated upfront and reused across retries, preserving connection pooling.
Refined truncation/content-filter notifications. Truncation and content-filter events are now routed through the logger (warn channel) instead of appending raw text fragments directly to the chat stream, ensuring consistent styling and respecting the chosen log level.
Updated customSampling field subtitle to enumerate exactly which parameters are suppressed when the toggle is off.
think tags and reasoning_content)src/
βββ index.ts # Entry point
βββ config.ts # Schema + CONFIG_DEFAULTS + ShartiConfig type
βββ constants.ts # Shared delimiters & markers
βββ types.ts # Wire types, request body, stream chunk, stats
βββ generator.ts # Thin orchestrator (validation β convert β request β stream β stats)
βββ request.ts # Client factory, payload assembly, debug dump
βββ errors.ts # Table-driven error classification & messaging
βββ stats.ts # Per-turn accumulator + session-scoped LRU store
βββ convert/
β βββ messages.ts # History β OpenAI conversion, sanitization, conv-key derivation
β βββ stream.ts # Delta rendering, reasoning blocks, tool-call assembly, metrics
βββ utils/
βββ logger.ts # Leveled logging (ShartiLogger)
βββ coerce.ts # Safe runtime type guards
βββ block.ts # Structured multi-line log block formatter
π‘ Calls: 3 | Tokens: 4210 in / 187 out | TTFT: 210ms | Speed: 42.3 tps | Time: 3.41s
Behavioral parameters decoupled from Custom Sampling. preserve_thinking, priority, and timeout are now sent unconditionally regardless of the Custom Sampling toggle. Only pure tuning/sampling parameters (temperature, top-k/p/min-p, penalties, seed, max-tokens, reasoning, thinking-budget) are suppressed when Custom Sampling is off. This ensures request routing and lifecycle controls remain active even in "bare minimum" mode.
Table-driven error handling. Provider-error-code β message mappings are now stored as lookup tables (CODE_MESSAGES, STATUS_MESSAGES) instead of a procedural switch. Adding a recognised failure mode requires one table rowβzero control-flow edits.
Stronger type safety at boundaries. Introduced precise structural types (ShartiCompletionsBody, UpstreamChunk, UpstreamDelta, UpstreamChoice, UpstreamUsage) that eliminate any casts at the OpenAI-SDK integration points. The outgoing body uses a literal stream: true so the SDK resolves its streaming overload natively.
Single reusable OpenAI client per generate() call. Previously a new client instance was created per retry attempt; now one client is instantiated upfront and reused across retries, preserving connection pooling.
Refined truncation/content-filter notifications. Truncation and content-filter events are now routed through the logger (warn channel) instead of appending raw text fragments directly to the chat stream, ensuring consistent styling and respecting the chosen log level.
Updated customSampling field subtitle to enumerate exactly which parameters are suppressed when the toggle is off.
think tags and reasoning_content)src/
βββ index.ts # Entry point
βββ config.ts # Schema + CONFIG_DEFAULTS + ShartiConfig type
βββ constants.ts # Shared delimiters & markers
βββ types.ts # Wire types, request body, stream chunk, stats
βββ generator.ts # Thin orchestrator (validation β convert β request β stream β stats)
βββ request.ts # Client factory, payload assembly, debug dump
βββ errors.ts # Table-driven error classification & messaging
βββ stats.ts # Per-turn accumulator + session-scoped LRU store
βββ convert/
β βββ messages.ts # History β OpenAI conversion, sanitization, conv-key derivation
β βββ stream.ts # Delta rendering, reasoning blocks, tool-call assembly, metrics
βββ utils/
βββ logger.ts # Leveled logging (ShartiLogger)
βββ coerce.ts # Safe runtime type guards
βββ block.ts # Structured multi-line log block formatter
π‘ Calls: 3 | Tokens: 4210 in / 187 out | TTFT: 210ms | Speed: 42.3 tps | Time: 3.41s