Codex Desktop collapses a completed answer after blocking Stop-hook feedback

Open 💬 0 comments Opened Jul 20, 2026 by dctmfoo

What version of the Codex App are you using (From “About Codex” dialog)?

26.715.52143 (5591)

What subscription do you have?

Pro 20x

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

A blocking Stop hook runs after the model has already written a complete answer. When the hook returns feedback and requests continuation, Codex Desktop moves the already-written answer into the collapsed Worked for {N} section.

The only expanded content is then the hook feedback card and the agent's follow-up about satisfying the hook. The substantive answer to the user's original question is hidden until the user manually expands Worked for 3m 10s.

This makes a successful answer appear to be missing and turns a lifecycle guardrail into a destructive presentation change.

Observed sequence:

  1. Agent finishes the requested work and writes its answer.
  2. The Stop hook fires and exits nonzero with feedback on stderr.
  3. Codex renders a "Hook feedback" card and continues the model turn.
  4. The entire earlier answer is folded into Worked for 3m 10s.
  5. Only the hook-remediation response remains visible outside the collapsed section.

Feedback ID: 019f8149-579b-77c0-beac-0f972ed6fd5a

What steps can reproduce the bug?

  1. Configure a blocking Stop hook in .codex/hooks.json:
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/absolute/path/to/stop-hook.sh"
          }
        ]
      }
    ]
  }
}
  1. Use a minimal hook that returns feedback once:
#!/bin/sh
if [ ! -f /tmp/codex-stop-hook-once ]; then
  touch /tmp/codex-stop-hook-once
  echo "STOP REMINDER: perform the required final check before finishing." >&2
  exit 2
fi
printf '{}\n'
exit 0
  1. Ask Codex Desktop a question that produces a multi-paragraph answer.
  2. Wait for the agent to finish its first answer.
  3. Observe the Stop hook feedback and continuation.
  4. After the turn ends, observe that the first complete answer is accessible only by expanding Worked for {N}.

The production example used a journal-freshness Stop hook. It emitted:

SESSION-JOURNAL-REMINDER (DETAILED mode): ... Update milestones, files, current state, next step, and Last updated ...

The screenshot associated with the Feedback ID shows the original answer hidden behind Worked for 3m 10s, while the hook card and hook-remediation response remain expanded.

What is the expected behavior?

Treat Stop as a pre-finalization gate in the UI.

When the model proposes stopping:

  1. Run the Stop hook before the app finalizes/collapses the candidate answer.
  2. If the hook requests continuation, keep the already-written assistant response visible as a normal expanded response.
  3. Render hook feedback separately and let the agent continue below it.
  4. Do not reclassify a completed user-facing answer as hidden work merely because a Stop hook requested a follow-up.

This should match the practical Claude Code UX: hook enforcement can continue the agent loop without hiding the response the agent already wrote.

At minimum, every assistant-authored user-facing response should remain expanded by default even when a later Stop-hook continuation occurs.

Additional information

There is no documented configuration to control this rendering. The current Codex hooks manual documents Stop as a turn-scoped continuation hook, and documents suppressOutput as parsed but not implemented.

Related but not duplicate:

  • #23221 reports responses sometimes being fully nested inside collapsed Worked for {N} sections, but does not identify Stop-hook continuation as the trigger.
  • #23319 concerns completed Stop-hook detail visibility, not the loss of visibility of the preceding assistant answer.

CLI version available locally: codex-cli 0.133.0.

View original on GitHub ↗