Highlights
Agents that recover from failures, plus background sub-agents
Agent runs can now pick up where they stopped after a failure or an abort, and orchestrators can hand work to sub-agents that run in the background.
-
throwOnError: falseongenerate()returns the failure and the conversation up to the last completed tool round, so you can retry from there. Code that doesn't set it still gets the same errors as before. (#6359)const opts = { model: googleAI.model('gemini-flash-latest'), tools: [getWeather], throwOnError: false }; let res = await ai.generate({ ...opts, prompt: 'What should I wear in Tokyo today?' }); if (res.finishReason === 'failed' || res.finishReason === 'aborted') { res = await ai.generate({ ...opts, messages: res.messages }); }
-
Failed and aborted agent turns are now resume points. A failed turn is saved as a
failedsnapshot and a stopped run is saved as anabortedsnapshot. Both can be resumed. (#6361, #6362, #6360) -
waitForSnapshotis the blocking version ofgetSnapshot. It waits on the server until a detached turn finishes, so you don't need a polling loop. (#6272)const task = await reportAgent.chat().detach('Write the report'); const snap = await task.wait();
-
Background delegation in the
agentsmiddleware. Withasync: true, delegation tools acceptbackground: trueand return a task ID right away. Newcheck_background_tasks,wait_for_background_tasksandabort_background_taskstools let the orchestrator manage those tasks. (#6273)use: [agents({ agents: ['researcher'], async: true })]
-
continue_taskcontinues a failed, aborted or finished sub-agent task from its handle, with optional new instructions. Snapshot reads also acceptmetadataOnlyto skip loading the state. (#6693) -
Transport-specific options in
AgentAPI. In-process agents accept a per-chat or per-callcontext, so auth carries through detached tasks and background jobs. The building blocks for customAgentTransportimplementations are now exported. (#6448)const chat = weatherAgent.chat({}, { context: { auth: { uid: 'alice' } } });
New contextCompression middleware
@genkit-ai/middleware now includes contextCompression, which keeps long agent conversations within a token budget. It truncates tool responses, removes duplicate tool responses, caps message counts, and can summarize old turns with an LLM. It tracks compaction history so later rounds build on earlier ones. (#6266, #6267, #6269, #6270)
use: [
contextCompression({
maxInputTokens: 80000,
deduplicateToolResponses: { matchBy: 'name-and-input' },
toolResponses: { maxChars: 2000, preserveRecent: 2 },
summarize: { model: googleAI.model('gemini-flash-lite-latest'), preserveRecent: 6 },
}),
]Gemini: Interactions API, Gemini 4 Argon, Omni and more
- The
googleAIplugin now sends requests for-latestaliases, newer Gemini models and any model it doesn't know to the Interactions API. Older built-in models stay ongenerateContent. (#6344) - The
vertexAIplugin routes the same way, with one difference: image models and the-latestaliases stay ongenerateContent. (#6851) - New models:
gemini-4-argon,gemini-3.8-flash,gemini-3.8-flash-tts,gemini-3.8-flash-lite-tts,gemini-nano-banana-2.1,gemini-omni-1.1-flash(replaces Veo 3.1),lyria-3.5andantigravity-preview-09-2026. Gemini 2.5 and the retiring preview models are now hidden: they still work but no longer show up in autocomplete. (#6807) vertexAIgets the same model updates, plus text-to-speech, Omni video generation and thegemini-embedding-2embedder. (#6859)
Breaking for models on the Interactions API:
response.raw/customnow has a different shape.safetySettings,toolConfig,thinkingBudgetandcandidates > 1are dropped or rejected, and system messages must be text-only. See the #6344 description for the full list.
Pluggable instrumentation and the new @genkit-ai/otel plugin
Telemetry is now built on pluggable Instrumentation providers instead of being tied to OpenTelemetry. By default nothing changes. The Developer UI no longer needs the OTel SDK, and logs now show up next to traces. (#6336)
The new @genkit-ai/otel package (0.2.0) emits spans that follow the OpenTelemetry GenAI semantic conventions. (#6340)
import { configureInstrumentation } from 'genkit/tracing';
import { GenAiInstrumentation } from '@genkit-ai/otel';
new NodeSDK().start();
configureInstrumentation(new GenAiInstrumentation({ contentCapturingMode: 'SPAN_ONLY', emitToolSpans: true }));Reflection API outside dev mode, with optional auth
The reflection API can now run without the rest of dev mode, and you can protect it with a shared secret. (#6454, #6666)
GENKIT_REFLECTION_ENABLED=true \
GENKIT_REFLECTION_HOST=0.0.0.0 \
GENKIT_REFLECTION_PORT=3100 \
GENKIT_REFLECTION_SECRET_TOKEN=$(openssl rand -base64 32) \
node lib/index.jsgenkit({ reflectionPort: 3200 })binds exactly that port and fails if it's taken.reflectionPort: 0lets the OS pick a port. Leaving it unset still searches upward from 3100.GENKIT_REFLECTION_ENABLED=falseturns the API off even underGENKIT_ENV=dev. Any value other thantrueorfalsethrows fromgenkit().
Features
OpenAI-compatible (compat-oai)
- Added
gpt-6-astraand thegpt-5.6models to the OpenAI catalog. (#6303, #6357) - New
strictconfig option for structured outputs. It maps toresponse_format.json_schema.strict. (#5886)
Bug Fixes
Core / AI
- Nested dotprompt partials are now named by their path (for example
support/_system), so partials with the same name in different folders no longer collide. Existing{{> system}}references still work when the short name is unique. (#5410)
Middleware (contextCompression)
-
Fixed several edge cases:
inputTokensis now set oncandidates[0].message. (#6527)- Duplicate parallel tool responses are matched correctly. (#6530)
- Character limits are enforced on multipart tool responses. (#6532)
preserveRecentno longer drops messages when summarization is skipped. (#6533)- Short histories that are over budget now fall back correctly. (#6565)
-
Ported six fixes from the Go implementation. They cover a lost anchor message on re-compaction,
maxMessages: 1sending no conversation, the token-budget fallback being skipped, and more accurate token estimates for tool responses. (#6726) -
Documented the missing
contextCompressionoptions. (#6600)
Google GenAI
- TTS models no longer report support for constrained output. (#6341)
- Fixed the Vertex multimodal embedding dimensions. (#6484)
Anthropic
- Empty signed thinking blocks are now sent back to the API instead of being dropped. (#6838)
OpenAI-compatible (compat-oai)
- Assistant text is kept when the same message also contains tool calls. (#6792)
New Contributors
- @harbinresearcher made their first contribution in #6484
- @justinakkal made their first contribution in #5410
- @hkarmoush made their first contribution in #6838
Full Changelog: https://github.com/genkit-ai/genkit/compare/genkit@1.42.0...genkit@1.43.0