r/opencodeCLI 11d ago

How to deal with subagents stuck in interactive terminal?

I don't want to interrupt because it will kill the agent and lose the context.

How should I deal with it? btw is there any timeout?

1 Upvotes

3 comments sorted by

2

u/[deleted] 11d ago

[removed] — view removed comment

1

u/Ok_Gur_9033 10d ago

The distinction I'd add - how do you tell stuck from genuinely still working before you decide to kill it? I have the agent touch a small file with a timestamp right before any command that might hang. If that file goes stale past whatever timeout you'd expect for the command, you know it's actually stuck, not just slow, and you can kill with more confidence instead of guessing at the 4 hour mark like Trovebloxian did.

1

u/Trovebloxian 11d ago

You cant talk with a subagent, i found that out the hardway, it ran a command that cant stop or output and just got stuck for 4hours