Support standalone tool outputs in turn/start (#41002)

## What changed

- Add an optional `toolOutput` to `turn/start` for starting or steering a turn with a named function-call output instead of user input.
- Emit standalone outputs as `functionCallOutput` thread items, persist them in durable history, and include them in resumed threads.
- Validate that tool outputs have a name, are not combined with nonempty `input`, satisfy the text-size limit, and use supported image URLs.

## Testing

- Cover standalone tool-output notifications, model input, and resumed history in both legacy and paginated history modes.
- Cover the text-size limit for structured tool output.

GitOrigin-RevId: a1eeec7b9b7de67b1a1c5e829a54552b85ec118b
This commit is contained in:
rka-oai
2026-08-26 23:58:10 +00:00
committed by copyberry
parent 2926014075
commit e56e4922eb
52 changed files with 3327 additions and 42 deletions
@@ -261,6 +261,7 @@ fn rollout_item_type(item: &RolloutItem) -> String {
fn turn_item_type(item: &TurnItem) -> &'static str {
match item {
TurnItem::UserMessage(_) => "user_message",
TurnItem::FunctionCallOutput(_) => "function_call_output",
TurnItem::HookPrompt(_) => "hook_prompt",
TurnItem::AgentMessage(_) => "agent_message",
TurnItem::Plan(_) => "plan",
+3 -1
View File
@@ -96,7 +96,9 @@ pub fn should_persist_event_msg(ev: &EventMsg, history_mode: ThreadHistoryMode)
matches!(history_mode, ThreadHistoryMode::Paginated)
|| matches!(
event.item,
TurnItem::Plan(_) | TurnItem::Extension(ExtensionItem::Sleep(_))
TurnItem::FunctionCallOutput(_)
| TurnItem::Plan(_)
| TurnItem::Extension(ExtensionItem::Sleep(_))
)
|| matches!(
&event.item,