Repository navigation
feat(release): consolidate reviewed Instructor 1.18 changes - #2708
Conversation
Integrate revised fixes from #2629, #2632, #2634, #2638, #2646, #2667, #2673, #2675, #2688, #2691, #2697, #2698 and #2699. Address incomplete Responses in #2705 and preserve Python 3.9 generic-type compatibility. Keep real provider SDK and loopback regression contracts; no live API calls or release publication.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
instructor | 9e7a61a | Commit Preview URL Branch Preview URL |
Oct 08 2026, 05:06 AM |
|
Final local review found an additional Python 3.9 nested-generic class-check failure. Fixed at a3137a7 with four real preparation/schema/value regressions; the minimum-version focused suite passes. The prior 01469b6 local full suite/coverage passed; its last observed CI snapshot had 28 successful checks and OpenAI Tests still pending, not a completed all-green proof. Full offline and installed-wheel validation are rerunning for the updated head, which remains draft with required independent review. No merge or publication. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Parallel parse crashes on missing tools
- Updated ParallelBase.from_response to raise ResponseParsingError when OpenAI responses have no choices or tool_calls (and added a regression test), so the retry loop can catch it.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit a3137a7. Configure here.
|
OpenAI Decisions support is now included in this same Jev/consolidation PR at
Old-head auto-merge was disabled before updating the branch. Fresh exact-head CI and required independent approval remain mandatory before a normal merge; no old waivers apply. GitHub/PyPI publication is user-authorized only after merge and actual merged-commit/artifact validation. Nothing has been merged or published in this continuation. |
|
Live OpenAI Decisions validation on exact head 9e7a61a: both sync and async real OpenAI contracts passed (2 passed, 4 non-OpenAI cases deselected). Verified choice, predicate, scaled score, probabilities, confidence, and untouched raw usage metadata. Command: pytest tests/llm/test_decisions/test_live_decisions.py --run-decisions-live -k openai -q -rA. Fresh credential-free Decisions suite also passed: 294 passed, 1 existing skip. This supersedes earlier live-OpenAI-unverified evidence for these two cases only; native image input and broader live coverage remain unverified. No merge or publication performed; exact-head CI and required independent approval remain separate gates. |
|
@vm Jason requested that we complete the independent review so this can merge and release 1.18. Please review the current exact head 9e7a61a and submit an APPROVE or REQUEST_CHANGES review. All 29 runnable exact-head checks pass (publication skipped); both real OpenAI Decisions sync/async tests pass, and the focused Decisions suite passes 294 tests with one existing skip. The full docs build passed. Earlier reviews are on older heads. Particular attention requested for native OpenAI wire translation/raw metadata, Jev compatibility, Python 3.9, and the consolidated core changes. Current evidence and limitations are in the PR body and comments. Main requires one independent approval; no bypass or publication before normal merge and merged-commit validation. |
## Scope Current candidate: **68f4e4e1211e7672463ae76495bade22f8c41c17**. All 29 runnable current-head checks passed; publication skipped. Independent review found a recursive-schema crash in f4d7424; it was fixed and independently re-reviewed at 93a913e. The external autofix then added one more regression test in two commits; the runtime tree is unchanged. That test-only delta has also been independently reviewed with no actionable findings. Required approving GitHub review requested from `vm` remains the sole merge blocker. Publication remains explicitly on hold. The user additionally selected batch strict-schema and failed-result retrieval fixes. OpenAI schemas now require defaulted/nested fields, normalize references/compositions, preserve aliases and metadata, and do not mutate caller-owned schemas. Arbitrary-key mappings raise an explicit error instead of silently losing their value schema; Anthropic mappings are unchanged. Boolean-schema preservation is compatibility behavior, not proof that OpenAI accepts every custom schema. Completed OpenAI retrieval includes both output and error files, waits for files indicated by request counts, and supports error-only batches. With unknown counts it reads announced files without claiming their completeness. Ended Anthropic batches return failed request records even when none succeeded. Provider error type/message, request IDs and original records are preserved. Running jobs remain unavailable. Added native SDK/localhost retrieve-download contracts without new mocks or paid requests. ## Current Validation - Entire 25-file independent review found one P2: recursive described references could create a cyclic dictionary and raise RecursionError. Self-recursive and mutually recursive tests reproduced the failure before the fix. Copied reference nodes and path-local active references now preserve recursive back-references, metadata and strictness without cycles. The generated schemas validate nested instances with Draft 2020-12 validation. - Independent re-review verified the immutable 93a913e patch and found no remaining actionable issue. 457 tests passed during the whole-diff review at f4d7424; 78 focused tests passed after the repair. This engineering review cannot substitute for the required independent GitHub approval. - The final test-only delta was independently reviewed at immutable 68f4e4e; all 19 schema cases passed. All **43 batch regressions pass against the runtime-identical 93a913e installed wheel** on Python 3.9/OpenAI 2.0/Pydantic 2.8 and Python 3.13/OpenAI 3.3/Pydantic 2.14. That wheel was built from sdist and passed Twine checks without uploading. - [Final exact-head full coverage CI](https://github.com/567-labs/instructor/actions/runs/38118982055) passed **4,140 tests, 200 skipped, 862 deselected**, 106 existing warnings. It independently reports zero missing of 9,906 statements and four missing of 3,514 branches; the unchanged 99% gate and zero-missing assertion passed. Local runtime-identical 93a913e validation separately passed 4,139 tests with **99.9702% coverage**. No old-head CI is reused. - All 29 runnable final-head checks passed, including source/test typing, lint, Python 3.9-3.13 offline coverage, wheel matrix and provider jobs. [Current-head release-readiness CI](https://github.com/567-labs/instructor/actions/runs/38118982058) passed artifact preparation and Python 3.9/3.13 wheel smoke; publication was skipped. Provider success badges do not certify skipped live scenarios. - Checkout and final diff are clean; all 25 files are maintained code, tests, docs or changelog. No ad hoc reports or task plans are included. - The matching old-head Bugbot finding is addressed in [this review thread](#2767 (comment)) and resolved after test-backed independent verification. Requested maintainer approval must cover the current head, not f4d7424. No admin waiver applies to this PR. ## Prior Validation At f4d7424 - Final frozen-file combined offline suite: **4,137 passed, 200 skipped, 862 deselected**, 106 existing warnings, with CI mode, dotenv disabled and API_KEY environment variables removed (374.22 seconds). - **9,906 statements, zero missing; 3,514 branches, four missing; 99.9702% combined coverage.** The unchanged 99% gate and zero-missing-statement assertion passed. The initial run overlapped final schema edits and is not used as coverage proof; a fresh separate-database run produced these final totals. - Full source and test typing, Ruff lint/format checks, normal commit hooks and clean diff passed. - Final MkDocs build passed with existing nav/docstring warnings; wheel built from sdist, and both Twine checks passed. - **40 new batch regressions passed against the installed final wheel in each environment:** Python 3.9/OpenAI 2.0/Pydantic 2.8 and Python 3.13/OpenAI 3.3/Pydantic 2.14. Site-packages imports verified, not source-checkout imports. Prior 95-case installed-wheel proof belongs to 7ca0073. - Common provider finalization/regression suite: 215 passed; falsey adapter matrix rerun passed all 28 cases after test typing refinement. - Independent read-only re-review of the new batch fixes, generated TypedDict serializer and inherited finalizer found no actionable finding. Review did not itself run tests and does not constitute GitHub approval. Nested TypedDict-with-optional-key and direct provider-entry-point matrix extensions remain additional coverage opportunities; existing broad provider suites are separately validated. - Independent final read-only batch review found no remaining actionable issue after reference normalization and readiness/JSONL test gaps were addressed. This does not constitute GitHub approval. - All **29 runnable exact-head CI checks passed**; publication skipped. [Full coverage CI](https://github.com/567-labs/instructor/actions/runs/38092004959) independently confirms 4,137 passed, 200 skipped, 862 deselected and zero missing statements. [Release-readiness CI](https://github.com/567-labs/instructor/actions/runs/38092004970) passed preparation and wheel smoke tests without publishing. Provider job success is not a claim that every live provider scenario ran; for example, Google core-provider tests were skipped for missing settings. - Initial independent GitHub review request sent to `vm` with [exact-head evidence](#2767 (comment)), then updated to corrected head 93a913e in the addressed review thread above. Do not treat approval of the old head as approval of the fix. ## Production-Wide Simplicity Review Inspected all 205 production Python files across provider implementations, core/DSL/validation, public/legacy/batch/CLI, Decisions, and root integration. This is an implementation/maintainability review with targeted regression validation, not exhaustive security certification or universal live-provider proof. - Consolidated four identical OpenAI/Anthropic/Mistral/xAI result finalizers into the existing ModeHandler base. Preserve SDK-specific parsing, iterator laziness, falsey adapters, and exact raw-response identity; old imported module names remain explicit compatibility exports. Added a common four-provider behavioral matrix. - Reproduced and repaired missing Anthropic tool input being accepted as a defaulted empty result. Explicit returned empty objects still work. - Reproduced and repaired request-ID/metadata loss on invalid non-object batch payloads. - Reproduced and repaired underscore TypedDict cache misses and optional-key omission loss. Generated TypedDict models use narrowly scoped round-trip serialization; arbitrary user-model alias behavior is untouched. - Kept compatibility facades, provider wire/SDK exceptions, security limits, and streaming transport paths intact. Strict-schema and failed-batch retrieval findings are now fixed with user authorization. Streaming validation, native xAI context, CLI and registry-capability issues remain focused follow-ups, not silently folded into this patch. Integrate the five user-selected compact fixes onto main after #2708, retaining version 1.18.0. Publication is explicitly on hold. - [#2743](#2743) at 5c03dfd: validate complete batch payloads with Pydantic, including RootModel and empty objects with defaults. - [#2758](#2758) at 13a11f4: retain Anthropic errored result type/message, custom ID and raw record; preserve legacy error handling. - [#2757](#2757) at 3156d55: preserve underscore-prefixed TypedDict keys with collision-safe internal fields and original aliases. - [#2764](#2764) at ab9b0c2: replace nonfunctional logging environment instructions and unsupported correlation-ID claims. - [#2765](#2765) at faae38e: use the public Maybe model factory instead of nonexistent field APIs. The batch processor overlap is reconciled against merged main 035c77b. Release notes are consolidated under 1.18 rather than separate Unreleased sections. Dynamic TypedDict test construction and prepared-model narrowing were repaired for the full test typing gate, without weakening assertions. ## Prior Validation Candidate head: 128cf44. - Focused combined regressions and Decisions contracts: 341 passed, 1 existing skip. - Full source and test typing passed; repository Ruff lint/format checks and normal commit hooks passed. - Full MkDocs build passed with existing navigation/docstring warnings. - Wheel built from sdist; Twine checks passed for both distributions. - All 47 new batch/TypedDict regression cases passed against the installed wheel on Python 3.9 with OpenAI 2.0.0/Pydantic 2.8.0 and Python 3.13 with current core dependencies. Imports were verified to use site-packages, not the checkout. - Release metadata/notes validation passed for 1.18.0. - Exact-head remote full offline suite: 4,057 passed, 200 skipped, 862 deselected; zero missing statements and four missing branches. The unchanged 99% coverage gate passed. - All 29 runnable exact-head CI checks passed, including Python 3.9-3.13 coverage, lint/type checks, wheel matrix, and release readiness/smoke tests. Publication was skipped. Independent approval remains required; this PR stays draft while the user-requested production-wide simplicity review is ongoing. The initial local full-suite invocation inherited provider keys and lacked INSTRUCTOR_ENV=CI; it unexpectedly selected unmarked provider tests and was stopped after 1,286 passes/15 skips. It is not complete offline validation and is not used as a release gate. The corrected full coverage run uses the repository's CI mode with API keys removed. No intentional paid-provider experiments were added. No new mocks, threshold changes, tags, issue closures or publication. All 25 final files are maintained code, tests, docs or changelog; no ad hoc reports/task plans are included. Source PRs are credited without automatic issue-closing keywords.
Consolidates OpenAI batch request error handling. Current main already retrieves both output and error files for completed jobs, preserves the raw record and uses provider type before code. Keep that public contract, preserve string errors at either location, and report unsuccessful HTTP status codes when the provider omits the error body. The full provider code is available in raw_data when both type and code are present. Validation: 90 offline tests passed across parsing, retrieval, file downloads and malformed records. The OpenAI and Anthropic download tests from #2804 verify that non-ASCII results are written as UTF-8 on platforms with an ASCII default. The production encoding fix shipped in #2708. Consolidates #2820, #2822, #2825, #2657 and #2804.

Current Candidate: Jev and OpenAI Decisions
Exact head:
9e7a61a9d85aacd812ec8e77a68b9d2adaecef66. OpenAI Decisions support and the same sync/async provider/configuration contract family as OpenRouter and TypeSafe are included. Shared suite: 294 passed, 1 existing skip. Decision source has 373/373 statements covered; source unchanged since coverage measurement. Full source typing, test typing, and normal commit hooks passed. Six opt-in live provider cases were skipped without explicit opt-in; no billed API calls. Native OpenAI image input and live OpenAI compatibility remain unverified.Documentation: complete MkDocs build passed (13.17s; existing navigation/docstring warnings), primary example model definitions executed without API calls, guide linked in navigation, and OpenAI entry included in 1.18 release notes. Guide documents all three routes, raw wire differences, text-only support and shared/live test configuration.
Fresh exact-head CI and required independent approval remain mandatory. Old-head auto-merge was disabled before updates. Previous-head checks below are historical evidence, not current proof. No merge or publication in this continuation.
Implementation and earlier validation details.
Prior Integration Evidence
Summary
Curated Instructor 1.18 integration from main
e12f8b49203b0c1f253d27c1e709d0a09b9fc5a8, current candidateb76939ea652202842ae26aec4663ef52d13356d7. Ready for independent review; this is not approval to merge or publish.The selected patches were revised where needed, not merged blindly. New transport contracts use real SDKs and loopback HTTP/gRPC, not new mocked provider clients. Existing legacy mocks are not claimed as live provider evidence.
Validation
Current candidate:
b76939ea652202842ae26aec4663ef52d13356d7. Earlier local results below are for heada3137a76159611c080ebcc0c36ccf0383901e2f2unless a different head is named.a3137a76159611c080ebcc0c36ccf0383901e2f2; publication was intentionally skipped. Required independent review remains unsatisfied.9bcef9849fa609040c65fec30f1d3869e64d415eaddsResponseParsingErrorguards and a missing-tool-calls regression test. Its full offline suite passed 3,963 tests, but the zero-missing-statements gate failed on the untested empty-choices branch. Headba0db64bad4d9112fdcaef082bfd9a382a25e57cadds that SDK-validated regression test; the complete focused parallel suite passed 54 tests, plus Ruff lint/format and focused test typing.ba0db64bad4d9112fdcaef082bfd9a382a25e57c, all 29 runnable CI checks passed and publication was intentionally skipped. Full offline coverage ran 3,964 passed, 200 skipped, 859 deselected, with zero missing statements and 4 missing branches. No threshold was reduced.mkdocs build --cleanpassed. Atb76939ea652202842ae26aec4663ef52d13356d7, all 29 runnable CI checks passed, publication was intentionally skipped, and full offline coverage reported 3,964 passed, 200 skipped, 859 deselected, zero missing statements, and 4 missing branches. Independent maintainer approval remains outstanding.typesafe/jev-1.13): sync and async contracts passed using the configured local key. No credential or response payload was added to this PR. Direct TypeSafe/Jev live calls remain unverified becauseTYPESAFE_API_KEYis unavailable.mkdocs build --cleanpassed at the same head, writing only to a temporary site directory. It reported existing nav omissions and two griffe annotation warnings; no documentation build errors.No other live provider calls were made in this integration validation. Exhaustive repository security certification is not claimed. The Bugbot finding was addressed and its review thread resolved. Current-head CI passed; required independent maintainer approval remains the merge gate. No publication, tag, deployment, main merge or issue closure.
Security and Compatibility
64:ff9b:1::/48prefix. Its translation layout is network-specific; assuming a fixed embedded destination is unsafe for this fetcher's public-network-only policy (RFC 8215, section 5). Known well-known NAT64/mapped/compatible/6to4/Teredo destinations are checked as well as their IPv6 wrapper.ValueError; complete objects can still emit before EOF.ResponseParsingErrorinside retry rather than silently losing results. Nonstream validation is eager while the returned public generator type is preserved.IncompleteOutputExceptionbefore defaults or caches can turn partial output into an accepted answer. SDK metadata/reason remain attached.Overlaps and Deferrals
Reviewed the current 78-PR/28-issue queue. Compact selected changes received detailed source review; large providers/features/architecture received scope triage, not blanket approval. Absent CI is not passing. The table below records every source head inspected; these heads are not independently certified merge-ready.
Every Open PR
a2f0b309464b70b8936054466e6a365d16c9cb395061c6866f2c94f46eedd4336753e9db8215fd9b248effa5c97e5c046685d7c6b144c4cbc786370282a083207fe45993e339d74a96c5d2b0cba634fc79aa81e1dec364422dcac7401e67c150a547250c27dd66315794394a9c471c6a75c2ad4b538abae659316edcbe5c1f3cc094d70f042a9d43a26a8db5692433fa8e04c21274232d83d042a27f37113924bfd56e7dda4d3444fd4d866f1c7399a5bee58b5589f9db983865175e92a7096615ce2bcc454bfb0781f28eb416c206c1b8ae702705e66007ac5e107d7c829eb06297d07bcd1ff957c481d8c042ef64da9688857ccba01dbebc4d3f5db0c1d158780c6c73f47161c87b872e13e54aecb9aed24e1a131a938b545232b6ff01f78fb938e84daeec4e876dfb45da7782155fc19e435173fa32ab7d5f78815bf991113b09a98e768bfd2955164fe320cf0994a6f4b2a57f70d2099a4b598f67a1b09e00ad7bed15cb832b0bed63816628aec034f5fc965b8d719d48bb0b8e2c0276aea1b25f061b3949b9883bd482ddd183cce69a43d3cd7b8a3a8df758c946af510ef036e91706d34c3039faf530296960d24d50e8df8f9d9a6b4df16706ab588da537f76edec57b33ae9ff6141bc3d95dccd28e803fa08cd89c87f5692ea044701a9763946ad1795ad6428daf277df06a07ee3c5dda2b028330d359994d3cd6c7ee6f2274bb950b2310137b253c9e8b50602c39466c135b2e3c7400e3e0f2a1c390cd605c9928029d937c860b22456d26f277f427ad196bed5c3bd6d61b3bd0855285d8e8e14c6e06613fc30a3ef6d29374e8df92bfb2a4122d1207effdd29b1aa1da9e0a283eda5551835f1a018f619b3ab20d5cc6914b42c38bba80f6aa8c458501c7bee784497eb87c7edab13ff1c64095f2c93cf4ce1943f2d666c465728062bc342d8934c55e664bd39745d0ba809e293973697aa7a0be8ab64c8168786153500ce306f5bd65bb051aedd080e48a73f704f3530caef4891214a00dac7abd8496e92e969bfaa3b75f83568063fa38dbd84d28a0a0848c0da6dce755f054b1b2088faf8fffaea7dbfac05db7eda57883460ed8329775e9de4ede4a87b2786c670fd74545d374afb249d01667a280115fa75b1156f208aec71909a7b27358bbdbfc2638a5745857762506e18dd4ed4e12bcc25069a4ce449138cf03b1ca1fe9e902abdb5a1aea9eab04afdb133ae39c83e91095777cf4d031e7414bcaa427ab989c42f96e54ee418cad55aa93d9b6d1623a2e1b5ba066796e8b580fe0f2503dfa758a2d5be5957db81794c6ef3152a697f423b32bbe25af8021a948c35d8af41caab02eaba1215a0f1e6ccf2139e88b1cc5539a8d2f337b3148717a76209616b72052ff1d4fb95709ad3e32283f0ae51b3f06f5e06dc0415be282c5f5e5515c629eb4a94fab9953a1647de0ee66797132438debe231c3a49c9168b478ec82a82055983f477e7d33a821b1b1593257a820ab52e656317405a8ce322502e3f4ba1f0ff62d5524965fec5233806aa1229322d2b865d0224a2a94d222375eae4396bc6b153c8ba75e25461c43cd05c9b52f67ae3cb8300df33ba1111a6dc9da6788429bab9d4106bef2ae2485aa6f4b9d7b7cb445214547968e1a7e61b564c152a36b244b5e2618bd5e06e13ee1ce1876fa65db4abe9654e386acbe9e64585b56bda419b0daa747caa02a3a924ee4f889e6cba9572da58ff403984f0a66465f96f08e256cdc3f0608e7578cf2ad9d6e68201124bca8957d4fe5ca42bd4ef5203e77c6bb31451d31df1220509538fbf4e4a01c0d7a79ca3b4389f70fdefd30f0be65219d27e981ff4cd98a87a9bf8a3a1579b0d394e92226cb315440c7942782e90e9bea0da26e20d2d37add94b9cc29b42af7bc55f4f639ad352fd9314b9f6f477971b6ee4e83b7371363d705acb8c1cd344efc293cd42369ea69182609c2e4789ebb40430ecba3407c27b50ebd52913a6053a0047b2c97c07768f9374c8a5243c9a9b3c44096ecd5f92619743bf3182ce21a3aef6e1d222c4f12430eea028f5895a68c96f15cbcd7513eb70f25defed4c8e0927b836fdb9ea01a9b5c1d9fd5df24eb3a973a0462c04988a69e05baddd3ad79a960f6462a22a559f05ae14e9159c84e71bae19f5bbaa6217e83b5d69d862fd12470aef57a77c5caAll Open Issues
No superseded item is closed yet: consolidation must receive review first. Use this PR rather than merging overlapping patches separately. Strict-schema #2701 is blocked by recursive $ref overflow and mapping semantics; #2700's EOF buffering is excluded because it breaks streaming. The deferred dependency/provider/architecture groups require separate validation and ownership.