Repository navigation
fix(langgraph): structured LlmNode outputs with OciGenAiConfig require langchain-oci>=0.3.0 - #250
Merged
dhilloulinoracle merged 3 commits intoOct 1, 2026
Conversation
fede-kamel
force-pushed
the
fix/langgraph-oci-structured-output-232
branch
from
September 11, 2026 14:36
fb88820 to
b326229
Compare
fede-kamel
added a commit
to fede-kamel/agent-spec
that referenced
this pull request
Sep 30, 2026
…ersion guard Review feedback on oracle#250: the dependency bump in setup.py is enough, so the _check_langchain_oci_version helper, its call site and its test are removed. The three constraints files now pin langchain-oci==0.3.2 to match the langchain-oci>=0.3.0 requirement of the langgraph-full extra, and the changelog entry names the langgraph-full extra.
fede-kamel
force-pushed
the
fix/langgraph-oci-structured-output-232
branch
from
September 30, 2026 17:16
b326229 to
5d5f63d
Compare
cesarebernardis
approved these changes
Oct 1, 2026
Contributor
|
Internal regression succeeded 🍏: Build ID #584 |
dhilloulinoracle
approved these changes
Oct 1, 2026
sonleoracle
approved these changes
Oct 1, 2026
…angchain-oci>=0.3.0 Fixes oracle#232. Loading a Flow whose LlmNode declares structured outputs with an OciGenAiConfig failed at load time with "Unsupported tool type <class 'dict'>. Tool must be passed in as a BaseTool instance, TypedDict class, or BaseModel type." The adapter compiles the node outputs to a JSON schema dict and hands it to `ChatOCIGenAI.with_structured_output`; langchain-oci only started accepting JSON-schema dicts as tool definitions in 0.3.0 (May 2026), but the `langgraph` extra allowed `langchain-oci>=0.2.6`. - setup.py: the `langgraph` extra now requires `langchain-oci>=0.3.0`. - _langgraphconverter: check the installed langchain-oci version before building a ChatOCIGenAI and raise an ImportError that names the minimum version and the upgrade command. - _node_execution: when a chat model rejects the JSON-schema output definition, raise a configuration error naming the LlmNode, the model class and the remedy (upgrade langchain-oci, or declare a single string output) instead of surfacing the provider's low-level error. The original exception is chained. - tests: a legacy-provider fake reproduces the report and asserts the actionable error; ChatOCIGenAI (mocked client) accepts the nested schema and the OCI request carries the `structured_output` function with the nested required fields; the version guard accepts 0.3.x and pre-release tags and rejects 0.2.x. - changelog entry.
…ersion guard Review feedback on oracle#250: the dependency bump in setup.py is enough, so the _check_langchain_oci_version helper, its call site and its test are removed. The three constraints files now pin langchain-oci==0.3.2 to match the langchain-oci>=0.3.0 requirement of the langgraph-full extra, and the changelog entry names the langgraph-full extra.
constraints_v26.3.1.txt records the dependency versions of the published 26.3.1 release and must not move with a bug fix. The langchain-oci 0.3.2 pin stays in constraints.txt and constraints_dev.txt.
cesarebernardis
force-pushed
the
fix/langgraph-oci-structured-output-232
branch
from
October 1, 2026 16:47
f9ada8e to
fd315f2
Compare
Contributor
|
Merge Gate INPROGRESS |
Contributor
|
Internal regression succeeded 🍏: Build ID #525 |
Contributor
|
Merge Gate succeeded 🍏: Build ID #753 |
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.
Fixes #232.
Root cause
The LangGraph adapter compiles an
LlmNode's outputs into a JSON schema dict and passes it towith_structured_output.langchain-ocionly started accepting JSON-schema dicts as tool / structured-output definitions in 0.3.0 (oracle/langchain-oracle#225, May 2026), but thelanggraph-fullextra allowedlangchain-oci>=0.2.6, so environments resolving an older provider failed at load time with the low-levelUnsupported tool type <class 'dict'>error from the report. With langchain-oci 0.3.x the same Flow loads and the OCI request carries the nested schema as a function tool.Changes
setup.py: thelanggraph-fullextra requireslangchain-oci>=0.3.0.constraints/constraints.txt,constraints_dev.txt,constraints_v26.3.1.txt: pinlangchain-oci==0.3.2(was0.2.6).LlmNodeExecutor: if the chat model rejects the JSON-schema output definition, raise a configurationValueErrornaming the node, the model class and the two remedies (upgrade langchain-oci, or declare a single string output), with the provider error chained as__cause__. This is option 2 from the issue, kept in addition to the pin so other providers get the same clear message.tests/adapters/langgraph/test_llmnode_structured_output.py): a legacy-provider fake reproduces the report and asserts the actionable error and chained cause;ChatOCIGenAIwith a mocked client accepts the nested schema from the issue and the resulting OCI request carries thestructured_outputfunction withprofile.required == {score, active, tags}(no network).Per review, the runtime
langchain-ociversion check originally proposed in the converter was dropped in favour of the dependency bump alone.Verification
New tests: 2 passed.
tests/adapters/langgraphpasses with thelanggraph-fullextra installed under the updated constraints (langchain-oci 0.3.2). Black, isort andgit diff --checkclean. Rebased on currentmain.