Back

langchain #35037

fix(openai): exclude empty tools list from API payload

by saakshigupta2002 · Feb 06, 2026 at 19:27 UTC · scan-d51262fdb77cb721

Low Risk (20%)

Get this automatically on every PR

Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.

Install App

Risk Assessment

Risk level: Low (20%)

Risk Drivers

  • api_surface_change: API surface changed in 1 file(s)

Intent

3/3 criteria met

Exclude empty tools list from API payload to prevent validation errors.

Acceptance Criteria

  • โœ“
    Remove empty tools from payload in _get_request_payload.

    base.py line 1422 filters empty tools.

  • โœ“
    Set tools in _construct_responses_api_payload only if non-empty.

    base.py line 3807 sets tools conditionally.

  • โœ“
    Add tests ensuring empty tools are excluded from API payload.

    test_base.py adds test_empty_tools_excluded_from_payload.

Confidence: 100.0% Source: pr description AI: openai

Contributors

saakshigupta2002 PR Author 2 commits ? Low Trust
Account Age: 2140 days
Prior PRs: 6
Merged: 1

Has 1 merged PRs to this repo. maintains 79 public repositories. unfamiliar with 2 files.

Evidence

Evidence Completeness: 70.0%
ci_passing Passing
tests_passing Unavailable
build_successful Passing
lint_passing Passing
Missing: security_scan_clean, coverage_maintained

Supply Chain

None Risk
Modifies dependencies
Modifies lockfile
Modifies CI config
Modifies build scripts

Focus Files

Review 1 high-priority file(s)

libs/partners/openai/tests/unit_tests/chat_models/test_base.py +99

99 lines changed; Source code

high
libs/partners/openai/langchain_openai/chat_models/base.py +7

Source code

medium

Triage

19

minutes to review

medium

effort level

none

staleness risk

Standard review process

Recommendation

COMMENT 67.0% readiness

Some concerns to address before approval

Next Steps

Question

Why is security_scan_clean missing? Consider adding this check.

Question

Why is coverage_maintained missing? Consider adding this check.