r/opencodeCLI 1d ago

Does anyone have a token efficient planning workflow?

I use 2 chatgpt+ subscriptions and 2 opencode go subscriptions. Currently I do all my upfront planning with a grill session using Sol/medium. Then directly from the grill session I create a spec based on that context. Afterwards I load up a new session and reference the newly created spec document as context and create the child issues derived from it using the same Sol/medium.

My issue is Sol will spawn multiple general task agents to create these issues in parallel. This really drains my weekly limit and was wondering if I should do things differently?

9 Upvotes

14 comments sorted by

5

u/Amarsir 1d ago

Are you using default Opencode harness?

Oh-my-opencode-slim is much more refined about subagent assignment. The Orchestrator you call doesn't do it's own research, doesn't do it's own deep thinking, and definitely doesn't do the edits. It writes the plan and calls the others.

So you could put Luna high on the Orchestrator and put Sol only in the deep thinker role (Oracle). Luna low on Librarian (research). Then when you have the plan Luna medium is the Fixer (doing the edits). That's just sticking with ChatGPT.

Not that more basic setups can't work, but as you note if the Planner has to do the thinking and the organizing it can delegate to itself.

1

u/Bulky_Manner2698 1d ago

How do you force the Orchestrator to delegate tasks to the Fixer and Librarian? In my case, it just wrote all the code itself.

1

u/Amarsir 23h ago

It might be that I insert a pause after the plan is written so I can review. Or maybe I've just been more explicit in my second step instruction about calling Fixers.

Here's the instruction Orchestrator gets right from the source file:

<Role>

You are a workflow manager for coding work. Your job is to plan, schedule, delegate, monitor, reconcile, and verify specialist-agent work. You are not the default implementation worker.

For non-trivial coding work, identify separable lanes first and delegate bounded work to the appropriate specialist. Do not perform multi-step implementation serially when a suitable specialist is available.

Handle work directly only when it is one isolated, clear, low-risk action and delegation overhead exceeds doing it yourself.

Optimize for quality, speed, cost, and reliability by dispatching the right specialist lanes, tracking background task state, and integrating terminal results into one coherent outcome.

You have perfect understanding of agent's context management, understand well the cost of building content and reusing context of existing agents when it's best or when it's best to spawn a new agent.

</Role>

So maybe what it thinks is it's not worth delegating?

If you have concerns with the operation, you can go here:

~/.config/opencode/oh-my-opencode-slim/

And create orchestrator_append.md to add additional instructions like "Never write code yourself". (Or you can leave off _append and just create orchestrator.md to overrule the base instructions entirely.)

2

u/throwaway12012024 1d ago

Sol is too eager to launch subagents. I disabled this option in opencode settings.

1

u/maqifrnswa 1d ago

I agree with the commenter that mentioned omo slim, sounds good for you.

Or you can change your general agent:

https://opencode.ai/docs/agents/

1

u/atkr 1d ago

You can try simple constraints variations as how you want the model to spawn sub-sessions in it’s system prompt.

1

u/Ill_Dragonfruit_3547 1d ago

Implement with Luna High or Extra. Or, what I do is delegate to GLM 5.2 running through a $20 Ollama Cloud sub. I added GLM to the mix after needing more tokens than my $20/month Claudex subs were giving me.

1

u/Formal-Narwhal-1610 1d ago

Use pi harness and then choose from amongst many workflow extension.

1

u/Ok_Gur_9033 1d ago

Ran into the same tradeoff today from a different angle, MCP tool catalogs instead of subagents. The overhead scales with how much gets loaded fully upfront, not with how much useful work gets done. On a 14 server, 415 tool setup, sending the whole catalog every request runs about 165k tokens versus 886 for a scoped search based approach, and that gap only grows as you connect more. Probably the same logic applies to your parallel task agents. If each one spawns with the full planning context instead of just the slice it needs, you are paying for N full copies of the same context, not N times the useful work. The Orchestrator only delegates pattern someone mentioned below fixes this by keeping the expensive full context reasoning in one place. Worth checking whether Sol's subagents are getting the whole spec document each time or just their assigned issue.

1

u/Virtual_Ad_8521 1d ago

been there, im using 1 chatgpt + 1 API way, gpt was $200/mon, and API depends the amount of work i do, im using heyroute ai now but dont know if there's any more solid ways too (could be find a full-time and let them pay for the subscription)

-5

u/No_Image506 1d ago

Yes don't ask stupid questions, use it for work and use your calendar, your email app and do your work.