fix(daemon-client): name the Codex sandbox fix in the loopback-denied hint

Merged
TH
1d ago
+117-40

Summary

Codex’s macOS sandbox can deny localhost access. The generic hint left agents to figure out how to retry. Both denial reasons now use the captured client environment to select a Codex hint when CODEX_SANDBOX is nonempty. The hint explains standalone calls, the permanent allow rule, and one-time escalation. The rules path follows CODEX_HOME when set. The generic hint and lifecycle behavior are unchanged.

Before / after

  • codex sandbox -- node bin/agent-device.mjs devices --state-dir <temp> previously suggested generic host access. It now prints the Codex rule, standalone retry instructions, and full setup URL on both a denied listen and a denied connect to a running daemon.
  • The same CLI call on the host exited 0 and listed 17 devices.

Validation

  • Head 2d7f5639ff84f28a6d35abcbf3f520c05ec09c46: oxlint passed on the resolver file after a doc comment edit.
  • At 830c6c52be, 30 tests passed across the two focused files.
  • At fc1a4a3bec, frozen install and build passed, reason regeneration produced no diff, and the live checks below passed.
  • Codex 0.172.0 exposed CODEX_SANDBOX=seatbelt in the sandbox. With a temporary CODEX_HOME and an explicit /usr/bin/env allow rule, Luna low ran it standalone and CODEX_SANDBOX was absent.
  • Luna medium, workspace-write, and a temporary rule for the built CLI path. In 3/3 final runs, cd … && agent-device devices printed the new hint and the very next call ran agent-device standalone and exited 0.
  • Test daemons stopped and temporary files removed. Repository-wide validation is pending in CI.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.