Skip to main content

Module output_tool

Module output_tool 

Source
Expand description

Handling for the submit_output tool: an agent handing back its answer.

Applied inline by the tool-dispatch pipeline system rather than on the async tool lane, for the same reason the context_* tools are: it writes to the live ContextWindow and to an ECS component, neither of which the lane can reach. handle_output_tool is the pure core that system calls.

§What this does not do

It does not interpret the format. A submission asking for a2ui, XML, CSV, or anything else is recorded byte for byte; the label travels alongside it for consumers to dispatch on, and nothing here reads it.

The one exception is opt-in: when the resolved OutputSpec carries a JSON Schema, the submission is parsed and validated, and a failure is refused back to the model as an [error] … result so the next turn can correct it. That refusal path is deliberately the same shape as the dispatch layer’s Layer 2 argument refusal, down to the [error] prefix, which is already in the no-effect list and so keeps a rejected submission from counting as work.

Constants§

FINAL_OUTPUT_REGION
The context region a submitted output is mirrored into.
FINAL_OUTPUT_REGION_TOKENS
Token budget for FINAL_OUTPUT_REGION.

Functions§

handle_output_tool
Apply a submit_output call.
is_output_tool
Whether a tool name is the final-output tool this module handles.