mirror of
https://github.com/earendil-works/pi.git
synced 2026-10-30 07:35:24 +08:00
Remove SystemMessage.replace. A prompt forced from before_agent_start is a rendering of the current prompt for the run, not conversation state: persisting it as a replacing system message wrote the full prompt and tool list on every change, lost the structured sections while forced, and disabled mid-conversation system messages for the rest of the session once a replacement existed. The transcript now always records section patches. AgentSession wraps transformContext and, when a forced prompt is active, collapses the system messages into one head carrying the forced text and the current tools. Providers receive the same request as before; nothing is persisted and the projection ends with the run. The evals harness validated the without_docs variant from the transcript, which relied on the persisted replacement. Its transform extension now records the prompt it forced and validates that instead.