Skip to content

feat(memory): expose get_session to client layer - #39

Open
Isuzu-ren wants to merge 1 commit into
huaweicloud:mainfrom
Isuzu-ren:feature/get-session-api
Open

feat(memory): expose get_session to client layer#39
Isuzu-ren wants to merge 1 commit into
huaweicloud:mainfrom
Isuzu-ren:feature/get-session-api

Conversation

@Isuzu-ren

Copy link
Copy Markdown
Contributor

Summary

  • Expose get_session from the HTTP service layer through to the dataplane and client layers, for both sync and async variants
  • Add get_info() convenience method to MemorySession and AsyncMemorySession that retrieves SessionInfo for the current session
  • Dataplane layer parses the raw dict response into SessionInfo via from_dict(), consistent with create_memory_session
  • Async get_info() calls _ensure_initialized() before querying, matching the pattern of other async session methods

Changed Files

File Changes
src/agentarts/sdk/memory/inner/dataplane.py Add get_session() with space_id/session_id validation, returns SessionInfo
src/agentarts/sdk/memory/inner/dataplane_async.py Add async get_session(), identical to sync version
src/agentarts/sdk/memory/client.py Expose get_session() in MemoryClient, returns SessionInfo
src/agentarts/sdk/memory/async_client.py Expose get_session() in AsyncMemoryClient
src/agentarts/sdk/memory/session.py Add get_info() convenience method; import SessionInfo
src/agentarts/sdk/memory/async_session.py Add get_info() convenience method; import SessionInfo

Verification

The get_session API was verified across all three access layers using a test script that creates a session, queries it via the new get_session or get_info method, and asserts the returned SessionInfo fields match the created session. MemoryClient.get_session() successfully retrieves SessionInfo with matching id, space_id, actor_id, and created_at fields. MemorySession.get_info() produces identical results through the convenience method. AsyncMemoryClient.get_session() and AsyncMemorySession.get_info() both complete without error, confirming that the async path correctly calls _ensure_initialized before querying and that the dataplane layer properly parses the raw dict response into SessionInfo via from_dict. All assertions pass, confirming end-to-end propagation from service layer through dataplane to client and session.

@codecov-commenter

codecov-commenter commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 19.35484% with 25 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@659d1b4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/agentarts/sdk/memory/inner/dataplane.py 10.00% 9 Missing ⚠️
src/agentarts/sdk/memory/inner/dataplane_async.py 10.00% 9 Missing ⚠️
src/agentarts/sdk/memory/async_session.py 25.00% 3 Missing ⚠️
src/agentarts/sdk/memory/session.py 33.33% 2 Missing ⚠️
src/agentarts/sdk/memory/async_client.py 50.00% 1 Missing ⚠️
src/agentarts/sdk/memory/client.py 50.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #39   +/-   ##
=======================================
  Coverage        ?   54.01%           
=======================================
  Files           ?       95           
  Lines           ?     7848           
  Branches        ?     1210           
=======================================
  Hits            ?     4239           
  Misses          ?     3316           
  Partials        ?      293           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Expose get_session from the HTTP service layer through dataplane,
client, and session layers, matching the delete_session pattern.

- dataplane.py: add get_session() returning SessionInfo via from_dict()
- dataplane_async.py: add async get_session()
- client.py: expose get_session() in MemoryClient
- async_client.py: expose get_session() in AsyncMemoryClient
- session.py: add get_info() convenience method; import SessionInfo
- async_session.py: add async get_info() with _ensure_initialized()
@Isuzu-ren
Isuzu-ren force-pushed the feature/get-session-api branch from 4d4655c to 6597edc Compare August 12, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants