[codex] Surface runtime warnings in codex exec (#27415)

## Why

`codex exec` drops thread-scoped warning notifications. Warnings
discovered while a thread starts, including unreadable or invalid UTF-8
project `AGENTS.md` files, therefore become silent.

## What changed

- Process global and primary-thread warning notifications while
continuing to ignore warnings from unrelated threads.
- Render runtime warnings in human output and expose them through the
existing non-fatal error item in JSONL output.
- Add focused routing, rendering, and malformed project-instruction
coverage.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-11 11:01:16 -07:00
committed by GitHub
Unverified
parent cc97839068
commit 7fbbc9f033
6 changed files with 137 additions and 0 deletions
@@ -430,6 +430,11 @@ impl EventProcessorWithJsonOutput {
}));
CodexStatus::Running
}
ServerNotification::Warning(notification) => {
let warning = self.collect_warning(notification.message);
events.extend(warning.events);
warning.status
}
ServerNotification::Error(notification) => {
let message = match notification.error.additional_details {
Some(details) if !details.is_empty() => {