Anonymous View
Skip to content

MessageDocument and LlmMessageDocument have near-identical APIs and are confusable #189

Description

@jakobklippel

Context

MessageDocument (from @loopstack/common) and LlmMessageDocument (from @loopstack/llm-provider-module) both expose { role, content }. Both render as chat bubbles in Studio. The semantic distinction — one is for UI; the other doubles as LLM conversation history via messagesSearchTag — is real but invisible from the names or APIs. Builders confuse them and either get unexpected behaviour (history collected when not wanted, or not collected when it is) or waste cycles deciding which one to use.

What to do

Decide how to make the distinction unambiguous, then carry the decision through across @loopstack/common, @loopstack/llm-provider-module, every doc page that mentions either class, and the example workflows in registry/examples/*.

Affected area

  • Package(s): @loopstack/common, @loopstack/llm-provider-module, all packages that save chat messages

Acceptance criteria

  • Decision recorded on how the two classes relate.
  • Implementation in @loopstack/common and @loopstack/llm-provider-module aligned with the decision.
  • Public docs updated.
  • Registry examples updated to consistently follow the new guidance.

Additional context

Surfaced during a benchmark agent session where the agent oscillated between the two classes while debugging a "summary not visible" symptom that turned out to be unrelated. The confusion cost real iteration time.

Metadata

Metadata

Assignees

Labels

priority:p2Medium prioritytaskGeneral task / chore

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions