Skip empty user messages for automatic idle turns (#39174)

## What changed

Start sampling for automatic idle `UserInput` requests without adding an empty
message to the input queue. Continue queuing automatic response-item input.

GitOrigin-RevId: 5d304aed9e7e165380b29b5b59d9245e97b40659
This commit is contained in:
jif authored and copyberry committed 2026-08-18 09:25:02 +00:00
1 parent 0acf302db5
commit 63b268c81b
1 file changed
+3 -3
+3 -3
View File
@@ -347,9 +347,9 @@ async fn start_if_idle(
turn_context.session_telemetry.user_prompt(content); turn_context.session_telemetry.user_prompt(content);
} }
task_input.push(pending_turn_input(input)); task_input.push(pending_turn_input(input));
} else if is_automatic_idle_work { } else if is_automatic_idle_work && !matches!(&input, SubmittedTurnInput::UserInput { .. }) {
// Recovery resumes an existing turn, so it must not queue a new empty // Automatic response-item work still needs to be queued, but an empty
// user message for that turn. // user-input request should start sampling without adding a message.
session session
.input_queue .input_queue
.extend_pending_input_for_turn_state( .extend_pending_input_for_turn_state(