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
2026-08-18 09:25:02 +00:00
committed by copyberry
parent 0acf302db5
commit 63b268c81b
+3 -3
View File
@@ -347,9 +347,9 @@ async fn start_if_idle(
turn_context.session_telemetry.user_prompt(content);
}
task_input.push(pending_turn_input(input));
} else if is_automatic_idle_work {
// Recovery resumes an existing turn, so it must not queue a new empty
// user message for that turn.
} else if is_automatic_idle_work && !matches!(&input, SubmittedTurnInput::UserInput { .. }) {
// Automatic response-item work still needs to be queued, but an empty
// user-input request should start sampling without adding a message.
session
.input_queue
.extend_pending_input_for_turn_state(