codex cloud list --json hides missing cloud environments as an empty task list

Resolved 💬 1 comment Opened Mar 23, 2026 by aquiles-ai123 Closed Mar 23, 2026

codex cloud list --json returns an empty task set even when no cloud environments are available for the workspace

Summary

In a workspace with no available Codex Cloud environments:

  • codex cloud list --json --limit 5 exits 0 and returns an empty task list
  • but codex cloud exec --env global ... fails with no cloud environments are available for this workspace

So cloud list presents the state as "there are zero tasks" instead of "Cloud is unavailable for this workspace because there are no environments".

That is misleading for automation and users because an empty dataset looks like a healthy query result.

Repro

List tasks in JSON mode:

codex cloud list --json --limit 5 > /tmp/codex_cloud_list_empty.json
printf "outer_exit=%s\n" "$?"
cat /tmp/codex_cloud_list_empty.json

Observed:

outer_exit=0
{
  "tasks": [],
  "cursor": null
}

Now try to create a cloud task in the same workspace:

codex cloud exec --env global "noop" > /tmp/codex_cloud_exec_noenv.txt 2>&1
printf "outer_exit=%s\n" "$?"
cat /tmp/codex_cloud_exec_noenv.txt

Observed:

outer_exit=1
Error: no cloud environments are available for this workspace

Expected behavior

If the workspace has no available cloud environments, codex cloud list should surface that state explicitly instead of looking like a successful empty task query.

For example, it could:

  • fail with a clear nonzero error
  • or include explicit environment-availability metadata in JSON output

Actual behavior

codex cloud list --json succeeds with an empty list, even though codex cloud exec in the same workspace cannot run because no cloud environments exist.

Why this matters

This masks a configuration/availability problem as a normal empty result set, which is bad for scripts, automation, and operator debugging.

Files / artifacts

  • /tmp/codex_cloud_list_empty.json
  • /tmp/codex_cloud_exec_noenv.txt

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗