r/opencode • • 21d ago

Trying to improve OpenCode's efficiency

I've been testing OpenCode and Pi with locally hosted qwen3.8-27b and I'm looking for advice on improving OpenCode's efficiency.

I prefer OpenCode, particularly its interface and ecosystem, and I'd really like to keep using it, but in my testing Pi has been noticeably more efficient at getting coding tasks done.

My setup:

  • Model: Qwen3.8-27B (Q6_K_XL)
  • Inference: llama.cpp
  • Hardware: RTX 4080 SUPER + RTX 4070 Ti SUPER (32GB combined)
  • Tasks: Real coding tasks in repos including multi-file changes, tool use, and test-driven iteration

The main issue isn't raw inference speed. It's how efficiently the agent uses its tokens and tools to complete a task.

Here's one example... I've been testing both harnesses using the same coding task in a TypeScript repo. Using OpenCode, the model spends a lot of time reasoning about the implementation ("but wait..."), revisiting decisions ("actually..."), and sometimes going through context compaction without making corresponding progress. With Pi, the same underlying model has generally been more willing to move from analysis into tool calls and implementation.

In both cases the model can do the work. The question I'm running into is why the harness seems to make such a difference in how efficiently it gets there.

If you've optimized OpenCode for local models (particularly qwen3.8-27b, which is known to overthink):

  1. Have you found prompt or agent configurations that reduce unnecessary reasoning and encourage more direct tool use?
  2. Have you simplified OpenCode's tool definitions or system prompt to improve local-model performance?
  3. Have you found any compaction or context management behaviors that could produce more over-thinking than with other harnesses?
  4. Have you found any other settings or modifications worth testing to get OpenCode invoke the model more efficiently from an over-thinking perspective?

I'm not looking to argue that one harness is better than the other. I want to keep using OpenCode but improve it's use of this model.

I appreciate your thoughts!

--

Edit for grammar.

21 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/previaegg 20d ago

Thank you for your thoughtful reply. I've been capturing the raw model-facing JSON requests from both OC and Pi harnesses, so I've been able to investigate some of this, and unfortunately context exhaustion is not the underlying issue. Pi is completing substantially more work within the same context budget, and the difference in behavior appears well before either harness approaches the limit.

For example, in one controlled comparison Pi started implementing at exchange 9, while OpenCode (using a minimal custom agent profile and lean system/user prompts) was still investigating after exchange 17. Both had read comparable amounts of source code. OpenCode was spending more time reconsidering its approach and investigating peripheral details rather than moving into implementation.

I agree that context management matters but mostly I'm trying to understand why the same model, given the same task and context budget, makes such different decisions about when to stop investigating and start implementing.