Skip to content

Retain conversation protection across memory-store callbacks - #910

Merged
zlareb1 merged 4 commits into
mainfrom
test/strands-callback-protection
Nov 18, 2026
Merged

zlareb1 merged 4 commits into
mainfrom
test/strands-callback-protection

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry

Memory-store callbacks retain application-owned conversation protection across client rebinding and authentication waits.

Why

A store can outlive its constructor and earlier callback contributors. Losing those contributors allows later automatic recall or capture after a contributing conversation becomes protected.

Scope and risk

The structural store retains constructor, bound-client, ambient and earlier callback contributors through the shared callback helper. The complete add and search bodies run within the retained scope, including authentication and response conversion. Only an existing application-owned automatic context selects automatic behavior; direct calls remain explicit and observe responses.

The shared helper merges concurrent contributors atomically and resolves contributors outside its lock. Existing SDK calls, payloads, hashing, metadata filtering, abstention, result limits and entry conversion remain unchanged. No protection family, public argument, wire header or dependency is added.

The tests execute the structural store and real Loom SDK at a selected mock HTTP boundary. They do not qualify the external native MemoryManager or Agent, whose search path can handle store errors itself. The default extraction setting remains unchanged.

Compatibility, rollout and rollback

  • Wire, schema, settings and dependencies: unchanged.
  • Operator steps: none.
  • Rollback: revert the retained callback scope and regression cases.

Tests

Hosted unit execution reports all 16 predicted retention failures in the unchanged store: eight constructor cases, four authentication cases, two earlier-callback cases, failed durable marking and first mirrored recall. The complete shard reports 16 failures, 6,579 passes and one skip. The other nine module cases are not named as failures; this is not a separate module result count.

All six original test bodies and assertions remain unchanged. The complete 25-case module is byte-identical for the corrected implementation check. Reproduce with python -m pytest tests/unit/test_sdk_strands_store.py.

Scoped Ruff lint and formatting, strict mypy, AST and byte preservation, whitespace and prose checks pass. No local tests ran. The corrected hosted JUnit artifact explicitly reports all 25 store cases passing, with no failures, errors or skips. Fresh independent whole-change source review reports no findings or nits. All 42 current checks and all three applicable workflows pass; all 41 underlying jobs are terminal and successful. Final publication remains subject to checks started when the draft becomes ready. External native framework execution remains unqualified.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: An agent wrote the change. The complete product diff, frozen tests, original method bodies and hosted failure summaries were checked before publication. Fresh independent source review has no findings or nits; all 25 hosted store cases pass.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Original tests and all regression inputs and assertions are preserved.
  • Hosted regressions demonstrate the retention failures.
  • The same regressions pass after the correction.
  • Fresh independent review has no unresolved findings.
  • All current required CI checks pass on the final head.
  • Commits are signed off.

@zlareb1 zlareb1 changed the title Exercise retained protection in the structural memory store Retain conversation protection across memory-store callbacks Nov 18, 2026
@zlareb1
zlareb1 marked this pull request as ready for review November 18, 2026 20:17
@zlareb1
zlareb1 merged commit 27e5749 into main Nov 18, 2026
42 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
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.

1 participant