What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.415.40636 (1799)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.4.0 arm64 arm
What issue are you seeing?
I am using Codex CLI/App with Unity Editor. I wrote a custom Unity AI Agent Connector that enables Codex to behave appropriately in a Unity environment, especially in an AI-agentic loop. During agent work, I need to show in the UnityEditor that the task is in progress and its status, and block any user input to prevent interference with the agent work.
For that, I am utilizing 2 hooks: UserPromptSubmit and Stop.
It worked great until the recent CodexApp update that added ambient suggestions feature. It looks like they run after any thread is done and/or archived, and call the UserPromptSubmit hook without Stop at the end. That led to infinite "In progress" task in the Unity Editor
Here is how it looks in the Unity Editor:

My hooks.json:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "/bin/sh -lc 'dir=\"$PWD\"; while :; do script=\"$dir/.codex/hooks/unity-ai-agent-connector/user_prompt_submit.py\"; if [ -f \"$script\" ]; then exec /usr/bin/python3 \"$script\"; fi; parent=$(dirname \"$dir\"); if [ \"$parent\" = \"$dir\" ]; then printf \"%s\\n\" \"Managed Codex hook script not found: /.codex/hooks/unity-ai-agent-connector/user_prompt_submit.py\" >&2; exit 127; fi; dir=\"$parent\"; done'",
"timeout": 610,
"statusMessage": "Starting Unity task"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "/bin/sh -lc 'dir=\"$PWD\"; while :; do script=\"$dir/.codex/hooks/unity-ai-agent-connector/stop.py\"; if [ -f \"$script\" ]; then exec /usr/bin/python3 \"$script\"; fi; parent=$(dirname \"$dir\"); if [ \"$parent\" = \"$dir\" ]; then printf \"%s\\n\" \"Managed Codex hook script not found: /.codex/hooks/unity-ai-agent-connector/stop.py\" >&2; exit 127; fi; dir=\"$parent\"; done'",
"timeout": 610,
"statusMessage": "Ending Unity task"
}
]
}
]
}
}
A few thoughts on how that might be fixed:
- Being able to activate/deactivate Ambients Suggestions feature on the project level (Codex App settings,
config.toml, etc)
— [I doubt you do that, cause it really has a product value]
- Don't run hooks for Ambient Suggestion feature
— [still not the best solution]
- Fix running
Stop hooks
— [will be a workaround, cause it is still not obvious why should I wait for something CodexApp is doing in the background]
- Being able to control which hook should be run during Ambient Suggestion. In the
hooks.json set something like runWithAmbientSuggestions for each hook (with true by default)
Severity:
This thing is really annoying. Thankfully, my connector has a Force End feature, which is a workaround for now
What steps can reproduce the bug?
Already explained in the What issue are you seeing? field
What is the expected behavior?
Already explained in the What issue are you seeing? field
Additional information
No response
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.415.40636 (1799)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.4.0 arm64 arm
What issue are you seeing?
I am using Codex CLI/App with Unity Editor. I wrote a custom Unity AI Agent Connector that enables Codex to behave appropriately in a Unity environment, especially in an AI-agentic loop. During agent work, I need to show in the UnityEditor that the task is in progress and its status, and block any user input to prevent interference with the agent work.
For that, I am utilizing 2 hooks:
UserPromptSubmitandStop.It worked great until the recent CodexApp update that added ambient suggestions feature. It looks like they run after any thread is done and/or archived, and call the
UserPromptSubmithook withoutStopat the end. That led to infinite "In progress" task in the Unity EditorHere is how it looks in the Unity Editor:

My
hooks.json:{ "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command", "command": "/bin/sh -lc 'dir=\"$PWD\"; while :; do script=\"$dir/.codex/hooks/unity-ai-agent-connector/user_prompt_submit.py\"; if [ -f \"$script\" ]; then exec /usr/bin/python3 \"$script\"; fi; parent=$(dirname \"$dir\"); if [ \"$parent\" = \"$dir\" ]; then printf \"%s\\n\" \"Managed Codex hook script not found: /.codex/hooks/unity-ai-agent-connector/user_prompt_submit.py\" >&2; exit 127; fi; dir=\"$parent\"; done'", "timeout": 610, "statusMessage": "Starting Unity task" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "/bin/sh -lc 'dir=\"$PWD\"; while :; do script=\"$dir/.codex/hooks/unity-ai-agent-connector/stop.py\"; if [ -f \"$script\" ]; then exec /usr/bin/python3 \"$script\"; fi; parent=$(dirname \"$dir\"); if [ \"$parent\" = \"$dir\" ]; then printf \"%s\\n\" \"Managed Codex hook script not found: /.codex/hooks/unity-ai-agent-connector/stop.py\" >&2; exit 127; fi; dir=\"$parent\"; done'", "timeout": 610, "statusMessage": "Ending Unity task" } ] } ] } }A few thoughts on how that might be fixed:
config.toml, etc)— [I doubt you do that, cause it really has a product value]
— [still not the best solution]
Stophooks— [will be a workaround, cause it is still not obvious why should I wait for something CodexApp is doing in the background]
hooks.jsonset something likerunWithAmbientSuggestionsfor each hook (withtrueby default)Severity:
This thing is really annoying. Thankfully, my connector has a
Force Endfeature, which is a workaround for nowWhat steps can reproduce the bug?
Already explained in the
What issue are you seeing?fieldWhat is the expected behavior?
Already explained in the
What issue are you seeing?fieldAdditional information
No response