Skip to content

fix: treat a silent agent turn as silence, not a run_input error - #6779

Merged
theomonnom merged 1 commit into
mainfrom
fix/run-input-silent-turn
Aug 11, 2026
Merged

fix: treat a silent agent turn as silence, not a run_input error#6779
theomonnom merged 1 commit into
mainfrom
fix/run-input-silent-turn

Conversation

@theomonnom

Copy link
Copy Markdown
Member

Problem

SessionHost turns a run that produced no chat items into an error:

if not items_list and not error:
    error = "agent produced no response items"

The caller sees it as a raised RuntimeError, so the turn — and, in simulations, the whole job — is scored as an agent failure.

An empty turn is a legitimate outcome. An LLM can return a completion with no text and no tool calls, and every item-add site in agent_activity is guarded on non-empty text (if forwarded_text:), so nothing lands in the chat context or in RunResult.events.

Agents that induce this on purpose hit it reliably. A close-the-call tool whose output tells the model it has already said goodbye and should now say nothing gets exactly that:

OUT : "You've already said goodbye - do NOT give another farewell, sign-off,
       or filler. If the caller just asked a real question, answer it in one
       short sentence; otherwise say nothing."
USER: "Okay, thank you."        <- agent emits nothing, turn fails

Agent-side traces for that turn confirm the model, not the framework, produced the silence:

[agent_turn]  dur=0.28s  lk.interrupted=False
  [llm_node]    lk.response.text=''
    [llm_request] gen_ai.usage.output_tokens=1

One output token, empty response text, no tool call, not interrupted — and the transcript up to that point is complete and correct.

Fix

Report the empty item list and let the caller decide what the silence means. Simulation drivers already model a silent turn explicitly, so they can end the call cleanly instead of failing it.

Test

test_run_silent_turn_is_not_an_error drives a real AgentSession whose LLM returns an empty completion through SessionHostRemoteSession. Without the fix it fails with the exact production error:

RuntimeError: session request run_input failed: agent produced no response items

`SessionHost` turned a run that produced no chat items into
`agent produced no response items`, which surfaces to the caller as a
raised `RuntimeError` and fails the turn.

An empty turn is a legitimate outcome. An LLM can return a completion
with no text and no tool calls, and every item-add site in
`agent_activity` is guarded on non-empty text, so nothing lands in the
chat context or in `RunResult.events`. Agents that induce this on
purpose hit it reliably: a close-the-call tool whose output tells the
model it has already said goodbye and should now say nothing.

Seen in text-mode simulations, where the caller keeps sending closing
pleasantries after the goodbye. The job is reported as an agent error
even though the transcript is complete and correct — agent-side traces
show the turn returning a single output token, empty response text, no
tool call, not interrupted.

Report the empty item list instead and let the caller decide what the
silence means. Simulation drivers already model a silent turn.
@theomonnom
theomonnom requested a review from a team as a code owner August 11, 2026 03:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@theomonnom
theomonnom merged commit 7477ec2 into main Aug 11, 2026
25 checks passed
@theomonnom
theomonnom deleted the fix/run-input-silent-turn branch August 11, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants