Skip to content

Fail an empty provider completion instead of a blank final answer#40

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:harness/empty-response-guard
Jul 8, 2026
Merged

Fail an empty provider completion instead of a blank final answer#40
senamakel merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:harness/empty-response-guard

Conversation

@M3gA-Mind

Copy link
Copy Markdown
Contributor

Add an opt-in RunPolicy.error_on_empty_response guard. When enabled, an assistant completion with no text, no tool calls, and no structured output in the agent-loop finalization branch drops the empty row and returns a typed TinyAgentsError::EmptyResponse instead of terminating the run with a blank final answer. Defaults to false, preserving behavior for callers that rely on empty finals.

Validated: cargo fmt; cargo test --lib (997 passed, incl. 2 new tests covering guard-on/guard-off).

Note: cargo clippy --lib --tests -- -D warnings reports one pre-existing collapsible_if lint at src/harness/model/mod.rs:756 (untouched by this PR; reproduces on main with these changes stashed, tripped by clippy 1.96.1). With that single pre-existing lint allowed, clippy is clean — this change introduces no new warnings.

Closes tinyhumansai/openhuman#4638

Add an opt-in RunPolicy.error_on_empty_response guard: when set, an
assistant completion with no text, no tool calls, and no structured
output in the finalization branch drops the empty row and returns a
typed TinyAgentsError::EmptyResponse rather than terminating the run
with a blank success. Defaults off to preserve existing callers.

Closes tinyhumansai/openhuman#4638
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72ecb342-7fc2-4233-869c-49a4b8b09c9c

📥 Commits

Reviewing files that changed from the base of the PR and between b1f0d82 and 3fa3213.

📒 Files selected for processing (6)
  • src/error.rs
  • src/harness/agent_loop/run_loop.rs
  • src/harness/agent_loop/test.rs
  • src/harness/model/mod.rs
  • src/harness/runtime/types.rs
  • src/harness/stream/mod.rs

Comment @coderabbitai help to get the list of available commands.

collapsible_if in StreamAccumulator::push_tool_chunk and a duplicated
#[cfg(test)] on the stream test module both fail CI's
cargo clippy --all-targets -- -D warnings under rust 1.96. Behavior-neutral.
@M3gA-Mind

Copy link
Copy Markdown
Contributor Author

CI guardian: the Rust SDK check was red on a pre-existing main clippy failure under stable rust 1.96 (a collapsible_if in StreamAccumulator::push_tool_chunk and a duplicated #[cfg(test)] on the stream test module), inherited by this branch. Pushed a behavior-neutral lint fix so CI can go green; no change to this PR's own logic.

@senamakel senamakel merged commit e87d98d into tinyhumansai:main Jul 8, 2026
2 checks passed
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.

[TinyAgents][T1] Empty provider response terminates the run with a blank answer

2 participants