Skip to content

fix: Session.add_message() support parts parameter#399

Merged
qin-ctx merged 1 commit intomainfrom
fix/session-add-message-parts-support
Mar 3, 2026
Merged

fix: Session.add_message() support parts parameter#399
qin-ctx merged 1 commit intomainfrom
fix/session-add-message-parts-support

Conversation

@qin-ctx
Copy link
Collaborator

@qin-ctx qin-ctx commented Mar 3, 2026

Description

Fix Session.add_message() and OVClient.add_message() to support the parts parameter (TextPart, ContextPart, ToolPart), aligning the wrapper API with the underlying BaseClient and documentation.

Related Issue

Fixes #397

Type of Change

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

Changes Made

  • openviking/client/session.py: Updated Session.add_message() signature to accept optional parts: List[Part] in addition to content: str. When parts is provided, converts Part dataclass objects to dicts via dataclasses.asdict() before passing to the underlying client.
  • examples/claude-memory-plugin/scripts/ov_memory.py: Updated OVClient.add_message() to expose the parts parameter, passing it through to the underlying sync client.

Testing

  • I have performed a self-review of my code
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the project coding style
  • I have performed a self-review of my code
  • My changes generate no new warnings

Additional Notes

The underlying infrastructure (BaseClient, AsyncHTTPClient, LocalClient, server-side Session) all already support parts. Only the user-facing Session wrapper class and the OVClient example were missing this parameter.

Session wrapper and OVClient example only accepted string content,
missing the parts parameter (TextPart, ContextPart, ToolPart) that
the underlying BaseClient already supports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qin-ctx qin-ctx merged commit 7ac5ffb into main Mar 3, 2026
5 checks passed
@qin-ctx qin-ctx deleted the fix/session-add-message-parts-support branch March 3, 2026 12:27
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 3, 2026
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.

[Bug]: SDK AsyncHTTPClient session not support to submit parts

3 participants