Gemini Function Response Scheduling Needs a Route Policy
Gemini function responses can use SILENT, WHEN_IDLE, or INTERRUPT scheduling for NON_BLOCKING calls. Google ignores the field for other function behavior and defaults omitted values to WHEN_IDLE. A route policy should validate the call mode, permit scheduling values by tool class, bind responses to the original call, and record interruption decisions before forwarding them.

Gemini function responses carry an optional scheduling field that changes how a result enters an active conversation. Google applies it only to NON_BLOCKING function calls. An omitted value defaults to WHEN_IDLE. SILENT suppresses generation, while INTERRUPT can stop ongoing generation before prompting the model again. That field deserves an explicit route policy because a tool result can change the timing of what an authenticated user or agent receives.
I want the gateway to treat scheduling as a typed control tied to the original function call, tool class, conversation, and policy version. A valid enum by itself says little about whether an interruption belongs on that route.
TL;DR
- Apply
schedulingonly to responses for Gemini functions declaredNON_BLOCKING; Google ignores it for other call behavior. - Send an explicit value because omission defaults to
WHEN_IDLE. - Permit
SILENT,WHEN_IDLE, orINTERRUPTaccording to tool purpose and result urgency. Require caller authorization. - Correlate every result with its original function call and record the raw value, enforced value, route policy, and delivery outcome.
Scheduling applies to NON_BLOCKING calls
Google's GenerateContent API reference defines scheduling on a function response and limits it to NON_BLOCKING function calls, with other call behavior ignoring the field. The same reference defines NON_BLOCKING behavior as allowing the system to continue the conversation while handling function responses as they become available.
That relationship should be validated before the response leaves the application boundary. Resolve the original function declaration and confirm its behavior. Then inspect the returned result. A response claiming INTERRUPT for a blocking function call contains a field with no documented effect. Record that mismatch and reject it under a strict route instead of presenting the event as a successful interruption.
The Gemini function calling guide explains the broader exchange. The model emits a function name and structured arguments, application code executes the external action, and the result returns to Gemini under the selected scheduling behavior. The application still owns tool execution and the truth of the result.
Three values produce different conversation behavior
The API reference gives the three operative values distinct effects. SILENT adds the result to conversation context without interrupting or triggering generation. WHEN_IDLE adds it and prompts generation once ongoing generation is idle. INTERRUPT adds the result, interrupts ongoing generation, and prompts output.
These choices belong to different tool classes. A background inventory refresh may use SILENT because its result only needs to inform later context. A normal data lookup can wait under WHEN_IDLE. For a fraud hold or revoked authorization, INTERRUPT may be justified because continuing to generate against stale state creates the wrong user experience.
My blunt opinion is that INTERRUPT should be an allowlisted exception, never a caller-selected convenience. Interrupting an active response changes conversation control and can amplify a noisy tool that emits repeated updates.
A per-route AI policy can bind each tool name and result class to the permitted scheduling set. The policy should reject unknown enum strings and the unused unspecified value rather than coercing either one to WHEN_IDLE.
Omission is an active default decision
Google documents WHEN_IDLE as the default. An omitted field therefore has behavior. Production logs should preserve both requested_scheduling: absent and enforced_scheduling: WHEN_IDLE when the gateway fills the default, instead of recording only the final value and erasing how it appeared on the wire.
Explicit values make route reviews clearer. A route that permits only silent background updates should require SILENT. Another route may authorize WHEN_IDLE and reject omission so SDK changes cannot alter the visible contract. Defaults are useful for experiments, but they are weak evidence in a production control because the reviewer cannot tell if the caller made a deliberate choice.
The same rule applies to request normalization. Inspect the final serialized HTTP body after generic mergers and SDK adapters have run. Inspect it again after retry middleware has run. LLM API parameter allowlisting should cover nested function response fields, not merely the top-level Gemini request.
On an operations screen, put the original function behavior and enforced scheduling on adjacent lines. A red INTERRUPT badge beside NON_BLOCKING is readable at a glance. Burying both values in a collapsed JSON drawer turns a control decision into archaeology.
Correlation prevents cross-call scheduling errors
A scheduling decision belongs to one function response and one original function call. The application should preserve the provider call identifier, function name, conversation identifier, tool execution attempt, authenticated principal, route, and result digest. It should also verify that the returned function name and call correlation match an outstanding NON_BLOCKING request.
Late results create the hard case. A user may have moved to another conversation turn or cancelled the operation. The user may also have lost authorization before the tool finishes. Route policy needs an expiry and state check before forwarding the result. A valid INTERRUPT value attached to an expired call should enter quarantine. The enum cannot revive stale authority.
Repeated responses need an explicit contract as well. Google's adjacent willContinue field can signal that more results will follow for a non-blocking call. Give each response an ordinal and retain the terminal state. A tool that emits ten interrupting updates should encounter a route cap rather than seize the conversation ten times.
The AI audit log schema supplies common identity, policy, request, and outcome fields. Add function behavior, raw scheduling, enforced scheduling, response ordinal, correlation result, and interruption disposition for this Gemini-specific decision.
Release fixtures should exercise timing and mismatch
Build a controllable Gemini adapter behind the authenticated HTTP route. Start one NON_BLOCKING function call, keep generation active, and return a SILENT result that enters context without triggering output. Repeat with WHEN_IDLE and confirm that generation waits for the active turn to become idle. Then send an authorized INTERRUPT result and verify the recorded interruption.
Add omission as a separate case. The gateway should show the absent raw field and the enforced WHEN_IDLE default. Send an unknown value, the unused unspecified value, a scalar of the wrong type, and a scheduling field attached to a blocking call. Each case should produce a named finding without silently rewriting malformed input into success.
Finally, expire the original call before its result arrives. Change the authenticated principal's authorization, send a duplicate ordinal, and exceed the route's interruption cap. Those fixtures prove that enum validation and conversation authority remain separate checks.
DeepInspect
DeepInspect can inspect Gemini function responses on authenticated user or agent HTTP traffic deliberately routed through its proxy. It can verify the declared function behavior, enforce a per-tool scheduling allowlist, reject stale or malformed responses, cap interruption patterns, and bind the decision to identity and route policy before forwarding the request to Gemini.
The application owns tool execution, result correctness, outstanding-call state, cancellation, conversation assembly, and downstream effects. Direct Gemini calls, local tool execution, STDIO traffic, and results that bypass the proxy remain outside DeepInspect's enforcement and evidence.
Book a technical deep dive at deepinspect.ai.
Frequently asked questions
- What is the default Gemini function response scheduling value?
Google documents
WHEN_IDLEas the default whenschedulingis omitted. The result enters conversation context and prompts output without interrupting ongoing generation. A gateway should record the omission separately from the value it enforces.- Does scheduling work for every Gemini function call?
No. The GenerateContent reference says the field applies only to
NON_BLOCKINGfunction calls and is ignored otherwise. Validate the original function behavior before accepting a scheduling instruction on its response.- When should a route permit SILENT?
SILENTfits background results that should enter conversation context without triggering or interrupting generation. The route owner should name the approved tool and result classes rather than giving every caller access to silent context mutation.- Should INTERRUPT be available to every tool?
A narrow allowlist is safer. Reserve
INTERRUPTfor result classes whose urgency justifies stopping active generation, then cap repeated interruptions and verify that the original call remains authorized and current.- What should happen to an unknown scheduling value?
Preserve the raw value. Reject or quarantine the response under the route's fail-closed policy, then log the parser and policy versions. A later policy release can add support after engineers review Google's current contract.