mirror of
https://github.com/earendil-works/pi.git
synced 2026-09-28 14:13:13 +08:00
Since 0.86 the prompt and tool declarations live in transcript system messages, so a context handler that filters or slices messages could drop them. After extension-driven compaction this sent requests without built-in tools and made Codex emit raw tool-call text. context handlers now see the conversation only. An unchanged list keeps the transcript as is; a changed list gets the replayed prompt sections and tool declarations as one leading system message. Handler-added system messages are kept after it. Add context_with_system, which runs after every context handler on the full transcript and sends its result verbatim, for extensions that need to edit system messages per request. Dropping the leading system message is reported as an extension error. closes #9789, closes #9822