pi fix: sendCustomMessage with triggerTurn: false no longer starts a new turn
External contributor cristinaponcela merged pull request #8022 into the pi coding agent on August 12, 2026, fixing an extension-point bug surfaced in issue #7783. The bug: when an agent_end extension handler called sendCustomMessage({triggerTurn: false}) while the agent was still flagged as streaming, the message would still trigger a new model turn — directly violating the documented triggerTurn: false contract that third-party extensions rely on.
The root cause was a path-overload in packages/coding-agent/src/core/agent-session.ts: every message, regardless of the triggerTurn flag, was routed through the streaming agent.steer() path while isStreaming was still true. The fix gates that branch on options?.triggerTurn !== false, so the message is now treated as a no-op turn-init when the caller asked for one. The merge commit is 47b5119d09f00cb785409d53d74c4950acc7d803.
For extension authors, this means agent_end handlers can now safely call sendCustomMessage({triggerTurn: false}) to inject a system message — for example, to log session metrics, append a footer, or stamp an audit trail — without unintentionally kicking off another model turn that costs tokens and time. The author verified the fix by rerunning the reproduction test from issue #7783, with two checks passing on the resulting patch.
No public release has shipped the change yet; users running v0.84.1 still see the pre-fix behavior until the next pi release that includes it.