Skip to content

fix(security): bound the conversation memory and key bus turns by Lake's claim (LSR-076) - #71

Merged
homer6 merged 3 commits into
devfrom
fix/lsr-076-bounded-history
Nov 16, 2026
Merged

homer6 merged 3 commits into
devfrom
fix/lsr-076-bounded-history

Conversation

@homer6

@homer6 homer6 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What: The Application agent's conversation memory is bounded, and a bus turn's conversation belongs to the account and workspace Lake names, not to an id in the body.
Why: Finding LSR-076 (#34), with LSR-008 as the issue asks: the shared pod kept every conversation of every tenant forever, keyed only by the body's conversation_id. Part of the open-source release's security gate, https://github.com/oramasearch/orama-bridge/issues/273.
How: Ported agent-ask-orama's bounded Conversations (oramasearch/agent-ask-orama#48). Kept this agent's behaviour of continuing by conversation id and seeding from the history Lake sends, but scoped the key to Lake's claim.

Refs #34

Changes

  • src/agent_application/conversations.py: the bounded mapping (AGENT_CONVERSATIONS, AGENT_CONVERSATION_TURNS, AGENT_CONVERSATION_BYTES, AGENT_CONVERSATIONS_BYTES, AGENT_CONVERSATION_IDLE_SECONDS).
  • src/agent_application/service.py: State.history uses it; conversation_key keys a bus turn by (account, workspace, conversation_id) from the claim, a direct turn by ("direct", conversation_id); a turn that raises is rolled back.
  • src/agent_application/lake_bus.py: turn_body adds Lake's claim to the turn.
  • tests/test_conversations.py, README.md.

Not in this PR

  • Who may make a direct /v1/turn turn is the service token's question, the same as agent-runtime#14.

Proof

Not run: per Steve, 2026-11-14, tests run at review and release time, after the epic's work.

…e's claim (LSR-076, LSR-008)

Conversations live in conversations.Conversations, bounded by count, turns, bytes, total bytes and
idle time (ported from agent-ask-orama#48). A bus turn's conversation is kept under the account and
workspace of Lake's claim reply (lake_bus.turn_body), never under ids in the body; a direct turn is
kept apart. A turn that raises is rolled back. README and tests/test_conversations.py.

Refs #34
@homer6
homer6 force-pushed the fix/lsr-076-bounded-history branch from c18235b to 8b067cd Compare November 16, 2026 06:23
@homer6
homer6 merged commit e5a1c7f into dev Nov 16, 2026
@homer6
homer6 deleted the fix/lsr-076-bounded-history branch November 16, 2026 06:24
@homer6

homer6 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Merged into dev as a merge commit (e5a1c7f2) on Steve's review (2026-11-15). Low risk, on Steve's 2026-11-15 instruction to merge the low-risk PRs. Rebased onto dev; conflicts in (SBOM (SPDX README.md headers re-run) regenerated) were both-sides additions and keep both (Python compiles, TOML and JSON parse). Not built or tested in review (tests run at the release cut).

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