Skip to content

fix: quick fixes for open issues #1959, #1957, #1953, #1940, #1956#1969

Closed
jxnl wants to merge 5 commits intomainfrom
fix/quick-fixes-from-issues
Closed

fix: quick fixes for open issues #1959, #1957, #1953, #1940, #1956#1969
jxnl wants to merge 5 commits intomainfrom
fix/quick-fixes-from-issues

Conversation

@jxnl
Copy link
Copy Markdown
Collaborator

@jxnl jxnl commented Dec 20, 2025

Summary

This PR contains 5 quick fixes for recently reported issues:

1. Add debugging example (#1959)

  • Created examples/debugging/run.py demonstrating hooks, logging, and debugging flow
  • Provides a no-network example for users to understand debugging features

2. Fix Responses API validation error handling (#1957)

  • Fixed reask_responses_tools to handle ResponseReasoningItem objects
  • Validation errors now properly sent to LLM during retries with reasoning models
  • Prevents AttributeError when reasoning models include non-tool-call outputs

3. Preserve GenAI config parameters (#1953)

  • Fixed update_genai_kwargs to preserve automatic_function_calling config
  • Config now properly flows through to GenerateContentConfig
  • Users can now disable AFC noise: config={"automatic_function_calling": {"disable": True}}

4. Improve from_provider error handling (#1940)

  • Narrowed ImportError handling for Google provider
  • Real errors (like missing httpx[socks]) now show actual error messages
  • Prevents masking of dependency issues as "google-genai not installed"

5. Fix documentation typo (#1956)

  • Fixed "an customizable" to "a customizable" in 3 files
  • Improves grammar in validation documentation

Test Plan

  • All fixes pass ruff linting and formatting
  • Type checking passes for modified files
  • Pre-commit hooks pass
  • Added tests for GenAI config preservation

Related Issues

Closes #1959
Closes #1957
Closes #1953
Closes #1940
Closes #1956

jxnl and others added 5 commits December 20, 2025 18:40
Add examples/debugging/run.py that demonstrates:
- DEBUG logging for instructor.*
- Hook handlers for observing request flow
- Fake provider for offline testing
- No-network example of debugging features

Fixes #1959

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Filter response.output to only process ResponseFunctionToolCall objects
that have arguments attribute. This prevents AttributeError when reasoning
models include ResponseReasoningItem objects without arguments.

The fix ensures validation errors are properly sent to the LLM during
retries with reasoning models (e.g., gpt-5-2025-08-07).

Fixes #1957

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add support for passing config dict/object to update_genai_kwargs that
preserves all config fields including automatic_function_calling and
thinking_config. Previously these were lost when constructing
GenerateContentConfig.

This allows users to disable automatic function calling noise:
config={"automatic_function_calling": {"disable": True}}

Fixes #1953

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Narrow ImportError handling to only catch import failures for google.genai
package, not errors during client initialization. This prevents masking
of real errors like missing httpx[socks] dependency when using SOCKS proxy.

Before: All ImportErrors showed "google-genai package required"
After: Only actual import failures show that message, other errors
       (like missing socksio) propagate with full context

Fixes #1940

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Change "an customizable" to "a customizable" in:
- docs/concepts/reask_validation.md
- docs/tutorials/4-validation.ipynb
- docs/tutorials/3-1-validation-rag.ipynb

Fixes #1956

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request python Pull requests that update python code size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 20, 2025
@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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
instructor 3655972 Commit Preview URL

Branch Preview URL
Dec 20 2025, 11:43 PM

@jxnl jxnl closed this Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request python Pull requests that update python code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

1 participant