Skip to content

Conversation

@leoleoleo681
Copy link

Problem

In the current rollout pipeline, each worker process instantiates a single AgentFlowRollout and reuses the same Solver instance across many tasks. Since Solver holds a persistent Memory object, its internal state (especially actions and tool results) can persist across consecutive calls to Solver.solve() within the same worker.

This causes cross-task contamination: action steps and tool outputs from a previous sample may be mistakenly treated as context for the next sample, leading to unstable planning/verification behavior and incorrect final outputs.

Fix

This PR introduces an explicit reset API in Memory and ensures it is invoked at the start of each solve.

Add Memory.reset() to clear per-task state:

def reset(self):
self.query = None
self.files = []
self.actions = {}

Call self.memory.reset() at the beginning of Solver.solve() so every new task starts with a clean memory state:

Reset memory for new problem

self.memory.reset()

This enforces per-task isolation of memory while keeping the existing design (reusing Solver and other components within each worker process).

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