oracle / oracle/agent-spec

LangGraph adapter fails to load OciGenAiConfig LlmNode with structured output

Open
#232 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
420
Forks
60
Avg merge
9h 30m
Merged PRs (30d)
4

Description

The LangGraph Agent Spec adapter fails while loading a valid Flow containing an LlmNode configured with OciGenAiConfig and a strict nested output schema.

Agent Spec serialization succeeds, but runtime loading fails before any OCI request is sent.

Reproduction

The LlmNode declares a structured output such as:

{
  "title": "result",
  "type": "object",
  "required": ["name", "profile"],
  "properties": {
    "name": {"type": "string"},
    "profile": {
      "type": "object",
      "required": ["score", "active", "tags"]
    }
  }
}

The LangGraph runtime is loaded with:

RUNTIME_CLASS_IMPORT_PATH=langgraphruntime.LanggraphAgentSpecLoader

Actual behavior

Loading the component fails with:

ValueError: Unsupported tool type <class 'dict'>.
Tool must be passed in as a BaseTool instance, TypedDict class, or BaseModel type.

The failure occurs in:

pyagentspec/adapters/langgraph/_node_execution.py
self.llm.with_structured_output(json_schema)

Then:

ChatOCIGenAI.bind_tools([json_schema])

The adapter passes the JSON schema as a raw Python dictionary, but the installed langchain_oci provider rejects dictionary tool definitions.

Expected behavior

The LangGraph adapter should either:

  1. Convert the Agent Spec JSON schema into a supported structured-output representation before calling ChatOCIGenAI; or
  2. Raise a clear unsupported-feature error during configuration validation.

The component should not fail with a low-level Unsupported tool type <class 'dict'> error.

Impact

  • Agent Spec serialization succeeds.
  • LangGraph component loading fails.
  • The OCI endpoint is never called.
  • Structured LlmNode tests cannot execute with OciGenAiConfig.
  • The same Agent Spec may behave differently across LangGraph and WayFlow runtimes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pyagentspec/adapters/langgraph/_node_execution.py at the self.llm.with_structured_output(json_schema) call, then follow how ChatOCIGenAI.bind_tools handles the schema. Reproduce loading with RUNTIME_CLASS_IMPORT_PATH=langgraphruntime.LanggraphAgentSpecLoader and the nested OciGenAiConfig schema. Done means supported structured output or a clear configuration error instead of the low-level dictionary tool-type failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.