Support standalone function outputs in turn routing (#40991)

## What changed

- Allow `start_or_steer_turn` to accept named `function_call_output` items without a `call_id`, starting a turn when idle or steering the active turn.
- Preserve standalone outputs as pending input, assign response item IDs, and record them in conversation history without treating them as user prompts.

## Testing

- Cover starting a turn with a standalone output and steering an active turn with one.
- Verify passive response items do not signal pending steering activity.

GitOrigin-RevId: e32b292106b3c5a5f03577b8ebf67d2d7dee4e5d
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-26 22:48:37 +00:00
1 parent 6e008417bb
commit b9c4b9a0cf
9 files changed
+178 -61

No files matched your search

+6 -2
View File
@@ -660,7 +660,9 @@ fn turn_user_input(input: &[TurnInput]) -> Vec<UserInput> {
.iter()
.filter_map(|item| match item {
TurnInput::UserInput { content, .. } => Some(content.as_slice()),
TurnInput::ResponseItem(_) | TurnInput::InterAgentCommunication(_) => None,
TurnInput::ResponseItem(_)
| TurnInput::FunctionCallOutput(_)
| TurnInput::InterAgentCommunication(_) => None,
})
.flatten()
.cloned()
@@ -990,7 +992,9 @@ async fn track_turn_resolved_config_analytics(
.iter()
.filter_map(|item| match item {
TurnInput::UserInput { content, .. } => Some(content.as_slice()),
TurnInput::ResponseItem(_) | TurnInput::InterAgentCommunication(_) => None,
TurnInput::ResponseItem(_)
| TurnInput::FunctionCallOutput(_)
| TurnInput::InterAgentCommunication(_) => None,
})
.flatten()
.filter(|item| {