Describe the bug
When the model runner in the Dev UI is opened from a trace whose generation used structured output, it inherits that span's output config (format, constrained, and schema) and resends it on every run. The model runner has no control to view, edit, or disable the output config, so the runner is stuck in structured-output mode for the rest of the session.
The model runner seeds itself from the source span and reuses the output config directly:
// when opening from a trace span (n = the span input)
traceGenerateOptions.set({ config: n.config, output: n.output });
// when sending a run
output: this.traceGenerateOptions().output,
The editable controls in the model runner are messages, the model config JSON (temperature, thinkingConfig, tools, and so on), tool selection, and middleware. There is no control for output.format, output.schema, or output.constrained.
This has a worse failure mode when the inherited output carries format: "json" and constrained: true but no schema. The model is told to return JSON with no shape to follow, so it invents its own fields. For example, a plain "Is Pluto a planet?" prompt comes back as something like:
{
"thought": "The user is asking a general knowledge question...",
"answer": "No, Pluto is not classified as a major planet anymore..."
}
The same model returns normal prose when the request has no output format set. The runtime is behaving correctly. The problem is that the model runner forces an output config that the user cannot change.
To Reproduce
- Define a flow that uses structured output in a generation call (an
output schema with constrained generation). The Bargain Chef quickstart flow is one example, but any flow with a JSON output schema works.
- Run the flow once and open its trace in the Dev UI.
- Open the generation span and launch the model runner from it.
- Replace the messages with an unrelated freeform prompt, for example "Is Pluto a planet?", and run it.
- Observe that the response comes back as constrained JSON rather than prose, and that there is no field in the model runner to change or remove the output format.
- Inspect the model runner's request in the resulting trace. The
output field still contains format: "json" and constrained: true carried over from the source span. If the schema did not carry over, the JSON fields are arbitrary (for example thought and answer).
Expected behavior
The model runner should let the user see and change the output config, or it should not force a structured-output config that has no editable control. At a minimum the user should be able to switch the output format back to text or clear the schema so a freeform prompt returns prose.
Desktop
- OS: macOS
- genkit-cli version: 1.36.0
Additional context
The output config is copied verbatim from the source span, so in the common case the schema carries over with it. The schemaless case (format and constrained without a schema) is the most confusing because the model free-forms the JSON shape and there is no way to correct it from the model runner.
Describe the bug
When the model runner in the Dev UI is opened from a trace whose generation used structured output, it inherits that span's
outputconfig (format,constrained, andschema) and resends it on every run. The model runner has no control to view, edit, or disable the output config, so the runner is stuck in structured-output mode for the rest of the session.The model runner seeds itself from the source span and reuses the output config directly:
The editable controls in the model runner are messages, the model config JSON (temperature, thinkingConfig, tools, and so on), tool selection, and middleware. There is no control for
output.format,output.schema, oroutput.constrained.This has a worse failure mode when the inherited
outputcarriesformat: "json"andconstrained: truebut noschema. The model is told to return JSON with no shape to follow, so it invents its own fields. For example, a plain "Is Pluto a planet?" prompt comes back as something like:{ "thought": "The user is asking a general knowledge question...", "answer": "No, Pluto is not classified as a major planet anymore..." }The same model returns normal prose when the request has no output format set. The runtime is behaving correctly. The problem is that the model runner forces an output config that the user cannot change.
To Reproduce
outputschema with constrained generation). The Bargain Chef quickstart flow is one example, but any flow with a JSON output schema works.outputfield still containsformat: "json"andconstrained: truecarried over from the source span. If the schema did not carry over, the JSON fields are arbitrary (for examplethoughtandanswer).Expected behavior
The model runner should let the user see and change the output config, or it should not force a structured-output config that has no editable control. At a minimum the user should be able to switch the output format back to text or clear the schema so a freeform prompt returns prose.
Desktop
Additional context
The output config is copied verbatim from the source span, so in the common case the schema carries over with it. The schemaless case (format and constrained without a schema) is the most confusing because the model free-forms the JSON shape and there is no way to correct it from the model runner.