fix: consolidate small correctness fixes - #2495
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
instructor | b3be98d | Commit Preview URL Branch Preview URL |
Jul 29 2026, 04:30 AM |
This was referenced Jul 29, 2026
Closed
Closed
Closed
This was referenced Jul 29, 2026
Closed
Closed
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates a reviewed set of small correctness and documentation fixes onto current
main:regexdependency explicitlyConsolidated PRs and issues
Canonical patchsets incorporated and intentionally superseded by this PR:
#2494 #2491 #2489 #2488 #2487 #2486 #2484 #2478 #2476 #2475 #2473 #2467 #2463 #2456 #2455 #2453 #2452 #2451 #2448 #2447 #2443 #2441 #2440 #2439 #2430 #2415 #2406 #2343
Duplicate or narrower alternatives superseded by the consolidated implementation:
#2492 #2466 #2462 #2460 #2458 #2442 #2425
Issues fixed:
#2490 #2485 #2477 #2465 #2464 #2461 #2459 #2454 #2450 #2431 #2422 #2416
Validation
uv run pytest <all 22 changed test modules> -q: 688 passed, 2 skippeduv run ruff format --check instructor tests: passeduv run ruff check instructor tests: passeduv run ty checkfor every changed production and test module: passeduv lock --check: passedpytest tests/ -k 'not llm and not openai' -q: 3050 passed, 229 skipped; 48 unrelated failures remain in pre-existing docs snippets and live provider calls using unavailable/retired modelsty check --config-file ty-tests.tomlremains baseline-red with 265 unrelated diagnostics in notebooks, optional examples, and scriptsSkipped items
No release, tag, PyPI publication, deployment, or social post is included.
Note
Medium Risk
Touches core v2 retry, caching, streaming parsers, and multiple provider handlers; changes are targeted correctness fixes with broad test coverage but wide blast radius across integrations.
Overview
This PR bundles many small runtime and integration fixes across v2, plus doc and dependency updates.
Retries, caching, and messages: Retry paths now get isolated copies of
messages/contents/chat_historyso reask mutations do not break cache keys or caller-owned lists. Message dumping keeps legacyfunction_callwhen content is empty; merging treatsNonecontent as empty.Tool-call parsing and reasks: OpenAI-compatible and Mistral handlers raise retryable
ResponseParsingErrorwhen there are no tool calls, and reask flows fall back to user corrections instead of iteratingNone. Anthropic forced single-tool requests setdisable_parallel_tool_use, and parallel-tool reasks emit atool_resultfor everytool_useid.Streaming / DSL / registry: JSON stream extraction validates balanced spans and keeps scanning past non-JSON brace blocks. Partial streaming uses per-context recursion guards, builds partial instances for incomplete nested/list items, and final-validates from raw JSON so explicit
nullis preserved. Citation fuzzy matching escapes regex metacharacters; lazy mode-handler registration is locked against concurrent first access. OpenAI tool schemas are copied before addingstrictso the LRU cache is not poisoned; Geminigeneration_configis copied before in-place mapping.Other runtime: Batch parsing accepts
{}for models with defaults. CLI file listing uses SDK attribute access. Bedrock auto-client forwards defaultmodel. OpenAI audio maps WAV/MP3 only. Debug logging redacts more credential key aliases.regexis a direct dependency.Docs: Cerebras examples use
gpt-oss-120b; Google docs clarify provider prefixes; Vertexfrom_genai()example passesmodeloutside the client constructor. CHANGELOG [Unreleased] entries document the above.Reviewed by Cursor Bugbot for commit 3ccb56a. Configure here.