fix: finalize 1.15.5 correctness consolidation - #2510
Merged
Conversation
Several requests.get/head calls that download image, audio, and PDF content from remote URLs did not pass a timeout, so a slow or unresponsive host could hang the calling thread indefinitely (uncontrolled resource consumption, CWE-400). The GCS helpers in the same module already use a 30s timeout; this applies the same default to the remaining fetches and adds regression tests asserting a timeout is passed.
…TOOLS/JSON/MD_JSON
`create_iterable(response_model=Weather | GoogleSearch)` wraps the model in `Iterable[Weather | GoogleSearch]`, so `IterableBase.task_type` holds a `types.UnionType`. `extract_cls_task_type` matched only `typing.Union`, so the PEP 604 spelling skipped the member-by-member branch and instead called `model_validate_json` on the union object itself, raising `AttributeError: 'types.UnionType' object has no attribute 'model_validate_json'` on the first streamed item. The `Union[Weather, GoogleSearch]` spelling works. `iterable.py` already defines `_UNION_ORIGINS = (Union, UnionType)` and `IterableModel` uses it to build the wrapper class, so `Iterable[A | B]` produced a correct `IterableWeatherOrGoogleSearch` and then failed to parse into it. Match `_UNION_ORIGINS` in `extract_cls_task_type` as well, which is what `dsl/parallel.py` and `core/response_model.py` already do.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
instructor | e92e3d6 | Commit Preview URL Branch Preview URL |
Aug 08 2026, 12:54 AM |
jxnl
marked this pull request as ready for review
August 8, 2026 00:56
This was referenced Aug 8, 2026
Closed
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.
Included fixes
llmtests from core, coverage, and release lanes.1.15.5changelog section.Superseded PRs/issues
Validation
224 passed, 1 skipped, 27 deselected11 passed, 1 skipped2020 passed, 144 skipped6 passedand generated1.15.5notes successfullyty,uv lock --check, workflow YAML parse, pre-commit hooks, andgit diff --check: passedSkipped items
Note
Medium Risk
Changes affect multimodal HTTP behavior, OpenAI streaming retry parsing, and iterable union validation on common response paths; risk is moderated by focused regression tests but still touches production parsing and network I/O.
Overview
This PR bundles unreleased 1.15.5 fixes: remote multimodal safety, OpenAI streaming retry parsing, iterable union streaming, and contributor CI that does not require provider secrets on fork PRs.
Remote multimodal fetches now pass a 30-second
timeouton everyrequests.get/requests.headused to download or sniff image, audio, and PDF URLs across v2 core and OpenAI, Anthropic, and GenAI provider encoders, so hung hosts cannot block callers indefinitely.OpenAI streaming retries route TOOLS, JSON, JSON_SCHEMA, and MD_JSON through a shared
_should_parse_streamingcheck that still uses the streaming DSL parser whenstream=True, even after the one-shot streaming model marker is consumed—so a corrected streamed retry can validate instead of falling back to one-shot parsing.Iterable streaming treats PEP 604 unions (
Weather | GoogleSearch,Iterable[Weather | GoogleSearch]) liketyping.Unionby validating each union member inextract_cls_task_type, with new streaming andprepare_response_modeltests.CI / changelog: Auto-client live network tests are marked
llmand excluded from core, full coverage, and release pytest runs (-m 'not llm'); core tests no longer inject provider API keys into the environment. Changelog documents these items under 1.15.5 (dated 2026-08-07).Reviewed by Cursor Bugbot for commit e92e3d6. Configure here.