Skip to content

refactor(langchain): clarify session commit policy helper#2283

Merged
ZaynJarvis merged 1 commit into
volcengine:mainfrom
ehz0ah:fix/langchain-commit-policy-api
May 28, 2026
Merged

refactor(langchain): clarify session commit policy helper#2283
ZaynJarvis merged 1 commit into
volcengine:mainfrom
ehz0ah:fix/langchain-commit-policy-api

Conversation

@ehz0ah
Copy link
Copy Markdown
Contributor

@ehz0ah ehz0ah commented May 28, 2026

Summary

  • Rename the LangChain session commit helper from maybe_commit_session to apply_commit_policy.
  • Update OpenVikingChatMessageHistory and OpenVikingContextMiddleware to call the renamed helper after message capture.
  • Add regression coverage that the new helper is exposed and the legacy helper name is no longer present.

Rationale

The helper does more than opportunistically commit a session: it applies the configured OpenVikingCommitPolicy across never, always, and pending_tokens modes. The new name better matches the behavior used by both the chat history adapter and LangGraph middleware, and keeps the lifecycle API easier to reason about before adding more integration surfaces.

Validation

  • uv run --extra dev ruff format openviking/integrations/langchain/client.py openviking/integrations/langchain/history.py openviking/integrations/langchain/middleware.py tests/unit/test_langchain_integration.py
  • uv run --extra dev ruff check openviking/integrations/langchain/client.py openviking/integrations/langchain/history.py openviking/integrations/langchain/middleware.py tests/unit/test_langchain_integration.py
  • uv run --extra test pytest tests/unit/test_langchain_integration.py --no-cov -q

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 98
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@ZaynJarvis ZaynJarvis merged commit c298f92 into volcengine:main May 28, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project May 28, 2026
@ehz0ah ehz0ah deleted the fix/langchain-commit-policy-api branch May 29, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants