Skip to content

fix(session): fail empty assistant responses instead of recording success - #41804

Closed
patil2001 wants to merge 1 commit into
anomalyco:devfrom
patil2001:fix/runner-fail-empty-assistant-response
Closed

fix(session): fail empty assistant responses instead of recording success#41804
patil2001 wants to merge 1 commit into
anomalyco:devfrom
patil2001:fix/runner-fail-empty-assistant-response

Conversation

@patil2001

Copy link
Copy Markdown

Summary

V2 recorded a reasoning-only assistant response with no visible text and no tool calls as a successful execution. When a provider settled a step with an empty completion (six output tokens, no publishable content), the runner emitted session.step.ended.1 with finish: "stop" followed by session.execution.succeeded.1, leaving the user with neither an answer nor a surfaced failure.

Changes

  • packages/core/src/session/runner/publish-llm-event.ts: track whether a step produced usable assistant output (non-empty text, non-empty reasoning, or a tool call).
  • packages/core/src/session/runner/llm.ts: when a step settles without usable output, publish Step.Failed with a typed "Provider returned an empty response" error instead of a successful Step.Ended.
  • Tests: publisher coverage for empty/usable output plus updated runner expectations for policy-blocked/corrected tool continuations.

Test plan

bun test --timeout 30000 in packages/core passes (1080 pass / 0 fail); tsgo --noEmit clean.

Fixes #37372

…cess

A terminal assistant step that produces no usable output (no text, no
tool calls, no non-empty reasoning) was recorded as a successful
execution. This surfaced as a silent no-op turn for the user.

Treat a settled step with no usable output as a typed empty-response
failure so clients can surface the error instead of stopping silently.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a potential duplicate:

PR #37843: fix(core): fail empty provider output

This is likely related to the same problem space (handling empty provider responses) and may have been a previous attempt or partial fix. You should verify whether #37843 already resolves issue #37372 or if the current PR #41804 is addressing a remaining gap or different aspect of the problem.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 11, 2026
@github-actions github-actions Bot closed this Aug 11, 2026
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.

v2: empty reasoning-only response is recorded as successful completion

1 participant