Skip to content

fix(langchain): recognize SDK system health flag - #5878

Open
r266-tech wants to merge 1 commit into
volcengine:mainfrom
r266-tech:codex/langchain-sdk-health
Open

r266-tech wants to merge 1 commit into
volcengine:mainfrom
r266-tech:codex/langchain-sdk-health

Conversation

@r266-tech

@r266-tech r266-tech commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

viking_health prefers the SDK's get_status(), which returns is_healthy, but the adapter only recognized other health fields. Healthy and unhealthy SDK responses both became state: "unknown".

Recognize a boolean is_healthy after the existing healthy/ok and recognized status/state values, preserving their precedence. Include the flag in the existing safe summary; raw errors and component details remain excluded. Server health computation and SDK behavior are unchanged.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #5876.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

Extend the existing public-tool safe-summary test to cover canonical booleans, conflicting legacy fields, and a non-boolean flag.

Testing

  • Real loopback HTTP server → current SyncHTTPClient.get_status() → public viking_health: 10 controls / 20 HTTP requests. Unmodified main fails the two canonical boolean controls; this change passes all 10, including legacy precedence and safe-summary controls. This tests response consumption, not a deployed OpenViking backend or model service.
  • python -m pytest --noconftest -o addopts= -q tests/unit/test_langchain*.py tests/integration/langchain_langgraph: 218 passed, 1 skipped, with 68 existing deprecation/future warnings. The skipped host-summary persistence test requires the optional langgraph.checkpoint.sqlite package, which is not installed in this isolated environment.
  • ruff format --check and ruff check on both changed files: passed.
  • mypy --config-file examples/langchain/pyproject.toml examples/langchain/src/langchain_openviking: passed (15 source files).
  • git diff --check: passed.

Python 3.12.14 / macOS arm64. Hosted CI remains to be observed.

  • I have added tests that prove my fix is effective
  • New and existing component tests pass locally
  • macOS
  • Linux
  • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • The existing safe-summary boundary and field precedence are preserved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug]: LangChain health tool ignores the SDK is_healthy status flag

2 participants