Awesome Reviewers

Reviewer · AI

LLM context completeness

When building prompts or message histories for LLM agents, verify that any context a prompt references is guaranteed to actually be present and correctly positioned in the payload sent to the model. Don't couple prompt wording to implementation details that live elsewhere and can silently drift.

Instruction

When building prompts or message histories for LLM agents, verify that any context a prompt references is guaranteed to actually be present and correctly positioned in the payload sent to the model. Don’t couple prompt wording to implementation details that live elsewhere and can silently drift.

Specifically:

  • If a prompt says “read the conversation above” or “synthesize the responses above,” confirm (and ideally assert) that the referenced turns are non-empty and actually precede that text in the final payload. Prefer order-neutral phrasing (e.g., “using the prior conversation”) over phrasing that depends on message ordering/concatenation logic defined in another file, since that logic can change independently of the prompt.
  • When an agent is given a tool or capability (e.g., a director agent with a hierarchical dispatch tool), also give it the matching instructions/protocol. Attaching a schema without the corresponding prompt text leads the model to invent invalid values (e.g., non-existent worker names).
  • In multi-agent/orchestration code (round robin, mixture of agents, hierarchical swarms), double-check that context-passing helpers (e.g., messages_for, split_last_turn) are not dropping the most recent turn or other required context when reused from a different class with different semantics. Add a test that inspects the actual messages passed to each agent call, not just that the call happened.
  • Keep any user-visible/model-visible content (short_memory, transcript, persisted conversation) consistent — if a note or message is injected into the prompt sent to the model, it must also be persisted to the same memory store other consumers rely on (e.g., save/load), rather than appended only to a transient list.

Example of a safer, order-neutral instruction:

planner_task = (
    "Using the prior conversation (if any), create a comprehensive plan "
    "for the user's prompt. If no prior conversation is available, "
    "create the plan from the prompt alone."
)

Add regression tests that assert on the actual messages list/content passed into each agent call (e.g., “does the second agent see the original task and the first agent’s output?”) rather than only asserting that a call occurred.