Tasks/Subagents with Codex / OpenAI are frequently getting stuck with no timeout/retry, which then hangs the session forever #8373

Open
opened 2026-02-16 18:09:48 -05:00 by yindo · 9 comments
Owner

Originally created by @dcominottim on GitHub (Feb 2, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I use OpenAI as provider with Codex 5.2 Xhigh as the model. My AGENTS.md has explicit instructions to make agents use Tasks/Subagents as often as possible. My subagents are frequently getting stuck (this time after a message talks about 'invalid session ID'), and then the session hangs forever because there is no automatic timeout/retry.

Plugins

None

OpenCode version

1.1.48

Steps to reproduce

  1. Just use Codex + OpenAI a lot with explicit instructions in AGENTS.md to use Tasks/Subagents liberally
  2. Eventually, a subagent gets stuck and the session hangs forever because apparently there is not timeout/retry

Screenshot and/or share link

Image

Operating System

Fedora 43 Silverblue

Terminal

GNOME Terminal (Ptyxis)

Originally created by @dcominottim on GitHub (Feb 2, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I use OpenAI as provider with Codex 5.2 Xhigh as the model. My AGENTS.md has explicit instructions to make agents use Tasks/Subagents as often as possible. My subagents are frequently getting stuck (this time after a message talks about 'invalid session ID'), and then the session hangs forever because there is no automatic timeout/retry. ### Plugins None ### OpenCode version 1.1.48 ### Steps to reproduce 1. Just use Codex + OpenAI a lot with explicit instructions in AGENTS.md to use Tasks/Subagents liberally 2. Eventually, a subagent gets stuck and the session hangs forever because apparently there is not timeout/retry ### Screenshot and/or share link <img width="1585" height="1126" alt="Image" src="https://github.com/user-attachments/assets/56f788af-29e0-425d-91d4-b0adaa147419" /> ### Operating System Fedora 43 Silverblue ### Terminal GNOME Terminal (Ptyxis)
yindo added the bug label 2026-02-16 18:09:48 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6792: Task Tool Timeouts & Early Termination in Multi-Agent Conductor Pattern - describes subagents failing after ~60s with only session_id returned, similar stuck behavior with timeouts
  • #10802: TUI: Parent session appears stuck "loading" when subagent is blocked - describes parent sessions appearing to hang when subagents are blocked or waiting
  • #9003: Main agent hangs because of subagent (explore) - describes sessions hanging when subagent completes work but doesn't return to parent
  • #3950: Configurable command timeout in config.json - requests ability to configure timeout duration for long-running operations
  • #5888: Opencode Hangs when used as CLI tool - describes hanging behavior with unclear debug information

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 2, 2026): This issue might be a duplicate of existing issues. Please check: - #6792: Task Tool Timeouts & Early Termination in Multi-Agent Conductor Pattern - describes subagents failing after ~60s with only session_id returned, similar stuck behavior with timeouts - #10802: TUI: Parent session appears stuck "loading" when subagent is blocked - describes parent sessions appearing to hang when subagents are blocked or waiting - #9003: Main agent hangs because of subagent (explore) - describes sessions hanging when subagent completes work but doesn't return to parent - #3950: Configurable command timeout in config.json - requests ability to configure timeout duration for long-running operations - #5888: Opencode Hangs when used as CLI tool - describes hanging behavior with unclear debug information Feel free to ignore if none of these address your specific case.
Author
Owner

@dcominottim commented on GitHub (Feb 2, 2026):

Doesn't seem to be a duplicate.

@dcominottim commented on GitHub (Feb 2, 2026): Doesn't seem to be a duplicate.
Author
Owner

@victorhramos-dev commented on GitHub (Feb 4, 2026):

same here with another models (minimax and glm) API stops do respond and the session is stuck forever

@victorhramos-dev commented on GitHub (Feb 4, 2026): same here with another models (minimax and glm) API stops do respond and the session is stuck forever
Author
Owner

@R44VC0RP commented on GitHub (Feb 4, 2026):

Is this still persisting in 1.1.51 @dcominottim & @victorhramos-dev

@R44VC0RP commented on GitHub (Feb 4, 2026): Is this still persisting in 1.1.51 @dcominottim & @victorhramos-dev
Author
Owner

@victorhramos-dev commented on GitHub (Feb 4, 2026):

Is this still persisting in 1.1.51 @dcominottim & @victorhramos-dev

Yes, its just stuck without any response from provider api like in the middle of thinking sometimes

@victorhramos-dev commented on GitHub (Feb 4, 2026): > Is this still persisting in 1.1.51 [@dcominottim](https://github.com/dcominottim) & [@victorhramos-dev](https://github.com/victorhramos-dev) Yes, its just stuck without any response from provider api like in the middle of thinking sometimes
Author
Owner

@miguelmanlyx commented on GitHub (Feb 5, 2026):

try npx ai-patch doctor

It will check opencode for ai issues

@dcominottim

@miguelmanlyx commented on GitHub (Feb 5, 2026): try npx ai-patch doctor It will check opencode for ai issues @dcominottim
Author
Owner

@rekram1-node commented on GitHub (Feb 5, 2026):

Are you sure it's actually stuck? I think it's just because if u click the subagent session there isn't any loading indicator.

I've never managed to replicate an actual stuck case but if you are using high/xhigh know that the reasoning the model does can take a long time AND we can only show the thinking summaries so there is even more latency because of that

@rekram1-node commented on GitHub (Feb 5, 2026): Are you sure it's actually stuck? I think it's just because if u click the subagent session there isn't any loading indicator. I've never managed to replicate an actual stuck case but if you are using high/xhigh know that the reasoning the model does can take a long time AND we can only show the thinking summaries so there is even more latency because of that
Author
Owner

@dcominottim commented on GitHub (Feb 9, 2026):

Are you sure it's actually stuck? I think it's just because if u click the subagent session there isn't any loading indicator.

I've never managed to replicate an actual stuck case but if you are using high/xhigh know that the reasoning the model does can take a long time AND we can only show the thinking summaries so there is even more latency because of that

Not totally sure because I haven't used opencode + Codex much in the last week, but I awaited >20 minutes and nothing else got updated in the main screen or subagent sections before I submitted the bug report. A visual indicator could be an interesting feedback mechanism.

@dcominottim commented on GitHub (Feb 9, 2026): > Are you sure it's actually stuck? I think it's just because if u click the subagent session there isn't any loading indicator. > > I've never managed to replicate an actual stuck case but if you are using high/xhigh know that the reasoning the model does can take a long time AND we can only show the thinking summaries so there is even more latency because of that Not totally sure because I haven't used opencode + Codex much in the last week, but I awaited >20 minutes and nothing else got updated in the main screen or subagent sections before I submitted the bug report. A visual indicator could be an interesting feedback mechanism.
Author
Owner

@the0rem commented on GitHub (Feb 14, 2026):

I can confirm this issue but I'm unsure how to get any debug information? The system prompt is sent to the subagent and then it just hangs for gpt-5.3-codex. I've tried all of the openai connection options with no success. This is a recent issue (in the past week) and it was working well before hand. I've had to move to using Opus for the time being but would love to not be using the Claude usage budget for codex's workload.

@the0rem commented on GitHub (Feb 14, 2026): I can confirm this issue but I'm unsure how to get any debug information? The system prompt is sent to the subagent and then it just hangs for gpt-5.3-codex. I've tried all of the openai connection options with no success. This is a recent issue (in the past week) and it was working well before hand. I've had to move to using Opus for the time being but would love to not be using the Claude usage budget for codex's workload.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8373