Skip to content

Fix empty tool-use response handling - #522

Merged
Bill-Billion merged 1 commit into
mainfrom
fix/agent-loop-empty-tool-use
Aug 15, 2026
Merged

Fix empty tool-use response handling#522
Bill-Billion merged 1 commit into
mainfrom
fix/agent-loop-empty-tool-use

Conversation

@Bill-Billion

Copy link
Copy Markdown
Collaborator

Summary

  • use concrete tool_use blocks as the execution signal across the current Agent Loops
  • prevent empty user/tool-result turns in parent, subagent, and teammate runtimes
  • sync the trilingual course text, diagrams, generated web data, and regression coverage

Context

The current course still inherited the boundary reported in #224: a compatible provider can return stop_reason="tool_use" without an actual tool call. The loop would append an empty user turn and request the model again. This PR fixes the current S01-S15 course structure rather than changing the frozen agents/s04_subagent.py.

Reported by @miketam in #224.

Verification

  • pytest -q tests/test_agent_loop_boundaries.py tests/test_agent_teams_runtime.py tests/test_compaction_tool_pairs.py tests/test_background_tasks.py -> 116 passed, 75 subtests passed
  • pytest -q -k "not test_s16_scenario_matches_the_deterministic_runtime" -> 206 passed, 1 deselected, 84 subtests passed
  • full suite -> 206 passed, 84 subtests passed, with the pre-existing S16 concurrent progress-order fixture failure also reproducible on main
  • Web extraction is idempotent
  • 48 modified SVG files pass xmllint and match their Web asset mirrors
  • git diff --check passes

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
learn-claude-code 168fff8 Aug 14 2026, 04:04 PM

@Bill-Billion
Bill-Billion marked this pull request as ready for review August 15, 2026 09:21
@Bill-Billion
Bill-Billion merged commit 66cfd2c into main Aug 15, 2026
3 of 6 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.

1 participant