singularity-forge/packages/pi-coding-agent
Tom Boucher 9dc6a6a97d fix: prevent LLM from confusing background task output with user input (#3069)
* fix: wrap custom messages with system notification prefix in LLM context

Background job completion notifications (delivered as custom messages via
sendMessage with deliverAs: "followUp") were converted to plain role: "user"
messages in convertToLlm(), making the LLM indistinguishable from actual
human input. This caused the agent to confuse background task output with
user messages, responding to job completions as if the user had typed them.

Wrap all custom messages with a clear system notification prefix that
includes the customType and an explicit instruction that the content is
an automated system event, not user input. This follows the same pattern
used by branchSummary and compactionSummary messages which already use
structured prefixes/suffixes.

Closes #3026

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolve TS import extension and type errors in messages test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 14:42:56 -06:00
..
scripts fix: handle Windows non-ASCII paths in cpSync with copyFileSync fallback (#1181) 2026-03-18 10:13:37 -06:00
src fix: prevent LLM from confusing background task output with user input (#3069) 2026-03-30 14:42:56 -06:00
package.json release: v2.58.0 2026-03-28 02:14:33 +00:00
tsconfig.json feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00