Add structured asynchronous user input requests (#42178)

## What changed

- Replace `send_user_message_async` with `request_user_input_async`, accepting one or more questions with optional suggested answers while allowing the turn to continue.
- Attach structured question metadata to asynchronous agent messages while retaining readable fallback text, and preserve it through app-server events, thread history, and generated schemas.
- Continue enabling the new tool for model catalogs that advertise either the old or new tool name.

## Testing

- Cover tool registration, question validation, emitted items, continued turn execution, history preservation, and backwards-compatible deserialization.

GitOrigin-RevId: ffc49aebde2e854c3c50a122aa52805fec3fc6b3
This commit is contained in:
rka-oai authored and copyberry committed 2026-09-02 02:09:35 +00:00
1 parent b21f2e3081
commit 2c79ee6dac
80 files changed
+1110 -146

No files matched your search

+4
View File
@@ -67,6 +67,7 @@ fn agent_message_item(message: &str) -> RolloutItem {
phase: None,
memory_citation: None,
delivery: None,
questions: None,
}))
}
@@ -650,6 +651,7 @@ async fn recorder_materializes_on_flush_with_pending_items() -> std::io::Result<
phase: None,
memory_citation: None,
delivery: None,
questions: None,
},
))])
.await?;
@@ -905,6 +907,7 @@ async fn persist_reports_filesystem_error_and_retries_buffered_items() -> std::i
phase: None,
memory_citation: None,
delivery: None,
questions: None,
},
))])
.await?;
@@ -957,6 +960,7 @@ async fn writer_state_retries_write_error_before_reporting_flush_success() -> st
phase: None,
memory_citation: None,
delivery: None,
questions: None,
},
))]);