oracle / oracle/agent-spec

Inconsistent handling of default values for optional fields inside ObjectProperty inputs

Open
#241 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 Agent Spec declares optional fields with default values inside a nested ObjectProperty. Both LangGraph and Wayflow serialize the defaults correctly, but neither runtime handles the omitted nested fields consistently during execution.

The test is:

conformance_test_suite/tests/sajal_tests/test_opn_sch_in_out.py

The input schema declares:

{
  "title": "request",
  "type": "object",
  "properties": {
    "customer_id": {
      "type": "string"
    },
    "profile": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "age": {
          "type": "integer"
        }
      },
      "required": ["name", "age"]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "priority": {
      "type": "string",
      "default": "normal"
    },
    "notifications": {
      "type": "boolean",
      "default": true
    }
  },
  "required": ["customer_id", "profile", "tags"],
  "additionalProperties": false
}

The test supplies a valid input containing all required fields but omits the optional defaulted fields:

{
    "request": {
        "customer_id": "C-1042",
        "profile": {
            "name": "Ada",
            "age": 36
        },
        "tags": ["priority", "verified"]
    }
}

The expected normalized request is:

{
    "request": {
        "customer_id": "C-1042",
        "profile": {
            "name": "Ada",
            "age": 36
        },
        "tags": ["priority", "verified"],
        "priority": "normal",
        "notifications": True
    }
}

Expected Behavior

When optional fields inside an ObjectProperty are omitted, the runtime should apply their declared defaults:

priority == "normal"
notifications is True

The tool should receive the normalized object, and the final output should conform to the declared output schema.

Actual Behavior

LangGraph

LangGraph accepts the nested input and invokes the tool, but passes None for both omitted defaulted fields:

{
    "customer_id": "C-1042",
    "profile": {
        "name": "Ada",
        "age": 36
    },
    "tags": ["priority", "verified"],
    "priority": None,
    "notifications": None
}

The resulting output contains:

{
    "priority": None,
    "notifications": None
}

This violates the declared output schema. The test fails when checking:

assert isinstance(result["priority"], str)
Wayflow

Wayflow rejects the same valid input during start() before the tool is invoked.

The failure occurs in:

conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:67

The underlying conversion attempts to access omitted optional fields while casting the nested object and raises:

TypeError:
The input passed ... is not of the expected type ObjectProperty(...)

The error occurs even though the omitted fields have declared defaults.

Runtime Comparison

Runtime Behavior
LangGraph Accepts input, but converts omitted nested defaults to None
Wayflow Rejects input during nested object casting
Expected Applies the declared defaults and continues execution

Control Test

A separate test using a simple top-level string property with a default passes on both runtimes:

{
  "title": "mode",
  "type": "string",
  "default": "standard"
}

Starting the flow with {} correctly produces:

{"mode": "standard"}

This indicates that the issue is specific to default handling inside nested object properties rather than default handling in general.

Impact

The same Agent Spec produces different runtime behavior depending on whether defaulted properties are nested inside an object.

This can cause:

  • Runtime incompatibility between LangGraph and Wayflow.
  • Unexpected None values in LangGraph.
  • Premature input rejection in Wayflow.
  • Outputs that violate the declared schema.
  • Different execution behavior for the same valid Agent Spec input.

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 with conformance_test_suite/tests/sajal_tests/test_opn_sch_in_out.py and reproduce the nested-default case in both runtimes. Then inspect conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py at line 67 and trace the corresponding LangGraph input handling. Done means both runtimes accept the valid input, apply the declared nested defaults, pass the normalized object to the tool, and satisfy the output assertions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.