Skip to content

Add invalid tool call recovery hooks#33

Merged
gold-silver-copper merged 13 commits into
mainfrom
codex/invalid-tool-call-hooks-v2
May 29, 2026
Merged

Add invalid tool call recovery hooks#33
gold-silver-copper merged 13 commits into
mainfrom
codex/invalid-tool-call-hooks-v2

Conversation

@gold-silver-copper

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in invalid tool-call hook system at the validation boundary introduced by the model tool-call validation work.

  • Add InvalidToolCallHook, InvalidToolCallContext, and InvalidToolCallHookAction
  • Add per-request .with_invalid_tool_call_hook(...) and .max_invalid_tool_call_retries(...)
  • Support fail-fast, retry with feedback, repair, and skip recovery actions
  • Wire recovery through non-streaming and streaming prompt paths while preserving fail-fast defaults
  • Add focused tests for non-streaming repair/retry/skip and streaming repair

Verification

  • cargo test -p rig-core invalid_tool_call_hook -- --nocapture
  • cargo test -p rig-core agent::prompt_request::streaming::tests:: -- --nocapture
  • cargo check -p rig-core
  • cargo clippy -p rig-core --all-targets

@gold-silver-copper gold-silver-copper merged commit 66d58df into main May 29, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request May 28, 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.

1 participant