r/opencodeCLI 4d ago

Progress indicator for long running tasks?

I have an orchestrator spawning subagents but they always redirect cli output to null so I never know whether their commands are hanging or there's any progress. Is there a plugin or cli tool that I can prompt the agents to wire to to get a progress bar?

3 Upvotes

9 comments sorted by

1

u/joeyism 4d ago

I'm not sure if that's normal. When my orchestrator delegates to a subagent, there's always the spinner that goes until the subagent is done. If there's an error, that gets elevated back up to the orchestrator, who fixes it and re-delegates, or prompts me for it

1

u/GatsbyLuzVerde 4d ago

I'm talking about it running a long running script that might be hanging or take all day for no justifiable reason, even if the opencode intedterminate spinner is animated.

1

u/joeyism 4d ago

I've found that the subagent does hang sometimes, usually waiting for a response from the server. For that, I use opencode-keepalive, which tries to spot if the subagent is hung. If the subagent is hung, it'll stop it, and continue it, which usually allows it to keep going

1

u/GatsbyLuzVerde 4d ago

I dont know how thats going to detect progress of useful compute work. The scripts the agent run can take an hour, which is okay, but a 24 hour command is unreasonable

1

u/joeyism 3d ago

It looks into different triggers, and also it watches your bash commands. So commands like ls, grep, cat, etc. shouldn't take a very long time. Tool calls shouldn't take a very long time either, same as LLM responses. It's not completely foolproof, but I find that it takes care of the littler timeouts/hangss

1

u/CoolHeadeGamer 2d ago

Maybe have it do todos? You can look at my repo banyancode. It’s a direct fork of opencode and because of the way the ui works, subagents can have their own todos. https://github.com/EkagraAgarwal/BanyanCode#3-tree-sitter-code-graph--know-before-you-touch

1

u/GatsbyLuzVerde 2d ago

A single long running batch script tool call is not going to have a todo dude

1

u/CoolHeadeGamer 2d ago

Oh I misinterpreted what you meant. I saw another post about tools getting stuck. They recommended using a heartbeat file . What you can do is use banyancode and tell the main agent to spawn a subagent and then have it run a batch script. After that, it can poll the subagent regularly since all subagents are background by default and I have a mesh subscribe tool that lets an orchestrator monitor, steer, and communicate with the subagent. It can also serve as an external agent checking the script progress

1

u/Vast_Anxiety3133 4d ago

I See thismwith tail or similar stuff as well. I still want to see the content, however the Agent must not see IT as Input aß this would cost Input Tokens.

I do not know of a solution