Skip to content

test: assert interaction sequence ordering in consecutive message tests #772

@BlueHotDog

Description

@BlueHotDog

Context

The consecutive message tests verify interaction counts (e.g., length(agent_responses) == 2) but don't assert that interactions are in correct sequence order. A broken sequence generator could produce valid counts but corrupt LLM conversation history.

Missing Invariant

Interactions must be monotonically ordered by sequence. Specifically:

  • UserMessage1.sequence < AgentResponse1.sequence < AgentCompleted1.sequence < UserMessage2.sequence < AgentResponse2.sequence < AgentCompleted2.sequence
  • For tool call flows: ToolCall.sequence < ToolResult.sequence

Proposed Enhancement

In the existing consecutive message tests, add assertions that:

  1. All interaction sequences are strictly increasing
  2. Each message type appears in the expected position relative to others

File

apps/frontman_server/test/frontman_server/tasks/execution_test.exs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions