Skip to content

Main thread kills subagents too eagerly #12844

Closed

Description

@smileBeda

What version of Codex CLI is running?

0.105.0

What subscription do you have?

PRO

Which model were you using?

gpt-5.3-codex xhigh

What platform is your computer?

Mac

What terminal emulator and version are you using (if applicable)?

terminal

What issue are you seeing?

I see it to often that main thread polls for subagent status, says "it is still working, I am prepping a fix anyway in case it hangs" and then later kills the subagent, only to find half-edited files that the subagent was editing.

What steps can reproduce the bug?

Not sure, I use subagents, they work, but sometimes they take time, and main thread, in his eagerness to be fast, kills them

What is the expected behavior?

NO killing of subagents!

Additional information

Image Example that is really detrimental: - wasted a ton of tokens - then killed subagent - realized stuff is now broken since it had still work to do the subagent - had to redo all that work again and fix it up

Activity

  1. added
    agentIssues related to the core agent loop
    and removed
    CLIIssues related to the Codex CLI
    on Feb 26, 2026
  2. jif-oai commented on Feb 26, 2026

    @jif-oai
    Contributor

    This is a model behaviour problem. This will get solved over time but I can't have a direct fix for this

  3. smileBeda commented on Feb 26, 2026

    @smileBeda
    Author

    @jif-oai to understand this right - the model counts the time and the model decides the timeout limits?

    I’ve a hard time understanding this. It’s capable of estimating what a timeout should be and even keep track of it? There’s no setting I can tweak to say „max timeout Subagent == xxx seconds“?

  4. jif-oai commented on Feb 26, 2026

    @jif-oai
    Contributor

    Yes indeed the model is supposed to estimate. And here the issue is mainly the problem becoming impatient. I'll try to tune a bit the prompt to make it more patient for now

  5. jif-oai commented on Feb 26, 2026

    @jif-oai
    Contributor

    Btw your screenshot shows an UX older than 0.105.0. Are you sure of your version?

  6. smileBeda commented on Feb 26, 2026

    @smileBeda
    Author

    Duh, you are right - I was still on 104. Now on 105!

    ... about that timeout... I think it might be very good to add a deterministic control that globally applies, something like the background_terminal_max_timeout - but for subagents. Just basically as a fallback so the main thread can decide "ok, while I consider it too long now, the user said it is OK to wait N seconds, so I will poll again.

    Not sure if that makes sense to you?

  7. jif-oai commented on Feb 27, 2026

    @jif-oai
    Contributor

    It make sense. That's a good idea but we need to make sure the model understand it correctly. I'll build something for this

  8. added
    subagentIssues involving subagents or multi-agent features
    and removed
    agentIssues related to the core agent loop
    on Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsubagentIssues involving subagents or multi-agent features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions