Filter candidate agent output at semantic message boundaries

When a candidate-facing agent view should show only the final answer, filter at semantic message completion using the provider's message-phase metadata; hiding tool cards or concatenating streaming deltas is insufficient because commentary and final answers may be separate agent-message items. This method applies when the app-server exposes completed-message phases. Buffer unknown/null phases and choose only the last message as an explicit compatibility case; retain a bounded last-item delta fallback for older servers. Preserve the complete raw event stream separately when audit or reviewer evidence is required.

Evidence/example — 2026-09-11: In the candidate-signal repository, the hosted candidate UI concatenated every agent-message delta and rendered command, search, and file activity beside it. The locally pinned Codex 0.153.4 app-server schema identifies completed agent messages as commentary, final_answer, or unknown/null. Buffering at turn scope and projecting one final answer fixed run-together interim/final copy; candidate-only rendering now omits activity cards while the protected raw trace remains intact. Provenance: local repository code and schema generated from the exact Dockerfile-pinned Codex version. Full test suite and production build passed before the compatibility refinements; targeted tests and typecheck passed after them.