Repository navigation
feat(clients): keep the search envelope and read as an agent - #2012
Merged
Merged
Conversation
Contributor
|
Claude Code Review — skipped: draft PR |
The SDK group of the 2026-10-01 audit: L-173 (B33) and B35's L-03, L-93 and L-94. - L-173: recall() in both SDKs sends items_alias false, so the server no longer repeats the result list under items, about half of each response; items_alias true still asks for it. - L-94: search() returns a SearchResult, a list of Memory (an array in TypeScript) that also carries recall_tracked, diagnostic, warnings and the raw envelope, which were dropped. - L-03: search() and recall() take caller_agent_id (callerAgentId), so a tenant-key client can read an agent's scope_agent memories. Opt-in, per Eldad: the client's agent_id is never sent on its own, since the server would also hold the read to that agent's fleet. - L-93: the interviewer counts windows an async server accepted, and its run summary reports them instead of "0 memories written". The READMEs, docstrings and runner notes describe the async default. Compatibility: SearchResult is a list (array) subclass, so code that iterates or indexes search() results is unchanged. recall()'s raw body no longer has items unless items_alias=True is passed. Signed-off-by: eldad-caura <eldad@caura.ai> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eldad-caura-ai
force-pushed
the
sdk-envelope-identity
branch
from
October 8, 2026 14:44
4612518 to
4ab2abb
Compare
eldad-caura-ai
marked this pull request as ready for review
October 8, 2026 14:46
Contributor
Claude Code Review ✅ No issues found. Reviewed by |
Member
Author
|
@erni-a please aprprove |
erni-a
approved these changes
Oct 9, 2026
Merged
eldad-caura-ai
pushed a commit
that referenced
this pull request
Oct 9, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>backend: 3.30.0</summary> ## [3.30.0](backend-v3.29.1...backend-v3.30.0) (2026-10-09) ### Features * **clients:** keep the search envelope and read as an agent ([#2012](#2012)) ([f147f61](f147f61)) ### Performance * **storage:** index the contradiction window and expiry sweep ([#2009](#2009)) ([f0818c0](f0818c0)) * **storage:** write a batch of entity links in one transaction ([#2015](#2015)) ([419c3bc](419c3bc)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: release-please[bot] <release-please[bot]@users.noreply.github.com> Co-authored-by: caura-deploy-bot[bot] <265395343+caura-deploy-bot[bot]@users.noreply.github.com>
1 task
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.
Why
This PR fixes the SDK group from the 2026-10-01 audit: L-173 (from the search and query-cost batch, B33) and all of B35 (L-03, L-93, L-94). All four are in the Python and TypeScript clients'
search()andrecall(), or in the interviewer that ships with the Python client, so they ship as one commit.What changes
Both SDKs
L-173:
recall()sendsitems_alias: false. The server otherwise repeats the result list underitems, about half of each response, and both SDKs readmemories. Passingitems_alias=True(Python) oritems_alias: true(TypeScript) still asks for the copy.L-94:
search()returns aSearchResult(newly exported in both SDKs). It is still a list ofMemory(an array in TypeScript), so code that iterates, indexes or compares results is unchanged. It also carries the response envelope, which was dropped before:recall_tracked(recallTracked);diagnostic, which adiagnostic=Truesearch returns;warnings, for example a parameter the server ignored;raw, the whole body.An envelope field the server omits reads as
None(null).L-03:
search()andrecall()takecaller_agent_id(callerAgentId). It lets a tenant-key client read an agent'sscope_agentmemories. Eldad chose opt-in (2026-10-08): the client'sagent_idis never sent as the reader on its own. Asserting it makes the server register the agent if it is new, and hold the read to that agent's fleet and trust level. That would narrow or refuse reads for existing tenant-key clients that setagent_id. Both READMEs explain this.Python interviewer (L-93)
acceptedwithmemories_written0, and the memories are written in the background.FileResultcounts those windows (windows_accepted). The run summary reports them as "accepted for synthesis in the background" instead of the old "0 memories written". It still reports "memories written" for windows a synchronous server interviewed in-line.submit_interview()'s docstring and the runner's protocol notes now describe the async default. The README no longer promises "never a gap": a window whose background synthesis keeps failing is parked for an operator.Docs:
docs/api-surfaces.mdnotes that both SDKs now senditems_alias: false.Rollout notes
SearchResultis a list (array) subclass, so existing callers keep working. TypeScript'sSearchResultisMemory[] & SearchEnvelope, assignable toMemory[].recall()'srawno longer containsitemsunlessitems_alias=Trueis passed.extra="allow"). A server that predatesitems_aliasorcaller_agent_idignores them and says so in its warnings.Evidence
The tests were pushed before the fixes, so each new case was seen failing first.
tscpassed.items_alias.'list' object has no attribute 'recall_tracked', and no envelope fields on the TypeScript array.search()andrecall()had nocaller_agent_idparameter, and TypeScript sentcallerAgentIdverbatim.FileResulthad nowindows_accepted, and there was no summary-line function.test_interviewer_runner.pycan answeraccepted, as the default server does.🤖 Generated with Claude Code