Repository navigation
Conversation
This comment was marked as spam.
This comment was marked as spam.
|
We've been running this patch against v2026.3.11 and hit an edge case worth flagging. Issue: Concrete flow:
Our fix: don't reset these flags in |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
Bu the way, I was trying to make this work, but I couldn't. The thinking is still leaking through, despite various other attempts to patch this and change config. Trying #19932 now. This si on mattermost btw |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
onBlockReplyandonPartialReplycurrentMessageHadToolCallsflag set attool_execution_start, reset atmessage_start. Suppresses streaming block reply delivery (emitBlockChunk,onPartialReply) andhandleMessageEndblock replies for intermediate messages. A companioncurrentMessageUsedMessagingToolflag preserves the existing messaging-tool dedup/error-fallback pathassistantTextsrecording (text is still captured for final payload assembly),onBlockReplyFlushtiming,emitAgentEventemissions, the final message in a turn (no tool calls, flag reset atmessage_start)Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Messaging channel users no longer receive intermediate text from multi-step agentic turns. Only the final response (the message without tool calls) is delivered.
Security Impact (required)
Repro + Verification
Environment
onBlockReplySteps
Expected
Actual
Evidence
All 129
pi-embedded-subscribetests pass. The two tests that exercised the affected paths were updated:calls-onblockreplyflush-before-tool-execution-start-preserve.test.ts: updated to expectonBlockReplynot called for buffered text flushed before tool execution (text is still recorded inassistantTexts)suppresses-message-end-block-replies-message-tool.test.ts: passes unchanged, confirming the messaging-tool error fallback path still worksHuman Verification (required)
pi-embedded-subscribetest suite (129 tests, 27 files),pnpm checkpasses cleanonBlockReplystill fires when messaging tool errors),onBlockReplyFlushcallback still fires regardless of suppression,assistantTextsrecording preserved for final payload assembly,text_endandmessage_endblock reply break modes both handledsubscribeEmbeddedPiSessioncode path used by live Slack/iMessage/Discord integrations, confirming intermediate text is suppressed and final replies are deliveredCompatibility / Migration
Failure Recovery (if this breaks)
pi-embedded-subscribe.ts,pi-embedded-subscribe.handlers.messages.ts,pi-embedded-subscribe.handlers.tools.ts,pi-embedded-subscribe.handlers.types.tsmessage_start), messaging tool error fallback not delivering (would indicatecurrentMessageUsedMessagingToolnot being set)Risks and Mitigations
text_endmode may still leak iftext_endfires beforetool_execution_startmessage_end. A<final>tag approach could address this but is out of scope.