Skip to content

fix: consolidate small correctness fixes - #2495

Merged
jxnl merged 2 commits into
mainfrom
codex/consolidate-july-small-fixes
Jul 29, 2026
Merged

fix: consolidate small correctness fixes#2495
jxnl merged 2 commits into
mainfrom
codex/consolidate-july-small-fixes

Conversation

@jxnl

@jxnl jxnl commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consolidates a reviewed set of small correctness and documentation fixes onto current main:

  • preserve retry/cache inputs and normalize edge-case message content
  • make missing tool calls retryable for OpenAI-compatible and Mistral handlers
  • return all Anthropic parallel tool errors and disable parallel calls for forced single-tool requests
  • harden streaming JSON, partial models, citations, and lazy handler registration
  • avoid mutating cached schemas and caller-owned Gemini configuration
  • fix Bedrock default model forwarding, OpenAI audio formats, empty batch objects, and CLI file access
  • redact additional credential aliases and declare the runtime regex dependency explicitly
  • refresh Cerebras and Google/Vertex documentation

Consolidated 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 skipped
  • targeted regression reruns: 34 passed
  • uv run ruff format --check instructor tests: passed
  • uv run ruff check instructor tests: passed
  • scoped uv run ty check for every changed production and test module: passed
  • uv lock --check: passed
  • commit hooks: Ruff lint/format, lock check, dependency installation, requirements export, and ty all passed
  • broader pytest 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 models
  • repository-wide ty check --config-file ty-tests.toml remains baseline-red with 265 unrelated diagnostics in notebooks, optional examples, and scripts

Skipped 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_history so reask mutations do not break cache keys or caller-owned lists. Message dumping keeps legacy function_call when content is empty; merging treats None content as empty.

Tool-call parsing and reasks: OpenAI-compatible and Mistral handlers raise retryable ResponseParsingError when there are no tool calls, and reask flows fall back to user corrections instead of iterating None. Anthropic forced single-tool requests set disable_parallel_tool_use, and parallel-tool reasks emit a tool_result for every tool_use id.

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 null is preserved. Citation fuzzy matching escapes regex metacharacters; lazy mode-handler registration is locked against concurrent first access. OpenAI tool schemas are copied before adding strict so the LRU cache is not poisoned; Gemini generation_config is 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 default model. OpenAI audio maps WAV/MP3 only. Debug logging redacts more credential key aliases. regex is a direct dependency.

Docs: Cerebras examples use gpt-oss-120b; Google docs clarify provider prefixes; Vertex from_genai() example passes model outside the client constructor. CHANGELOG [Unreleased] entries document the above.

Reviewed by Cursor Bugbot for commit 3ccb56a. Configure here.

@jxnl jxnl added the codex label Jul 29, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 29, 2026

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 b3be98d Commit Preview URL

Branch Preview URL
Jul 29 2026, 04:30 AM

@jxnl
jxnl merged commit d9aa592 into main Jul 29, 2026
33 of 34 checks passed
@jxnl
jxnl deleted the codex/consolidate-july-small-fixes branch July 29, 2026 04:34
This was referenced Jul 29, 2026
This was referenced Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant