Skip to content

Fix spawn! options-wrapping bug on tool-call rounds 2+#258

Merged
DeanSingh merged 1 commit intomainfrom
fix/spawn-options-propagation
Mar 16, 2026
Merged

Fix spawn! options-wrapping bug on tool-call rounds 2+#258
DeanSingh merged 1 commit intomainfrom
fix/spawn-options-propagation

Conversation

@DeanSingh
Copy link
Collaborator

Summary

  • spawn! passed options: @options which wrapped provider options one level deep on each recursive tool-call round. Round 2+ received { options: { thinking: true } } instead of { thinking: true }, silently dropping thinking config and any other provider-specific options.
  • Fixed to **@options so the hash is splatted back into keyword arguments correctly.
  • Added test covering options propagation through multi-round tool-call sessions.

Impact

All providers (Google, Anthropic, OpenAI) inherit spawn! from the base Chat class. Any provider-specific option passed via **options (e.g. thinking:, effort:) was lost on rounds 2+. This is the root cause of thinking deltas only appearing on round 1 in multi-round tool-calling sessions.

Test plan

  • bundle exec rspec passes (437 examples, 0 failures)
  • bundle exec rubocop passes (0 offenses)
  • New test verifies spawn! preserves options flat across rounds
  • New test verifies multi-round tool-call session completes with options
  • Verified live against Vertex AI with gemini-3.1-pro-preview: thinking deltas received on rounds 2+

@DeanSingh DeanSingh merged commit 5b1e4fa into main Mar 16, 2026
8 checks passed
@DeanSingh DeanSingh deleted the fix/spawn-options-propagation branch March 16, 2026 18:29
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