Skip to content

bug: AgentExecutionBlocked produces no output in non-interactive STREAM_JSON mode #20859

@SUNDRAM07

Description

@SUNDRAM07

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

Metadata

Metadata

Assignees

Labels

area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationstatus/need-triageIssues that need to be triaged by the triage automation.type/bug

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions