Skip to content

Release notes · Agent SDK

Agent SDK Release Notes

Changelog for @cognipeer/agent-sdk. For usage, see the Agent SDK documentation.

[Unreleased]

Added

  • Documentation for smart-agent skills / progressive disclosure, including the Skill and SkillPolicy API, open_skill / bind_skill_tools, VitePress navigation, and tool-heavy agent guidance.

[0.9.6] - 2026-08-18

Changed

  • The planning tool is now manage_plan, not manage_todo_list. manage_todo_list's name collided, on downstream products with their own real "todo list" domain (a personal to-do backlog, unrelated to run planning), with a substring match used by a deterministic tool-recovery mechanism — it had no way to tell the SDK's own bookkeeping tool apart from a product's domain todo-list tool, and force-bound the wrong one. manage_todo_list still works exactly as before: it is now a deprecated alias sharing the same handler and the same plan state (stateRef.todoList / planVersion / adherenceScore) as manage_plan, both bound whenever planning is enabled, so an in-flight run or a caller still on the old name is unaffected. New export createManageTodoListAliasTool alongside the existing createManageTodoTool (which now builds the manage_plan tool). CONTROL_PLANE_TOOL_NAMES and the default criticalTools list carry both names for the duration of the alias. PlanEvent.source widens to "manage_plan" | "manage_todo_list" | "system" and reports whichever name was actually called.

[0.9.5] - 2026-08-17

Fixed

  • sanitizeTracePayload(undefined) no longer returns the string "undefined". JSON.stringify(undefined) returns the real undefined (not a string); JSON.parse of that then coerces its argument to the string "undefined" and throws, and the old catch-all fallback answered with String(undefined) — the literal string "undefined". A caller that treats an absent field as a record (e.g. a tool-details renderer that spreads it) split that string into single-character indexed keys instead of showing nothing. undefined now stays undefined all the way through.

[0.9.4] - 2026-08-17

Added

  • TracingConfig.metadata. Arbitrary key-value tags (e.g. { complexity: "complex" }) forwarded as-is on every tracing payload — session start, streaming events, session end, and the batched/OTLP session file (as cognipeer.metadata.<key> resource attributes) — purely so a downstream sink consumer can use them as reporting/attribution dimensions.

[0.9.3] - 2026-08-16

Added

  • Per-model-call structured-output contract on trace events. Complements the tool-menu trace section from 0.9.2: every ai_call event now carries a response_format section ({type, strategy?, schemaName?, strict?, schema?}) recording whether a schema was enforced on that call and how — native response_format (strategy: "native") or the SDK's injected response tool (strategy: "tool_based") — so a reply that isn't valid JSON can be told apart from a genuine model failure. Size-capped like the tool menu (section ≤64KB; beyond that the contract's identity survives while the schema body is dropped with a truncated marker).
  • finishReason on trace events, read from the provider's normalized response, so a length-truncated (output-ceiling) response is distinguishable from a model that simply answered badly.
  • reasoningTokens on trace events — a subset of outputTokens, matching OpenAI's completion_tokens_details.reasoning_tokens, so a spend investigation on a reasoning model can see where the token budget actually went. Omitted (not zeroed) when the provider reports nothing, since a model that does no reasoning and a provider that reports nothing are different facts.

Fixed

  • Native structured output could crash before a request was even sent, or produce a schema the provider would reject. The Zod → JSON Schema conversion passed options the pinned zod-to-json-schema doesn't support (openaiStrictMode, nameStrategy, $refStrategy: "extract-to-root", nullableStrategy); an unrecognised $refStrategy meant a recursive schema (z.lazy — comment trees, categories, org charts) recursed until RangeError: Maximum call stack size exceeded. Conversion now uses the library's real strict-mode switch (target: "openAi").

[0.9.2] - 2026-08-15

Added

  • Per-model-call tool menus on trace events. Every ai_call trace event now carries a tool_definitions section recording the exact tool menu the model was offered on that call ({name, description?, parameters?} per tool), since the bound tools can change between iterations and menus were previously never recorded per event. Size discipline matches the Cognipeer console ingest contract: ≤128 tools, name ≤200 / description ≤4000 chars, section ≤64KB. New exports: TraceToolDefinition, TraceToolDefinitionsSection, buildToolDefinitionsSection.

[0.9.1] - 2026-08-12

Added

  • needsApproval accepts a predicate — approvals decided per call. The gate previously read a static boolean, so a tool was either always gated or never: bash could be paused, but "pause before rm, not before ls" couldn't be expressed at all. needsApproval now takes boolean | ((args) => boolean), evaluated in the tools node with the parsed arguments in hand immediately before the call would run:
    ts
    needsApproval: (args) => /^\s*rm\b/.test(args.command)
    A predicate that throws counts as true — a gate that cannot decide has not granted permission — and a predicate-bearing tool is always placed in the sequential execution group, since the parallel/sequential split happens before arguments are parsed.
  • approvalPrompt accepts a function of the arguments, so the pause question can quote what is about to happen ("Run rm -rf build?") rather than describing the tool in general.
  • TraceToolDetails.approval.conditional marks a tool whose approval is decided per call; approval.required stays absent since there is no static answer to record.

Compatibility

  • Fully backward compatible: needsApproval: true | false and a plain approvalPrompt string behave exactly as before.

[0.9.0] - 2026-08-07

Added

  • InvokeConfig.preopenedSkills — deterministic skill activation. Discovery via open_skill is the model's decision, which is right for a capability and wrong for a policy: a rule that only applies when the model happens to notice it is not a rule. A caller can now name skill keys per invoke; each one is opened before the first model call, through the same open_skill tool the model would have called, and written into the transcript as an assistant tool call plus its tool result. Tool-call ids are derived from the skill key rather than random, so an unchanged preopen set produces a byte-identical prefix and provider prompt caching keeps hitting. Unknown, unavailable, and already-open keys are skipped rather than injecting a broken exchange.

[0.8.12] - 2026-08-04

Fixed

  • Summarization no longer archives the tool outputs the model just asked for. The recency window in contextSummarize was waived whenever no other compressible tool message existed — true on the very first pass, and again on every later pass once the backlog was archived, so the pass ate the freshest batch instead. The model then read the ARCHIVED_TOOL_RESPONSE markers, paged every payload back in with get_tool_response until that tool's execution budget ran out, and from then on simply re-issued the identical tool calls forever — a production research worker never terminated. The window is now unconditional and evaluated before the summary is generated, so a pass that can reclaim nothing costs no model call.
  • A deferred summarization pass no longer disables summarization for the rest of the run. __summarizationExhausted was sticky, so the first pass that couldn't reclaim anything stopped the agent from ever compacting again. The flag now re-arms as soon as new tool output lands.
  • Recovering an archived tool payload no longer crashes summarization when the history entry carries no output.

[0.8.11] - 2026-08-04

Added

  • Tool arguments are repaired before they are rejected. Grammar-constrained and smaller open-weight backends routinely emit arguments that are semantically right and syntactically wrong: a nested object arrives as a JSON string, a number as "60", a boolean as "true", a single value where a one-element array was wanted, or every argument wrapped in one input/args envelope key. validateToolArgs now validates the raw arguments first — so a model that emits well-typed arguments is unaffected — and only on failure runs the new coerceToolArgs re-typing pass and re-validates. Coercion never fabricates a value, so a genuinely missing required argument still fails.
  • Validation failures now say what the tool wanted. A rejected call reports the original Zod issues plus a one-line rendering of the tool's top-level parameters and their JSON types.

Changed

  • Optional nullable properties are published as plain types. Zod's .nullable().optional() produced anyOf: [X, {"type":"null"}] for every constrained field, which grammar-constrained decoders follow least reliably; for a property that isn't in required, the null branch is now dropped from the JSON Schema sent to the provider. Strict mode is unaffected, since there every property is required.

[0.8.10] - 2026-08-02

Fixed

  • Per-call reasoning config now merges with the adapter's default instead of replacing it. The adapter default is a property of the endpoint (for a self-hosted server, typically a providerExtras passthrough — a chat-template variable, a gateway flag); the per-call override is a property of the turn (an agent asking for more or less deliberation on this step). Replacing dropped the endpoint's fields the moment any agent set a per-run reasoning config — silently, on exactly the deployments that needed them. providerExtras is now merged key-wise, one level deep, so a call can override a single flag without restating the endpoint's whole passthrough.

Added

  • reasoning.effort: "none". An explicit "do not think" instruction for a model that otherwise defaults to reasoning — distinct from omitting reasoning entirely, and not a valid reasoning.level (there is no coherent "off" preset; reasoning.enabled: false is how the whole feature is turned off).

[0.8.9] - 2026-07-31

Fixed

  • Structured-output nudge and correction messages now use role: "user" instead of role: "system". Several OpenAI-compatible chat templates (e.g. Qwen-class models) reject a system message anywhere except the very start of the conversation, so the in-loop "you must respond with valid JSON" / "call response again with corrected values" nudges were rejected outright by those backends.

[0.8.8] - 2026-07-29

Fixed

  • Summarization spend is now recorded in state.usage. Summarization is a real model call, but the node reported its tokens only to the tracing sink. A host billing from result.metadata.usage was therefore short by exactly the summarizer's spend — and only on the long runs where summarization fires, i.e. the expensive ones. The ledger append that agent.ts and agentCore.ts had each open-coded is now recordUsage() in utils/usage.ts, called from the summarization node too.

[0.8.7] - 2026-07-29

Fixed

  • clampToBudget no longer drops the run's context anchor. With context.policy: "raw", the over-budget clamp removed messages from the front of the transcript — and the first casualty was the first user message, which for worker-style agents carries the entire operating context and task brief. Models that lost it concluded "no task was provided" and bounced an ask_user_question back to the user mid-run. The clamp now pins every system message plus the first user message and drops the oldest assistant/tool exchanges instead.
  • Hybrid turn window keeps the first user message in both counting modes.
  • Post-loop structured-output finalizer respects run pauses and budget signals, instead of continuing to nudge the model and execute tool calls after the main loop had already suspended for an approval, cancellation, summarization signal, or breached limit.
  • Tool-call arguments can now be reclaimed under context pressure — see two-axis retention below.

Added

  • Two-axis tool retention: input (arguments) and output (result). Argument retention is now its own axis and is opt-in — createTool({ retention: { input: "digest", output: "summarize_archive" } }), or overridden per tool by the caller. input: "digest" is field-level, never whole-object: only string fields longer than maxToolInputFieldChars are replaced with a digest descriptor, so identifying scalars (file paths, ids, indexes) survive verbatim. Control-plane tools (response, manage_todo_list, ask_user_question, open_skill, …) and delegation tools are never digested.
  • get_tool_response can page arguments back in: part: "input" | "output" (defaults to "output", so existing callers are unaffected).
  • prepare script so git-based installs (npm i github:Cognipeer/agent-sdk#branch) build dist/ automatically.

[0.8.6] - 2026-07-29

Changed

  • Internal refactor: extracted the shared recordUsage helper for per-request usage accounting (behavior unchanged).

[0.8.5] - 2026-07-26

Added

  • Search-based skill discovery — skillPolicy.disclosure: "search". Until now the only way for a model to learn which skills exist was the <available_skills> header block, which renders every skill's header into the system prompt on every turn — a cost that scales with the catalog size. Under disclosure: "search" nothing is rendered into the prompt; the runtime registers a search_skills tool instead, so discovery costs one tool description (constant) plus one tool call when the model actually needs a capability. search_skills({ query, limit? }) is ranked by the new exported searchSkills(), a pure, deterministic keyword/prefix matcher (no embeddings, no I/O). The default stays "catalog", so existing agents are unaffected. New exports: SkillDisclosure, searchSkills, createSearchSkillsTool.

[0.8.4] - 2026-07-26

Fixed

  • ask_user_question was registered twice on a smart agent's base runtime, which made resume() fail against providers that validate tool configs (Bedrock 400: The tool ask_user_question is already defined...). createSmartAgent builds the ask-user tool into the list it hands to createAgent and forwards humanInTheLoop alongside it, attaching a second copy. createAgent now attaches its built-ins only when the caller's list doesn't already carry a tool of that name.

Added

  • ASK_USER_TOOL_NAME is exported from the root, so callers that inspect or filter an agent's tool surface don't have to hardcode the string.

[0.8.3] - 2026-07-25

Added

  • file and audio content parts across the native provider layer. New unified FileContent / AudioContent types let multimodal messages carry documents (PDF, DOCX, CSV, …) and audio clips alongside text/images, with per-provider wire mapping for Vertex/Gemini, Anthropic, OpenAI (Chat Completions and Responses), and Bedrock Converse.
  • Adapter normalization for incoming attachment shapes — LangChain-style standard data blocks, OpenAI input_audio parts, raw data URLs, and already-unified source objects. Previously any non-text/image part was JSON.stringify-ed into the prompt as text (a token bomb that also hid the attachment from the model).

Fixed

  • Vertex URL images no longer hardcode image/jpeg. MIME type is now taken from the part's mediaType or inferred from the URL extension.

[0.8.2] - 2026-07-22

Added

  • Tracing: caller-supplied sessionIdTracingConfig.sessionId lets a caller key the trace session by their own run/task/chat id instead of the auto-generated sess_… id.
  • Tracing: agentName overrideTracingConfig.agentName overrides the SmartAgent's own name in the emitted session/start payload.

Changed

  • Tracing transport is now reliable. The cognipeer/http streaming and batched posts (start, end, full-session) retry transient failures (network error, timeout, 404/408/425/429/5xx) with exponential backoff + jitter, honor Retry-After, and apply a per-attempt timeout. Previously a single transient failure silently dropped the whole trace session.

[0.8.1] - 2026-07-20

Added

  • ContextPilot: native, deterministic context/token optimization layer. Opt-in via contextPilot: { enabled: true }. Runs at tool-execution time (no extra model calls) to shrink large tool outputs before they enter the transcript, while keeping every original payload recoverable: format-aware compression (BM25-lite relevance scoring driving jsonCrusher, textCrusher, plus dedicated diffCompressor, logCompressor, searchCompressor), a reversible compress-cache-retrieve store recoverable via get_tool_response, cross-turn duplicate detection, and cache-alignment warnings for volatile prompt substrings that would defeat provider-side prompt caching. Real-model A/B benchmarks measured 29–48% prompt-token reduction with no loss of answer correctness.

Fixed

  • Restored provider tool-result coalescing that had regressed in 0.8.0. The published 0.8.0 was built from the feature branch before the Anthropic / Bedrock / Vertex tool-result coalescing (shipped in 0.7.3) was merged, so 0.8.0 silently dropped it. Upgrading 0.8.0 → 0.8.1 regains correct strict tool_use/tool_result pairing on tool-heavy turns.

[0.8.0] - 2026-07-20

Builds directly on the ask-user primitive (0.6.6) and the skill primitive (0.7.2) shipped over the preceding months.

Added

  • Sub-agents (dynamic problem decomposition). Opt-in — a plain createSmartAgent({ model }) registers no sub-agent tools. Pass subagents: SubagentDef[] and/or subagentPolicy to expose delegate_to(subagent, input) for predefined registry sub-agents, spawn_subagent({ role, prompt, input, tools? }) for ad-hoc specialists the orchestrator defines at runtime, and spawn_subagents_parallel({ tasks }) for concurrent fan-out. Children inherit the parent's event / streaming / cancellation / tracing wiring and the existing delegation guards (maxDepth, maxChildCalls, childContextPolicy); a tool-approval or ask_user_question pause inside a sequential sub-agent surfaces to the parent and resumes transparently.
  • Prompt-override hooks (promptHooks). transformSystemPrompt(prompt, ctx), toolDescriptions (override any built-in tool description by name), and subagentCatalog(defaultBlock, subagents) let a caller intercept the SDK's otherwise-static prompt surfaces.
  • asTool now forwards observability. Delegated children spawned via agent.asTool(...) previously ran "dark"; they now inherit the parent's onEvent / onStream / onProgress / cancellation wiring.
  • Testing & evaluation surface. New deterministic suites for the sub-agent primitive, an integration test running the public runSmartAgentEvalHarness with a scripted (key-free) model, and a provider-matrix suite (npm run test:matrix) that verifies tool-calling / structured-output / streaming against any real provider whose credentials are present. New Testing & Evaluation guide.

Fixed

  • Sub-agent human-in-the-loop resume no longer strands the run, when a delegating tool (delegate_to / spawn_subagent) paused for a child approval / ask_user_question in the same assistant turn as another tool that completed.
  • Two concurrent sub-agent pauses drain deterministically, instead of resolving one force-resolving the other with empty answers.
  • Ad-hoc sub-agents keep their borrowed tools across a HITL resume.
  • Bound skill tools survive pause/resume, instead of the per-invoke skill registry rebuilding empty on every invoke.
  • promptHooks.toolDescriptions function form no longer corrupts sub-agent tool descriptions.
  • Sub-agents are opt-in. Previously a plain createSmartAgent registered spawn_subagent + spawn_subagents_parallel and injected an <available_subagents> block by default.
  • Parallel spawn budget is charged only for tasks that run, instead of counting invalid tasks (unknown sub-agent, ad-hoc disabled) against maxChildCalls.
  • SKILL.md frontmatter no longer splits scalar values on commas.

[0.7.3] - 2026-07-14

Fixed

  • Coalesced multiple tool results into a single user message for Anthropic, Bedrock, and Vertex. These providers require strict tool_usetool_result pairing; when an assistant turn produced several tool calls, each tool_result had previously been sent as its own message. Results answering one assistant turn are now merged into a single user-role message per provider request, satisfying the pairing requirement and reducing per-turn message overhead on tool-heavy runs.

[0.7.2] - 2026-06-17

Added

  • Skill primitive for progressive capability disclosure. New src/smart/skills/ module replaces the up-front tool-selector with on-demand skill opening, keeping the bound-tool count per step small — the property small/weaker models need. open_skill / bind_skill_tools per-invoke tools (mirroring the ask-user tool's stateRef pattern): a "small" skill binds all its tools at once, a "fat" skill returns a ranked tool index and binds a deterministic default floor for models that give no usable query. New Skill / SkillPolicy types (with a SMALL_TIER preset), and a pure composeToolSets that rebuilds both runtime tool-set variants with fresh references so newly-bound tools actually propagate across the identity-swap the runtime uses to sync tools between invokes.
  • Wired into createSmartAgent. Passing opts.skills builds a per-invoke skill registry, adds an <available_skills> header block to the system prompt (availability/tier resolved per invoke), and introduces a generic __runtimeToolsDelta marker so a tool that binds new tools mid-run (like open_skill) makes them callable on a later turn within the same loop.
  • New docs/guide/skills.md and docs/api/skills.md reference pages.

[0.7.1] - 2026-06-01

Added

  • Native reasoning round-trip (thinking blocks). Provider responses now surface a normalized reasoning payload ({ blocks, summary }). Anthropic and Bedrock thinking / redacted-thinking blocks (with signatures) are captured on the assistant message and replayed verbatim on the next request, satisfying the providers' signed-thinking requirement. Vertex/Gemini thought parts and reasoning token counts are surfaced as a summary. OpenAI o-series / gpt-5 now route through the Responses API when reasoning is requested; Azure OpenAI gets the same via its /openai/responses route.
  • reasoning.level: "minimal". A fourth, cheapest reasoning preset (effort: "minimal", reflection off).
  • initial_then_after_tool reflection cadence. Reflects once up-front as a planning note, then like after_tool. New default for level: "medium" / "high".
  • Reflection hooks and routing. reasoning.reflection accepts shouldReflect (override the cadence decision), buildPrompt (customize the probe), onReflection (side-effect hook), and feedTo: "memory" | "plan" | "none" to route the note into a MemoryFact or plan.lastReflection.
  • validateReasoningConfig(config). Exported pure validator that throws descriptive errors for invalid level, cadence, effort, budgetTokens, everyNTurns, or feedTo values.

Fixed

  • Reflection throttling is now run-scoped. reasoning.reflection.maxPerRun counts reflections within the current invoke(...) instead of the whole (possibly resumed) conversation.
  • Native reasoning config lifecycle. ctx.__reasoning is (re)applied on every invoke and cleared when native reasoning is disabled, so a resumed run can no longer inherit a stale reasoning configuration.

[0.7.0] - 2026-05-21

Changed (BREAKING)

  • Default runtime-profile values modernized for frontier models. All four built-in profiles (fast, balanced, deep, research) had their numeric defaults rescaled for 2026-era models (Claude 4.x, GPT-4o, Gemini 2.x) — the previous defaults were tuned for 8k–16k context windows and left too much headroom unused. Headline changes: fast maxToolCalls 4→8, maxContextTokens 12000→32000; balanced (the shared baseline) maxToolCalls 8→20, maxContextTokens 24000→96000; deep maxToolCalls 14→40, maxContextTokens 42000→200000; research maxToolCalls 20→80, maxContextTokens 56000→400000 — with each profile's summarization trigger, lastTurnsToKeep, maxChildCalls, and maxToolResponseChars scaled proportionally. Callers depending on the old conservative caps should pass explicit limits / summarization / context / toolResponses overrides, or a customProfile.

Added

  • Tool observability tracing. New TraceToolDetails type captures detailed per-call tool information — execution status, retention policy, approval state — on trace events.

[0.6.6] - 2026-05-20

Added

  • Ask-user (structured human-in-the-loop). Opt in with humanInTheLoop: { askUser: true } on createAgent / createSmartAgent to register a built-in ask_user_question tool. When the model calls it, the runtime pauses with a PendingUserQuestion entry, emits a user_question event, and sets ctx.__awaitingUserQuestion. Resume by calling agent.resolveUserQuestion(state, { id, answers }), which validates the response and appends it as a role: "tool" message bound to the original tool_call_id. The global allowFreeText flag (default true) decides whether "Other" / typed answers are accepted; when false, every question must include >= 2 options. New exports: resolveUserQuestionState, createAskUserQuestionTool, and types PendingUserQuestion, UserQuestionItem, UserQuestionOption, UserQuestionAnswer, UserQuestionAnswerSet, UserQuestionResolution, UserQuestionEvent, HumanInTheLoopOptions.

[0.6.5] - 2026-05-18

Added

  • Parallel tool execution. limits.maxParallelTools now actually fans non-approval tool calls across a bounded worker pool while preserving tool_use → tool_result order for Bedrock / Anthropic strict pairing.
  • Anthropic / Bedrock prompt caching. Opt in via prompt_caching: { enabled: true } on the provider; system + final tool definition receive cache_control: ephemeral (Anthropic) or cachePoint blocks (Bedrock Converse). Typical input-token cost drops by ~90% on long tool-heavy runs.
  • Opt-in tool result cache. createTool({ cache: true | { keyFn?, ttlMs? } }) short-circuits duplicate args within an invoke; cached hits surface as state.toolHistory[].fromCache === true.
  • Per-tool retry / circuit breaker. createTool({ retry: { maxRetries, backoffMs, shouldRetry, circuitBreakerThreshold } }) retries transient errors with exponential backoff and trips a breaker after consecutive failures.
  • Provider retry + backoff. Native providers automatically retry 429 / 5xx with Retry-After. Configure via createProvider({ retry }).
  • Delegation enforcement. asTool reads the parent's resolved delegation policy at runtime and enforces mode, maxDelegationDepth, maxChildCalls, and childContextPolicy (minimal / scoped / full).
  • Budget limits. AgentLimits gains maxTotalOutputTokens, maxCostUsd, and maxWallClockMs. Pair maxCostUsd with costEstimator on the agent options.
  • Pluggable token counter. AgentOptions.tokenCounter swaps the built-in character heuristic for a real tokenizer per-invoke. Exported helpers: setTokenCounter, getTokenCounter, defaultTokenCounter.
  • Reflection budget. reasoning.reflection.maxPerRun and reasoning.reflection.everyNTurns cap reflection cost on tool-heavy invokes.
  • stateRef per-invoke isolation. Concurrent invocations on the same agent instance no longer share plan / todo / tool-history references.

Fixed

  • Summarizer uses state.agent?.model (live runtime model), so handoffs and per-invoke model overrides reach compaction too.
  • __summarizationExhausted is cleared automatically when a new compactable tool result is appended; prevents deadlocks after partial retention bouts.
  • state.ctx mutations from toolsNode propagate to the caller correctly (delta now explicitly returns ctx).
  • Smart-agent runtime tool set includes the structured-output response finalize tool when outputSchema is set.
  • Base-loop safety check honours the new __limitBreached exit reason.
  • asTool delegation sub-agents pre-initialize _stateRef so the parent's tools node can deposit parentRuntime / ctx before the delegation runs.

Changed

  • Documentation refreshed: limits/tokens, summarization, tool development, runtime profiles, native providers, getting started, and API reference now cover the new budget surfaces, prompt caching, parallel tool exec, tool cache/retry, delegation enforcement, and pluggable token counter.

[0.6.4] - 2026-04-29

Fixed

  • Per-call tool_choice override was sent even when no tools were bound. The reflection node temporarily disables tools by clearing the tool list, but still passed a tool_choice override alongside it. Both the native adapter and the OpenAI provider now only forward tool_choice when tools.length > 0.

Changed

  • toolResponses.defaultPolicy now inherits context.toolResponsePolicy (falling back to the active runtime profile default) instead of always defaulting to "summarize_archive" regardless of what context.toolResponsePolicy was set to.

[0.6.3] - 2026-04-28

Fixed

  • A synthetic summarize_context marker could leak out as a fake final answer. When the base loop exited purely to signal SmartAgent that summarization was needed, the last assistant message in state could be the internal synthetic summarization call rather than a real answer. createAgent now suppresses finalAnswer / stream events in that case, and createSmartAgent stops running a post-turn summarization pass once the model has already produced a real terminal assistant turn.

[0.6.2] - 2026-04-22

Changed

  • Removed additional stale no-op config fields: context.archiveLargeToolResponses, context.retrieveArchivedToolResponseOnDemand, and toolResponses.retryOnSchemaError (continuing the surface cleanup started in 0.6.0).
  • Context tools refactored into individually exported functions (createManageTodoTool and others) and gained a hasToolResponseRecoveryReference guard that recognizes all four retention placeholder markers (ARCHIVED_TOOL_RESPONSE, STRUCTURED_TOOL_RESPONSE, SUMMARIZED_TOOL_RESPONSE, DROPPED_TOOL_RESPONSE) before honoring a get_tool_response recovery request.

[0.6.1] - 2026-04-21

Added

  • Unified reasoning configuration on createAgent(...) / createSmartAgent(...) for provider-native reasoning plus post-tool reflection, generated by a new reflection node that produces insights without polluting the assistant's message history.
  • Reflection persistence on state.reflections plus reflection events for streaming UIs and task timelines.
  • Native provider reasoning mappings for OpenAI/Azure/OpenAI-compatible, Anthropic, and Vertex/Gemini through the built-in provider layer.

Changed

  • Getting-started, native-provider, state-management, tracing, and type docs were refreshed to describe reasoning/reflection behavior.

[0.6.0] - 2026-04-21

Changed (BREAKING)

  • Tool response retention collapsed to a single lazy-summarizer model. Tool outputs are never reduced at tool-call time. When the summarizer runs (context limit reached), old tool messages are rewritten according to toolResponses.defaultPolicy (default summarize_archive); the full payload always stays available via get_tool_response because it is stored in state.toolHistory / state.toolHistoryArchived.
  • Removed config fields (no backward compatibility): toolResponses.smallResponseChars, smallResponsePolicy, largeResponsePolicy, fallbackPolicy, keepRecentFullCount.
  • Classification enum simplified to critical | informative | verbose (removed small, redundant).
  • maxToolResponseChars / maxToolResponseTokens now only drive an eager hard-cap truncation for non-critical, oversized single responses; the truncated head points at get_tool_response for recovery.
  • Summarization placeholder prefixes standardized: STRUCTURED_TOOL_RESPONSE, ARCHIVED_TOOL_RESPONSE, DROPPED_TOOL_RESPONSE.

[0.5.4] - 2026-04-21

Changed

  • npm republish of the 0.5.3 source snapshot from the same gitHead; no additional repository diff was recorded for this publish.

[0.5.3] - 2026-04-18

Fixed

  • Strict tool-schema mode now falls back safely instead of emitting a schema OpenAI's strict mode would reject. A new shape-scanner (hasStrictUnsafeShape) detects untyped object properties, $refs, and unconstrained anyOf/oneOf/allOf compositions that strict mode can't represent; when a tool's schema contains one, strict mode is silently disabled for that tool instead of sending an invalid strict: true tool definition the provider would reject outright.

[0.5.2] - 2026-04-17

Changed

  • Native structured output now parses in a single pass instead of always going through the retry/nudge loop. When the active strategy is "native" (the provider's own response_format: json_schema contract), the model's text output is guaranteed valid JSON, so the agent loop parses and finalizes immediately on the first text response — no nudges, no extra round-trips. Retries are now reserved for the "tool_based" strategy, where the model can still skip calling the response tool.

Fixed

  • Strict JSON Schema conversion no longer sends the unsupported format keyword, which some strict-mode validators reject outright.

[0.5.1] - 2026-04-15

Changed

  • Internal refactor: consolidated message-content extraction and token-counting into shared utilities (extractMessageText, countMessagesTokens), simplified the createSmartAgent summarization call path behind a trySummarize helper, and removed the unused legacy tokenManager utility and debug logger. No public behavior change.

[0.5.0] - 2026-04-14

Added

  • Native LLM provider layer (src/providers/) — direct API access for six providers without LangChain or any framework dependency. createProvider(config) supports "openai", "anthropic", "azure", "bedrock", "vertex", "openai-compatible"; fromNativeProvider(provider, options?) wraps any provider as a BaseChatModel for drop-in agent-sdk use. Includes a unified ChatCompletionRequest / ChatCompletionResponse schema, an SSE stream parser, AWS Signature V4 signing for Bedrock (zero AWS SDK dependency), and a Google Vertex service-account-JSON → JWT → access-token flow, all built in. 38 new unit tests and a new Native Providers guide.

[0.4.9] - 2026-04-13

Changed

  • npm republish of the 0.4.8 source snapshot from the same gitHead; no additional repository diff was recorded for this publish.

[0.4.8] - 2026-04-10

Changed

  • Removed watchdog telemetry from the smart agent (metrics/config plumbing and its documentation); summarization logic no longer references watchdog metrics. Internal cleanup, no public API change.

[0.4.7] - 2026-04-09

Fixed

  • A plain createAgent (no summarization configured) could throw "Agent context exceeded the available budget" even though nothing had asked for summarization. The internal __needsSummarization signal introduced in 0.4.6 was being set regardless of whether summarization was actually configured. The active summarization threshold is now resolved once per agent (undefined when summarization isn't configured) and the signal is cleared whenever it's inactive.

[0.4.6] - 2026-04-09

Added

  • Safety check for abnormal loop exit. If the base loop terminates with an unresolved tool response and no valid exit condition is active (approval pause, cancellation, checkpoint, structured-output finalize, summarization signal), it now throws a descriptive error instead of silently leaking the raw tool output to the caller as if it were the final answer.

Fixed

  • The final answer is now read from the last assistant message, not just the last message in state — closes a class of bug where a stray trailing message could be returned as the agent's answer.

[0.4.5] - 2026-04-07

Added

  • Summarized tool responses now carry retrieval references. The placeholder left behind for a compacted tool message changed from a bare "SUMMARIZED" string to SUMMARIZED_TOOL_RESPONSE [toolName=…; toolCallId=…; executionId=…] plus a one-line summary and a get_tool_response hint, so the model (and downstream renderers) can tell which call was summarized and how to recover it, instead of an opaque marker.

Changed

  • get_tool_response's description and schema were expanded to also recognize SUMMARIZED_TOOL_RESPONSE references, not just ARCHIVED_TOOL_RESPONSE / DROPPED_TOOL_RESPONSE.

[0.4.4] - 2026-04-06

Changed

  • npm republish of the 0.4.3 source snapshot from the same gitHead; no additional repository diff was recorded for this publish.

[0.4.3] - 2026-04-05

Fixed

  • Summarization could trigger prematurely. The context-size check that signals SmartAgent to summarize was reading summarization.maxTokens (which controls summary output size) instead of the intended summarization.summaryTriggerTokens threshold. It now prefers summaryTriggerTokens and only falls back to maxTokens when the former isn't set.
  • A tool response kept with retentionPolicy: "keep_full" was losing its summary field (set to an empty string); the summary is now always computed before branching on retention policy.

[0.4.2] - 2026-04-04

Changed

  • get_tool_response's description was rewritten for clarity, spelling out the exact ARCHIVED_TOOL_RESPONSE [executionId=…] / DROPPED_TOOL_RESPONSE [executionId=…] markers it expects and confirming it also accepts the original tool_call_id.
  • Archived and dropped tool responses now surface as explicit ARCHIVED_TOOL_RESPONSE [executionId=…] / DROPPED_TOOL_RESPONSE [executionId=…] messages (previously a single undifferentiated placeholder), each pointing back at get_tool_response.

Fixed

  • Safer JSON serialization fallback for tool-response summarization when JSON.stringify returns a non-string result.

[0.4.1] - 2026-04-03

Changed

  • npm republish of the 0.4.0 source snapshot; the only repository changes in this window were documentation/site theming, not part of the published package.

[0.4.0] - 2026-03-16

Added

  • OTLP tracing sink/export helpers plus richer trace/session correlation fields (traceId, spanId, parentSpanId, threadId)
  • Workbench integration tests covering invoke, tools, streaming, planning, and summarization flows

Changed

  • Tracing configuration now exposes explicit mode support and a wider public export surface for remote session handling
  • Debugging, getting-started, and core-concepts docs were refreshed to describe the expanded tracing model

[0.3.1] - 2026-02-18

Added

  • threadId tracing support for grouping multiple agent sessions under a single workflow or conversation

Changed

  • Debugging docs were updated to explain grouped trace sessions and workflow-level correlation

[0.3.0] - 2026-02-16

Added

  • startStreamingSession tracing helper export for streaming trace backends

Changed

  • Agent/tracing runtime wiring was updated to prepare the streaming-session path

[0.2.9] - 2026-02-06

Added

  • Tracing integration test coverage

Changed

  • Token counting and context-budget heuristics were tightened for more accurate summarization thresholds
  • Agent-core and decision logic around summarization flow were simplified

[0.2.8] - 2026-02-06

Changed

  • Version-only npm publish on top of the 0.2.7 line; no distinct source diff was recorded beyond the release bump

[0.2.7] - 2026-02-06

Added

  • Comprehensive unit and integration test suites for agents, smart agents, approvals, pause/resume, snapshots, prompts, summarization, and token management
  • Shared test fixtures/mocks and a Bedrock example in the examples workspace

Changed

  • Example workspace dependencies and package metadata were refreshed
  • Trace section utilities and usage helpers were expanded for diagnostics and testability

[0.2.6] - 2026-02-05

Changed

  • npm republish of the 0.2.3 source snapshot from the same gitHead; no additional repository diff was recorded for this publish

[0.2.5] - 2026-02-05

Changed

  • npm republish of the 0.2.3 source snapshot from the same gitHead; no additional repository diff was recorded for this publish

[0.2.4] - 2026-02-05

Changed

  • npm republish of the 0.2.3 source snapshot from the same gitHead; no additional repository diff was recorded for this publish

[0.2.3] - 2026-02-04

Changed

  • SmartAgent summarization settings were refactored around clearer configuration and limit semantics
  • Core agent, model, tools, tracing, and public types were updated to match the new summarization/runtime shape
  • API docs, getting-started guides, limits docs, and examples were refreshed accordingly

[0.2.2] - 2026-01-09

Changed

  • npm republish of the 0.2.0 source snapshot from the same gitHead; no additional repository diff was recorded for this publish

[0.2.1] - 2026-01-08

Changed

  • npm republish of the 0.2.0 source snapshot from the same gitHead; no additional repository diff was recorded for this publish

[0.2.0] - 2026-01-06

Changed

  • Documentation and example instructions were cleaned up for more consistent project setup and example execution
  • README and examples were clarified ahead of the 0.2.x release line

[0.1.2] - 2025-10-17

Added

  • Conversation guardrails, human-in-the-loop tool approvals, and comprehensive tracing with multiple sink options and session management

Changed

  • Agent and Smart Agent types were unified and observability hooks were improved
  • README and docs were expanded and reorganized across the published package surface

Fixed

  • Trace ai_call events now include token fields consistently
  • Session path references were normalized in the docs

[0.1.1] - 2025-09-26

Added

  • Initial npm release of the SDK with the base agent loop, smart-agent runtime, planning/TODO tools, summarization, structured output, tool limits, tracing/debug hooks, and documentation

For detailed changes, see GitHub Releases.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub