A command Codex leaves running after its turn was invisible to the task, so the idle release stopped the app-server and the command kept running in its own process group. The Codex adapter now lists background terminals (thread/backgroundTerminals/list) after each turn until none runs and reports them as background tasks, which the idle release waits for; stop_task maps to terminate; session close and connection close run clean first. Older Codex versions report none.
Fixes#7655