fix(reflection): hand the distiller instructions to the embedded runner as extraSystemPrompt - #1001
gorkem2020 wants to merge 1 commit into
Conversation
…er as extraSystemPrompt The reflection distiller already builds a system/user prompt pair, but the embedded runner received both halves concatenated into one user prompt, so on current hosts the model saw the distiller identity and the section rules as user text while the host's own minimal system prompt stood alone. The completion fallback kept the split. Pass the instructions as extraSystemPrompt and only the transcript as prompt. The host appends extraSystemPrompt to its minimal system prompt under a "Subagent Context" header; prompt mode none would drop it, so the explicit minimal mode stays. The prompt hash still covers both halves. Tests: two regression cases on the runner harness (new and legacy runner names) assert the split; both fail on the previous code.
|
Closing after the live check on our fleet: moving the distiller instructions under the host's system prompt does not give the distiller a system prompt of its own, it gives the host's agent persona the last word. With The completion fallback already receives a real system/user split through the plugin LLM lane, so a true split for the primary path would mean making that lane the primary transport, which is a design change rather than a fix. Leaving this closed; the branch stays on the fork for reference. |
Summary
The reflection distiller builds a system/user prompt pair (
buildReflectionPromptreturns{ system, user }), but the embedded runner call concatenated both halves into a singleprompt. On current hosts the model therefore received the distiller identity and the section rules as user text, while the host's own minimal system prompt stood alone. The completion fallback already kept the split (completeText(system, user)), so the two runner paths disagreed on prompt shape.This change passes the instructions as
extraSystemPromptand only the transcript asprompton both runner names (runEmbeddedAgent, legacyrunEmbeddedPiAgent). The host appendsextraSystemPromptto its minimal system prompt under a "Subagent Context" header; prompt modenonereturns before that block, so the explicitminimalmode stays. The prompt hash still covers both halves, so dedup keys do not move.Tests
test/reflection-runner-embedded-agent.test.mjs: two regression cases (new and legacy runner names) assert thatextraSystemPromptopens with the distiller identity, the user prompt carries the transcript, and neither the identity nor the section rules appear in the user prompt. Both fail on the previous code.Compatibility
No config, schema or manifest change. Hosts that ignore
extraSystemPromptkeep the previous behaviour for the system half only; the transcript still arrives as the prompt.