Observed from sd-coder persistent agent error notifications (Apr 15): OpenAI/Codex Responses API returns HTTP 400 invalid_request_error with param input[2].content[0], message: Invalid value 'input_text'. Supported values are 'output_text' and 'refusal'. Root cause appears in Omni/Agent/Provider.hs codexMessage helper, which always emits content blocks with type=input_text even for assistant role messages. In multi-turn sessions this sends prior assistant messages in an unsupported shape. Need adjust codex message encoding by role to match current Responses API schema and add regression test for assistant-history roundtrip.
Implemented fix in Omni/Agent/Provider.hs for Codex Responses payload role encoding.
1) Codex user messages encode content as input_text 2) Codex assistant messages encode content as output_text
Verification run:
Committed fix as dc5f8805: fix(agent): encode codex assistant history as output_text.
Post-commit rollout actions:
Omni/Ide/ship.sh Omni/Agent.hs.Service 'agent' not found in manifest.agentd restart sd-coder --mode persistent (service is active/running with new MainPID).Verification of resume:
agentd send accepted the replay message. rg -n t-791|SD acceptance|acceptance rate|A100|idle experiment|experiment nodes|scale down|task t-791 ...
under the new sd-coder process, confirming it resumed task execution after restart.
Implemented fix in Omni/Agent/Provider.hs for Codex Responses payload role encoding. now uses role-aware content type ( -> , all others -> ) via , preventing API 400 invalid_value on assistant history (). Added regression tests: (1) user messages encode ; (2) assistant messages encode . Verification: warn: repl: ghci does not support binding to a port [1 of 5] Compiling Alpha ( Alpha.hs, nothing ) [2 of 5] Compiling Omni.Agent.Paths ( Omni/Agent/Paths.hs, nothing ) [3 of 5] Compiling Omni.Agent.Models ( Omni/Agent/Models.hs, nothing ) [4 of 5] Compiling Omni.Test ( Omni/Test.hs, nothing ) [5 of 5] Compiling Omni.Agent.Provider ( Omni/Agent/Provider.hs, nothing ), 7[10000;10000H (all 21 tests passed), and .