unstale

npm / @mastra/client-js

@mastra/client-js

What changed in @mastra/client-js 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

18 breaking1 security3 deprecations127 new APIs and options1 performance7 behavior and defaults25 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@mastra/client-js 1182 changes

Breaking changes 18

  • When a model calls several client tools in one step, all tools now run and their results are returned together; aborted requests start no further client tools.

    1.60.0release notes

  • The request type now requires traceId; callers that omitted it must supply it.

    1.60.0release notes

  • The request type now requires traceId; callers that omitted it must supply it.

    1.60.0release notes

  • Return types now include { accepted: true } for supporting Platform backends; acceptance means cleanup is queued, not completed, and callers must narrow before reading success.

    1.60.0release notes

  • Return types now include { accepted: true } for supporting Platform backends; acceptance means cleanup is queued, not completed, and callers must narrow before reading success.

    1.60.0release notes

  • Return types now include { accepted: true } for supporting Platform backends; acceptance means cleanup is queued, not completed, and callers must narrow before reading success.

    1.60.0release notes

  • The thread rows type returned by queryTraceThreads() no longer includes model or provider.

    1.57.0release notes

  • Pass the session ID to session() and provide resourceId to create(); the scope argument is removed. Creating without resourceId resumes the existing resource or uses the session ID for a new one.

    1.56.0release notes

  • Response types add context and parent/root entity fields and no longer include cost, inputTruncated, outputTruncated, or errorTruncated.

    1.56.0release notes

  • Adds thread rows, activity sorting, and direct filters; the request shape changes, and QueryTraceThreadsResult now describes full thread rows. Use QueryTraceThreadsResult<typeof request> for legacy identity results.

    1.56.0release notes

  • Supports mode: 'merge' for atomic working-memory merges; requests are rejected with HTTP 400 when the storage adapter does not support atomic merges.

    1.53.0release notes

  • Requests conflicting with a run's state now return 409 Conflict instead of 500.

    1.53.0release notes

  • With reconnect enabled, resubscribe failures with 4xx or 501 errors now reject with the original error instead of retrying; other documented retry cases remain.

    1.53.0release notes

  • AgentController switchModel no longer accepts an options argument; model selection persists to the active thread and remains active when its mode changes.

    1.52.0release notes

  • Now reports whether an approval was accepted, returning { ok: false, reason } for stale, duplicate, or no-longer-pending decisions; it no longer retries automatically.

    1.51.1release notes

  • Now reports whether a suspension response was accepted, returning { ok: false, reason } for stale, duplicate, or no-longer-pending decisions; it no longer retries automatically.

    1.51.1release notes

  • Streams emit one complete message_start payload, ID-addressed message_update events, and a message_end containing only the message ID; consumers must store and update messages by ID.

    1.47.0release notes

  • queryTraces() no longer supports thread-group responses; it accepts trace-only queries and returns trace records.

    1.46.0release notes

Security 1

  • The package no longer depends on @ai-sdk/ui-utils, which included a vulnerable version of @ai-sdk/provider-utils; streaming works as before.

    1.56.0release notes

Deprecations 3

  • experimentIdA and experimentIdB still support two-experiment comparisons but are deprecated in favor of experimentIds.

    1.54.0release notes

  • Grouped results from queryTraces() are deprecated but continue to work until the next major release; use queryTraceThreads() for new code.

    1.48.0release notes

  • Soft-deprecated in favour of messageHistory; it remains supported and can be combined with messageHistory.

    1.47.0release notes

New APIs and options 127

  • Stream chunks now carry their run-log position in index, enabling clients to resume observe() after a dropped connection without repeated or missing chunks.

    1.60.0release notes

  • Adds shared contracts for opt-in aggregated trace roots; OSS readers remain unsupported.

    1.60.0release notes

  • Adds support for OSS feedback replacement requests and the feedbackReplacement capability.

    1.60.0release notes

  • Adds a method to read how the built-in MCP server is set up.

    1.60.0release notes

  • Adds typed single-record feedback reads; missing records return { feedback: null }, and IDs are passed unencoded for client-side URL encoding.

    1.60.0release notes

  • Adds typed single-record score reads; missing records return { score: null }, and IDs are passed unencoded for client-side URL encoding.

    1.60.0release notes

  • Adds a review status filter so callers can list experiment results with a specified review status.

    1.60.0release notes

  • Completed span queries can now order by durationMs to find slowest spans.

    1.60.0release notes

  • Span queries can now sort by model or provider.

    1.60.0release notes

  • Adds full-replacement feedback requests, with bounded cancellable retries for recognized missing-anchor responses and stable feedback IDs and timestamps across retries.

    1.60.0release notes

  • agent.generate() and agent.stream() now accept a plain-object requestContext in addition to RequestContext.

    1.60.0release notes

  • Adds text-search request types and capability flags for Platform integration.

    1.60.0release notes

  • Adds an observability capability flag for stores that can compute time-to-first-token or time-to-first-chunk aggregates; unsupported stores return 501 for those requests and omit the measures from field discovery.

    1.59.0release notes

  • Adds an events stream on a Knowledge client resource; the server ends streams after five minutes, so reconnect when they end.

    1.59.0release notes

  • Adds a JS client method to access a Knowledge instance and its read-only routes.

    1.59.0release notes

  • Adds a Knowledge client method to retrieve link counts for page IDs.

    1.59.0release notes

  • Adds a JS client method to list Knowledge instances through the new read-only Knowledge routes.

    1.59.0release notes

  • Adds a Knowledge client method to retrieve a page's links in a specified direction.

    1.59.0release notes

  • Adds a client method to answer a suspended background task.

    1.59.0release notes

  • Adds this field to the observability capabilities response type.

    1.59.0release notes

  • Answers required input for a task belonging to an MCP server.

    1.58.0release notes

  • Cancels a task for an MCP server.

    1.58.0release notes

  • Workspace info reports when the filesystem comes from a resolver and is created per request, so developers can detect that file routes cannot browse it.

    1.58.0release notes

  • Dashboard definition types, including DashboardDefinition, DashboardWidget, and DashboardQuery, are exported.

    1.58.0release notes

  • Finds a task for an MCP server.

    1.58.0release notes

  • Lists tasks for an MCP server, with optional filters such as status.

    1.58.0release notes

  • Observability span and trace queries and aggregations support outcome filters and groupings, and results include outcome.

    1.58.0release notes

  • Saved view and filter types, including SavedViewState and FilterNode, are exported from the package.

    1.58.0release notes

  • Observability capabilities report whether aggregateSpans supports model and provider in groupBy and countDistinct.

    1.58.0release notes

  • Observability capabilities report whether querySpans supports model and provider filters, and aggregateSpans supports them when spanAggregate is also true.

    1.58.0release notes

  • Observability span and trace queries and aggregations support stopReason filters and groupings, and results include stopReason.

    1.58.0release notes

  • Observability query results now include stopReasonContext.

    1.58.0release notes

  • Supported query results include timeToFirstTokenMs, and queryTraces and querySpans accept it in orderBy; capabilities report availability and sort support.

    1.58.0release notes

  • Adds agent.abortRun(runId) to explicitly cancel durable execution without requiring a memory thread.

    1.57.0release notes

  • Adds grouped span measures, including agent-run counts by status per day and nested agent runs.

    1.57.0release notes

  • Accepts an optional abort signal so callers can cancel an aggregation that is no longer needed.

    1.57.0release notes

  • Provider catalogs can include optional model release dates for newest-first model selection.

    1.57.0release notes

  • Span types returned by trace and span endpoints now include native external parent, resume, model, provider, outcome, stop-reason, token timing, and error-count fields.

    1.57.0release notes

  • AgentController session subscriptions can set displayState to false to skip full display-state snapshots, including the initial snapshot, reducing SSE bandwidth and serialization work; snapshots remain enabled by default.

    1.57.0release notes

  • Setting withRunStatus to true delivers retained and live thread-run-status outcomes, and includes run statuses in callback types.

    1.57.0release notes

  • Accepts agentModel to run an agent experiment against a different model.

    1.57.0release notes

  • Adds typed support for POST /agent-controller/:controllerId/sessions/:resourceId/threads/:threadId/owner.

    1.56.0release notes

  • Tool approval accepts alwaysAllowCategory: true to approve the call and grant its tool category to the call's thread.

    1.56.0release notes

  • Approval and decline methods accept clientTools and clientToolsResolver so the model can call client tools after the decision; approveToolCall and declineToolCall also accept memory to save results and the final answer to the original thread.

    1.56.0release notes

  • Dataset listing accepts specific IDs in one request; all matches are returned on one page, up to 100 IDs.

    1.56.0release notes

  • Adds an experimental method to emit MCP server events; it is available under mastra dev only.

    1.56.0release notes

  • Classifier evaluation traces identify the classifier as their entity, and EntityType gains the classifier value so traces can be filtered and grouped like other entities.

    1.56.0release notes

  • Observability metric queries accept a batch of experiment IDs, allowing token usage and cost for many experiments to be requested together.

    1.56.0release notes

  • Adds an experimental method to retrieve events from an MCP server.

    1.56.0release notes

  • Agent controller session subscriptions treat streams with no data for the timeout as dropped, allowing reconnect callbacks or onError to run. The default is 60 seconds; set to 0 to disable.

    1.56.0release notes

  • Agent details expose whether model-list editing is supported, allowing clients to disable editing for dynamically resolved model lists.

    1.56.0release notes

  • Adds an experimental method to poll occurrences of an MCP server event, with optional arguments and a cursor.

    1.56.0release notes

  • Observability capability response types now include spanQueryContextFields.

    1.56.0release notes

  • Adds an experimental async stream for MCP server event occurrences, supporting a cursor and abort signal.

    1.56.0release notes

  • Trace and span results expose milliseconds from span start to the first streamed chunk; queryTraces and querySpans can also order by this field.

    1.56.0release notes

  • Observability capabilities report support for trace-scope root entityId queries; unsupported queries return 422 instead of 500, and field discovery omits the unsupported field.

    1.56.0release notes

  • Observability capabilities report support for trace-scope root name and spanType queries; unsupported queries return 422 instead of 500, and field discovery omits those fields.

    1.56.0release notes

  • Observability capabilities report whether timeToFirstChunkMs is available for trace and span query results.

    1.56.0release notes

  • queryTraces and querySpans accept timeToFirstChunkMs in orderBy, and observability capabilities report whether sorting by it is supported.

    1.56.0release notes

  • Adds a method for queuing a typed signal behind the active thread run.

    1.55.0release notes

  • Adds client-side trace aggregation by time range, grouping, and measures; check capabilities.traceAggregate before calling it.

    1.55.0release notes

  • Adds errorPreview to trace list rows and querySpans() rows.

    1.55.0release notes

  • Adds errorTruncated to querySpans() rows.

    1.55.0release notes

  • Adds outputPreview to trace list rows.

    1.55.0release notes

  • Adds an optional observability capability indicating how long traces are kept, so clients can avoid offering dates whose traces are gone.

    1.55.0release notes

  • An exported type describes the output stored for agent experiment targets, including preserved error details.

    1.54.0release notes

  • Compare two to ten experiments at once against a baseline by passing experimentIds and optionally baselineId.

    1.54.0release notes

  • An exported type describes experiment result output by target.

    1.54.0release notes

  • The /steer and /follow-up routes accept the files field and limits already supported by /messages.

    1.54.0release notes

  • AgentController followUp accepts file attachments, including when the message is queued behind an active run.

    1.54.0release notes

  • Generated Agent Controller tool-suspension route types now include an optional run id field.

    1.54.0release notes

  • An exported type describes the output stored for scorer experiment targets.

    1.54.0release notes

  • AgentController steer accepts file attachments, including when the message is queued behind an active run.

    1.54.0release notes

  • Experiment results include targetType, which lets TypeScript narrow output to typed agent or scorer results; workflow, processor, and caller-driven outputs remain unknown.

    1.54.0release notes

  • Gets an experiment by ID without requiring its dataset.

    1.53.0release notes

  • Added as a trace-query operator in the generated trace-query types.

    1.53.0release notes

  • The Client SDK recognizes this live session event, allowing web clients to respond immediately to the agent's task-completion verdict.

    1.53.0release notes

  • The getSystemPackages response types include an optional capability applications can use to discover recording review support.

    1.52.0release notes

  • Instruction blocks can include optional per-usage display conditions on prompt block references, allowing stored agents to save and preview them.

    1.52.0release notes

  • Lists completed spans matching a span filter, one row per span, with cursor pagination; check spanQuery capability before calling it.

    1.52.0release notes

  • MCP resource read results include optional mimeType and _meta fields in the MCPServerBase type and readMcpServerResource response.

    1.52.0release notes

  • Reconcile channel installations completed outside the app; the client method returns a fresh installation or null when reconciliation is unsupported.

    1.52.0release notes

  • The workspace client adds typed skills.sh registry methods for searching, listing popular skills, previewing, installing, removing, and updating skills.

    1.52.0release notes

  • Stored agent memory can reference a registered memory instance with an id or hold an inline config; existing inline configs remain accepted.

    1.52.0release notes

  • Controller session switchModel calls accept an optional thinking level.

    1.52.0release notes

  • Added withInitialHistory to HTTP thread subscriptions, sending stored thread messages as one thread-history chunk before live parts; completed runs no longer replay on reconnect.

    1.51.0release notes

  • Added a summary option to list workflow runs without downloading full snapshots.

    1.51.0release notes

  • Adds a feedback flag to the observability capabilities response so clients can check whether the configured store supports feedback endpoints.

    1.50.0release notes

  • Returns the optional observability features supported by the server's configured storage, so clients can check capabilities before calling endpoints.

    1.50.0release notes

  • Adds array as a value kind in the generated trace-query types.

    1.49.0release notes

  • Adds an API to cancel selected pending input without stopping the active run; requested signal IDs are propagated through shared PubSub, while the response reports only local cancellations.

    1.49.0release notes

  • Adds an option to clear pending input when calling abortThread() or subscription abort().

    1.49.0release notes

  • Adds the includes trace-query operator to the generated trace-query types.

    1.49.0release notes

  • Adds the notIncludes trace-query operator to the generated trace-query types.

    1.49.0release notes

  • Exposes the optional tool title on tool endpoints and in GetToolResponse, and copies it from tool-call chunks onto the tool-invocation message part in the useChat accumulator.

    1.49.0release notes

  • The client supports classifier workflow steps and their rendered workflow graph entries.

    1.48.0release notes

  • Use queryTraceThreads() instead of grouped queryTraces() results for new code.

    1.48.0release notes

  • Generated tracingOptions request types include rootSpanName, allowing per-run root span names to be sent from the client.

    1.48.0release notes

  • MCP server info responses include transports so consumers can tell which endpoints a server serves; MCP v2 reports streamable-http, while MCP 1.x also reports sse.

    1.48.0release notes

  • Adds a per-call abortSignal option to streaming, resuming, tool approval or decline, and generation methods; it merges with the client-wide signal, and aborted requests are not retried.

    1.47.0release notes

  • Adds expectedRunId support when aborting agent thread runs.

    1.47.0release notes

  • Memory configuration can send minMessages, emitEvent, and an optional model for title generation; the default model is the agent's model.

    1.47.0release notes

  • Adds a client method to discover fields available for bounded trace queries.

    1.47.0release notes

  • Adds a client method to discover values available for bounded trace queries.

    1.47.0release notes

  • Adds orderBy support to listDatasets, listDatasetItems, listExperiments, listDatasetExperiments, and listDatasetExperimentResults.

    1.47.0release notes

  • Accepts pagination parameters so clients can fetch previous chunks of conversation history.

    1.47.0release notes

  • Adds methods to create, get, list, and delete task push-notification configurations; list results include pagination metadata.

    1.47.0release notes

  • Is typed as the REST route response and accepts resumeData and suspendPayload so suspended tools can be continued.

    1.47.0release notes

  • Adds token-budgeted conversation history that trims oldest remembered messages in chunks while preserving the current turn and system messages; a persisted per-thread boundary keeps trimmed history out of later turns.

    1.47.0release notes

  • Adds an optional experiment item score result field so clients can distinguish a skipped run from a scorer error.

    1.47.0release notes

  • Adds delta polling inputs and response types, allowing queries to continue from the cursor returned with numbered pages.

    1.47.0release notes

  • Advanced trace queries accept page-based pagination, and paginated responses include total, page, perPage, and hasMore metadata.

    1.47.0release notes

  • Adds typed methods for querying thread identities across eligible traces; unlike queryTraces, results contain observability-derived thread identities.

    1.47.0release notes

  • Requests can override client-level retry settings; retry counts must be non-negative safe integers.

    1.47.0release notes

  • Requests can override client-level abort settings, and aborted requests stop without retrying.

    1.47.0release notes

  • Generate and stream params can resolve client tools at call time, with tools re-resolved before each execution and continuation round.

    1.46.0release notes

  • getAgent() accepts a stream option to override the agent stream route.

    1.46.0release notes

  • MastraClient adds a method that reports whether the Studio workflow builder is available.

    1.46.0release notes

  • listDatasetExperiments() accepts target filters to scope experiment listings to a target entity.

    1.46.0release notes

  • listDatasets() accepts target filters to scope dataset listings to a target entity.

    1.46.0release notes

  • listExperiments() accepts target filters to scope experiment listings to a target entity.

    1.46.0release notes

  • Transfer an existing thread to a different resourceId from the client.

    1.46.0release notes

  • Adds a client method to remove observability feedback records by id.

    1.45.0release notes

  • Adds a client method to remove observability score records by id.

    1.45.0release notes

  • Adds a tags option to restrict results to those carrying every listed tag.

    1.45.0release notes

  • Agent Controller message listing gains storage-backed pagination, ordering, filtering, and message includes; Session and numeric client APIs still return message arrays for compatibility.

    1.45.0release notes

  • Supports feedback predicates in trace queries, allowing developers to filter traces by feedback fields.

    1.45.0release notes

Performance 1

Behavior and default changes 7

  • UI messages from newer ai v7 releases, including messages with steering-message parts, can now be passed to agent.generate() and agent.stream(); Mastra does not process those new part types yet.

    1.60.0release notes

  • Agents that opt into Editor ownership can persist model-list edits through the existing reorder and update APIs.

    1.59.0release notes

  • Trace query requests no longer retry a server query execution timeout (504 with code TRACE_QUERY_EXECUTION_TIMEOUT); other 5xx errors, including proxy or gateway 504s, are still retried.

    1.56.0release notes

  • The experimental annotation was removed from Agent signal APIs now that signals are stable.

    1.52.0release notes

  • The processors API now reports an llmRequest phase for processors that only implement processLLMRequest, making them visible in Studio; direct execution of this phase returns a 400 error.

    1.51.1release notes

  • Requests that fail with 501 Not Implemented are no longer retried, avoiding repeated failed requests and server error logs when storage does not support an API.

    1.50.0release notes

  • Accepts PascalCase method names when the A2A-Version header is 1.0, while preserving legacy slash-style methods.

    1.47.0release notes

Fixes and other changes 25

  • When a model calls several client tools in one step, all tools now run and their results are returned together; aborted requests start no further client tools.

    1.60.0release notes

  • With experimental_output, result.text is available again.

    1.60.0release notes

  • With output, result.object now has the type of the supplied schema.

    1.60.0release notes

  • Zod v3 structuredOutput schemas now type-check in client agent.generate() and agent.stream() without the complex-union error.

    1.60.0release notes

  • Request headers differing from client headers only by case now replace them; explicit Content-Type also replaces the JSON default.

    1.59.0release notes

  • Per-call cancellation now stops durable runs when streaming, resuming, or approving or declining tool calls; cancelling response.body or the client-wide signal only stops updates.

    1.57.0release notes

  • Streamed client tool results now include their original arguments.

    1.57.0release notes

  • The generate approval and decline methods now execute client tools called after the decision and continue the conversation; memory can save that continuation to the thread.

    1.56.0release notes

  • Durable and evented agents without memory retain the conversation after client-tool approval or decline, and the tool no longer reruns after suspension.

    1.56.0release notes

  • The schedules HTTP API now preserves ifIdle.requireClaimedOwner when creating or updating agent schedules instead of dropping the flag.

    1.56.0release notes

  • Resuming after tool approval or decline no longer logs the tool_result ordering error, and client tools called after the resumed tool call run as expected.

    1.56.0release notes

  • Failed agent runs now store error.message and error.stack instead of an empty object.

    1.54.0release notes

  • Session streams send the current display state as their first event; merge currentMessage by message ID rather than appending it.

    1.53.0release notes

  • nestUnderParent is no longer dropped from agent and workflow requests sent over HTTP, preserving the run's parent-child trace relationship.

    1.53.0release notes

  • Forwards options, including speaker, to the voice provider; options.speaker takes precedence over the top-level speakerId when both are sent.

    1.53.0release notes

  • MCP resource reads preserve mimeType and _meta metadata, matching listResources() and the MCP resources/read request.

    1.52.0release notes

  • Schedules with no future cron occurrence report completed when fetched by id; listings include them only when filtered by completed, while updates still accept only active or paused.

    1.52.0release notes

  • Lightweight trace list rows now include resourceId so the Resource ID column renders when the trace query API is unavailable.

    1.51.1release notes

  • Lightweight trace list rows now include threadId so the Thread ID column renders when the trace query API is unavailable.

    1.51.1release notes

  • Workflow run methods now URL-encode run IDs, preventing 404 errors when IDs contain characters such as +, &, #, or /.

    1.51.0release notes

  • Agent controller tool-approval requests resume the stored suspended run when no approval is waiting in the session, allowing approval cards restored from thread history after a restart to be answered.

    1.51.0release notes

  • Cancelling a returned agent stream aborts the underlying HTTP request and stops pending client-tool executions and follow-up requests.

    1.47.0release notes

  • Sends PascalCase A2A v1 JSON-RPC method names for message and task operations to interoperate with v1-compliant servers; the v0.3 client is unchanged.

    1.47.0release notes

  • subscribe() now honors unsubscribe() at every await and dispatch boundary, preventing stale session state and response body leaks.

    1.46.0release notes

  • Accumulated arguments from streamed partial tool calls are merged before onToolCall fires, so handlers receive complete arguments.

    1.46.0release notes