feat(python-sdk): list_namespaces() so an agent can discover namespaces [WALM-651] - #930
Merged
Merged
Conversation
…es [WALM-651] Python counterpart of the TS listNamespaces() from #830 (WALM-395). - MemWal.list_namespaces(cursor=None, limit=None) -> NamespacesResult: signed GET /v1/owners/{owner}/namespaces, metadata only, no SEAL session. The query string is signed, since the relayer verifies path_and_query. - Owner resolved once per client via POST /api/stats; concurrent first calls share one lookup, and a failed lookup is retried on the next call. - MemWalSync, MemWalMock and MemWalMockSync get the same method. The mock follows the relayer's cursor format and snapshot walk. - Bump memwal to 0.1.11; README, API reference and changelogs updated.
ducnmm
approved these changes
Sep 18, 2026
ducnmm
left a comment
Collaborator
There was a problem hiding this comment.
Summary
This is a careful Python port of TS listNamespaces(): signed GET /v1/owners/{owner}/namespaces with updated_after/limit in the signed query string, owner discovery via memoized POST /api/stats, no SEAL session, and MemWalSync / mock / sync-mock parity. Mapping to NamespacesResult matches the relayer wire shape (has_more, opaque next_cursor, snapshot_version), and the mock’s keyset + snapshot walk matches query_owner_namespaces (including terminal snapshot_at: null so the next poll is a fresh walk). Tests pin the contract (single-flight owner lookup, failed lookup retry, signature covers path_and_query, mock pagination); version is bumped consistently to 0.1.11. No correctness issues found.
Issue counts by severity
- bugs: 0
- suggestions: 0
- nits: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes WALM-651. Python counterpart of the TS
listNamespaces()from #830 (WALM-395).What
MemWal.list_namespaces(cursor=None, limit=None) -> NamespacesResult. It lists the namespaces that hold memories, so a Python agent can find them instead of guessing or falling back to"default". Metadata only: no blob fetch, no decryption, no SEAL session.Same design as the TS SDK:
POST /api/statsonce per client. Concurrent first calls share one lookup, and a failed lookup is retried on the next call.path_and_query, soupdated_after/limitare part of the signed path.has_more, not page length (the relayer clampslimit).MemWalSync,MemWalMockandMemWalMockSyncget the same method. The mock follows the relayer's cursor format and snapshot walk, same as the TS mock.Bumps
memwalto 0.1.11 (0.1.10 is already on PyPI), so merging triggers the Python release job.Checks
ruffcleanlimit=1againstrelayer.dev.memwal.ai. It found 3 namespaces, with the cursor in the signed query string on each page, and the relayer accepted every requestcheck-docs-code-sync,check-docs-freshness,verify-manual-sdk-releasepassdocs/python-sdk/api-reference.mdand both changelogs updatedNot in this PR
memwal_namespacesMCP tool: WALM-652, waiting on refactor(mcp): serve stdio memory tools through the SDK, drop the SSE bridge #920