From 65361144519a25bad55c5b1651d8a9d583166d01 Mon Sep 17 00:00:00 2001 From: Vinicius Brasil Date: Tue, 22 Sep 2026 22:47:08 -0300 Subject: [PATCH] fix(deps): pin instructor <1.16 to keep OpenAI Mode.TOOLS registered (#7719) * fix(deps): pin instructor <1.16 to keep OpenAI Mode.TOOLS registered instructor 1.16.0 removed the OpenAI Mode.TOOLS handler in favor of Mode.RESPONSES_TOOLS. `InternalInstructor` calls `instructor.from_provider`, which still defaults to Mode.TOOLS internally, so any native-OpenAI kickoff that hits a structured-output path (guardrails, output_pydantic, LLM guardrails) fails immediately with `ModeError: Mode.TOOLS is not registered for provider Provider.OPENAI`. Cap the range while we teach `_create_instructor_client` to negotiate a supported mode against `mode_registry`. Refs COR-861 (Docusign, deployment 134108). Co-Authored-By: Claude Opus 4.7 (1M context) * fix: avoid redundant cache saves in tests workflow Co-authored-by: vinibrsl <5093045+vinibrsl@users.noreply.github.com> * docs: explain instructor compatibility pin Co-authored-by: vinibrsl <5093045+vinibrsl@users.noreply.github.com> --------- Co-authored-by: Daniel Minella Co-authored-by: Claude Opus 4.7 (1M context) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .github/workflows/tests.yml | 2 +- lib/crewai/pyproject.toml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3a34e94c..f64f3e0c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -113,7 +113,7 @@ jobs: - name: Save uv caches - if: steps.cache-restore.outputs.cache-hit != 'true' + if: steps.cache-restore.outputs.cache-hit != 'true' && matrix.group == 1 uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | diff --git a/lib/crewai/pyproject.toml b/lib/crewai/pyproject.toml index 7f84e6fde..ba6bc4559 100644 --- a/lib/crewai/pyproject.toml +++ b/lib/crewai/pyproject.toml @@ -13,7 +13,9 @@ dependencies = [ # Core Dependencies "pydantic>=2.11.9,<2.13", "openai>=2.30.0,<3", - "instructor>=1.3.3", + # instructor>=1.16 drops OpenAI Mode.TOOLS; remove this cap after + # InternalInstructor negotiates a supported mode via mode_registry. + "instructor>=1.3.3,<1.16", # Text Processing "pdfplumber~=0.11.4", "regex~=2026.1.15",