fix(python-client): async method parity and server keepalive timeout#387
Merged
nicoloboschi merged 2 commits intomainfrom Feb 17, 2026
Merged
fix(python-client): async method parity and server keepalive timeout#387nicoloboschi merged 2 commits intomainfrom
nicoloboschi merged 2 commits intomainfrom
Conversation
The Python client's async methods were missing parameters available in their sync counterparts, and the server's default keepalive timeout was shorter than the client's, causing ServerDisconnectedError on reused connections. Server: - Set uvicorn timeout_keep_alive to 30s (default was 5s). The Python client (aiohttp) has a 15s client-side keepalive, so the server must hold connections longer to prevent the client from writing to a closed socket. Python client - async method parity: - arecall(): add trace, query_timestamp, include_entities, include_chunks, max_entity_tokens, max_chunk_tokens. Return RecallResponse instead of list[RecallResult]. - areflect(): add max_tokens and response_schema. - acreate_bank(): new async method. - aset_mission(): new async method. - adelete_bank(): new async method. Tests: - Add test verifying uvicorn keepalive timeout exceeds client default. - Add async tests for arecall (include_chunks, include_entities, trace, full params), areflect (max_tokens, structured output), and adelete_bank.
nicoloboschi
approved these changes
Feb 16, 2026
The tag tests were unreliable because:
- Generic content ("Project X meeting notes") was frequently collapsed
during fact extraction, leaving no memories to recall
- Assertions checked LLM-rewritten text for literal substrings instead
of checking tags, which is what the tests are actually verifying
Fix: use distinctive, entity-rich content (named people with specific
actions) that reliably survives fact extraction, and assert on tag
membership rather than text content.
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.
Summary
timeout_keep_aliveto 30s. The default (5s) is shorter than aiohttp's client-side keepalive (15s), causingServerDisconnectedErrorwhen the client reuses a connection the server has already closed.arecall()was missing 6 parameters available inrecall()(trace,query_timestamp,include_entities,include_chunks,max_entity_tokens,max_chunk_tokens) and returnedlist[RecallResult]instead ofRecallResponse.areflect()was missingmax_tokensandresponse_schema.acreate_bank(),aset_mission(), andadelete_bank()— previously only available as sync.Breaking change:
arecall()return typearecall()now returnsRecallResponseinstead oflist[RecallResult].This is a bug fix, not a design decision. The old
arecall()was an incomplete implementation that:trace,entities, andchunksfrom the response by only returningresponse.resultsrecall()has always returnedRecallResponse, so anyone switching from sync to async would hit a different return typeThe return type was wrong from day one relative to the sync API and the underlying OpenAPI spec. As a
0.xlibrary, semver explicitly allows breaking changes before 1.0.Migration is trivial:
Test plan
timeout_keep_alive > 15arecall(5 tests: return type, include_chunks, include_entities, trace, all params)areflect(2 tests: max_tokens, structured output)adelete_banktest_recall_with_tags_any)