Skip to content
This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/fixtures/codex_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ printf '%s\n' "$@" > "$fixture_dir/$mode.args"
printf '%s\n' "${GEN_AGENT_FIXTURE-unset}" > "$fixture_dir/$mode.env"

case "${*}" in
*typed-fail*)
fixture_mode=typed_failure
;;
*fail*)
fixture_mode=failure
;;
Expand All @@ -24,6 +27,11 @@ case "${*}" in
esac

case "$fixture_mode" in
typed_failure)
printf '%s\n' '{"type":"thread.started","thread_id":"fixture-thread"}'
printf '%s\n' '{"type":"turn.failed","error":{"code":"fixture_error","message":"typed fixture failure"}}'
;;

failure)
printf '%s\n' '{"type":"thread.started","thread_id":"fixture-thread"}'
printf '%s\n' '{"type":"turn.failed","error":"fixture failure"}'
Expand Down
9 changes: 9 additions & 0 deletions test/gen_agent/backends/codex_executable_conformance_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ defmodule GenAgent.Backends.CodexExecutableConformanceTest do
assert "fail" == List.last(args(context.directory, :fresh))
end

test "structured CLI failure reaches GenAgent without flattening its fields", context do
name = start_agent(context)

assert {:error, %{"code" => "fixture_error", "message" => "typed fixture failure"}} =
GenAgent.ask(name, "typed-fail")

assert [%{"code" => "fixture_error"}] = GenAgent.status(name).agent_state.errors
end

for action <- [:interrupt, :watchdog, :stop, :kill] do
@tag action: action
test "#{action} stops the BEAM task on the executable streaming path", context do
Expand Down
Loading