Awesome Reviewers

Reviewer · AI

Conversation context integrity

When building prompts around a shared conversation/message history for agents, debates, councils, or planners, guarantee that what the prompt text claims matches what is actually sent to the model, and that the history is correctly scoped per run.

Instruction

When building prompts around a shared conversation/message history for agents, debates, councils, or planners, guarantee that what the prompt text claims matches what is actually sent to the model, and that the history is correctly scoped per run.

Concretely:

  • Reset or re-scope any shared conversation/history object at the start of each run so a second invocation on the same instance cannot leak a prior task’s turns into the new one (e.g. recreate self.conversation in run(), don’t reuse it across calls).
  • Never permanently mutate caller-owned objects (e.g. an agent’s system_prompt) as a side effect of orchestration logic unless explicitly documented; restore the original state afterward or clearly document the mutation so callers know not to reuse that instance elsewhere.
  • Before wiring in a caller-supplied component (e.g. a custom director agent), check that it carries the instructions/context your orchestration depends on (roster, protocol, schema) — don’t assume defaults will be present just because a tool/schema was attached.
  • When a prompt says things like “the conversation above” or “the judge’s evaluation is in the conversation above,” ensure that content is guaranteed to be present at that call site. If messages_for (or equivalent) can return an empty or incomplete list, either assert non-empty context first or phrase the prompt so it degrades gracefully instead of causing the model to hallucinate missing turns.
  • When slicing or filtering message history before passing it to an agent, verify no required turns are dropped — especially the most recent turn/task the agent needs to act on. For example, prefer passing the full relevant history over patterns like split_last_turn that were designed for a different consumer (e.g. an aggregator that promotes the last turn into its own task), unless you also handle that promotion here.
  • Keep any transcript used to build model context and the persisted memory (e.g. short_memory) in sync; if a helper only writes to one, either mirror the write to both or make that asymmetry explicit in code/comments so downstream consumers (save/load, replay) are not silently missing data.

Example of the reset pattern to apply when run() can be called multiple times on one instance:

def run(self, task: str) -> Union[str, List, dict]:
    # Reset shared history so a second run() does not replay the
    # previous debate's turns into the new motion's context.
    self.conversation = Conversation()
    self._initialize_agents(task)
    ...