Bug Description
In non-interactive mode, the AgentExecutionBlocked event handler in nonInteractiveCli.ts only outputs a warning in TEXT format. Programmatic consumers using STREAM_JSON receive no notification when the agent is blocked by a safety filter or policy.
Current behavior
| Output Format |
AgentExecutionBlocked Output |
| TEXT |
✅ [WARNING] Agent execution blocked: ... written to stderr |
| STREAM_JSON |
❌ Silently swallowed — no event emitted |
| JSON |
❌ Silently swallowed |
Expected behavior
STREAM_JSON should emit a JsonStreamEventType.ERROR event with severity: 'warning' — the same pattern used by LoopDetected and other diagnostic events.
Affected file
packages/cli/src/nonInteractiveCli.ts — lines 387-392
Bug Description
In non-interactive mode, the
AgentExecutionBlockedevent handler innonInteractiveCli.tsonly outputs a warning in TEXT format. Programmatic consumers using STREAM_JSON receive no notification when the agent is blocked by a safety filter or policy.Current behavior
AgentExecutionBlockedOutput[WARNING] Agent execution blocked: ...written to stderrExpected behavior
STREAM_JSON should emit a
JsonStreamEventType.ERRORevent withseverity: 'warning'— the same pattern used byLoopDetectedand other diagnostic events.Affected file
packages/cli/src/nonInteractiveCli.ts— lines 387-392