Skip to content

fix(langchain): extract text blocks in viking_store - #6070

Open
ktz03 wants to merge 1 commit into
volcengine:mainfrom
ktz03:fix/langchain-store-text-block-content
Open

ktz03 wants to merge 1 commit into
volcengine:mainfrom
ktz03:fix/langchain-store-text-block-content

Conversation

@ktz03

@ktz03 ktz03 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

viking_store currently saves the Python representation of a role/content text-block list, so a normal LangChain message becomes [{...}] in the session. Extract its text with the existing shared helper, matching equivalent string messages and the history converter.

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 #6063

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Reuse extract_message_text() for list-valued role/content messages in viking_store.
  • Preserve scalar/string content, explicit native parts, role mapping and tool-result attribution.
  • Add public LangChain message-producer/tool regressions and scalar/native-parts controls.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

On original tested main f047d805, the new regressions have 4 text-block failures and 10 normal controls; with the fix, all 14 pass. The scoped LangChain suites have 237 passed / 1 SQLite skip on Linux, and 235 passed / 1 skip / 2 resource-path failures on Windows. The same two Windows failures occur on the base, which has 231 passed / 1 skip / 6 failures including the four new regressions. Both Windows runs report 68 warnings.

Ruff check/format (44 files), mypy (15 source files), wheel/sdist build, Twine, offline target installation and the installed optional-dependency smoke pass. Three installed public producer/tool controls and one scalar control pass; the 15 wheel source files match the committed and installed code. These selections overlap and are not added together.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

Validation uses cached dependencies and the official deterministic client fixture with LangChain's real public message producer. It does not cover a fresh dependency lock, a base-only environment, a deployed backend, full server, model, authentication, performance or a minimum-version matrix.

The existing adapter and shared extractor remain the work of their upstream authors. #5808 concerns Responses text-block type recognition, #5854 generic ChatMessage roles, #6036 retriever metadata references, and #6017 package relocation; this change only connects already-supported ordinary text-block extraction to the explicit store tool.

The commit is rebased onto main f2b09cd1c4a857aa621cbae91677d9b31cc4fd34. The 54 actually loaded tracked files, related package inputs and contribution/template files are byte-equivalent to the original tested scope; the two changed files retain their exact tested bytes. The new head also passes the 14 formal regressions. The Windows/Linux and package results above keep their original execution scope and times; the complete new server tree was not retested.

A later main snapshot ae1e45e0053988d093cca0bea10fe8d44281871a has a clean read-only merge and retains the tested LangChain/SDK/package inputs. This preserves the tested patch and review scope; no complete merged-server test is claimed.

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 viking_store stringifies text-block content

1 participant