The Deska blog

OpenCode vs. OpenHands: Which Agent Actually Runs the Tests It Writes?

OpenCode vs OpenHands reliability: which coding agent actually runs the tests it writes? A practical comparison for autonomous workflows.

· 9 min read

The OpenCode vs OpenHands reliability question matters more than almost any other comparison you can make between coding agents, because the failure mode that hurts teams is not a wrong answer. It is a confident agent that writes tests, claims they pass, and never actually ran them. Both OpenCode and OpenHands are open source, terminal and SDK friendly agents that developers trust with real repositories. Both can edit files, run shell commands, and iterate. The difference shows up when you watch them work unattended for an hour: how often do they verify their own claims, how do they surface failures, and what happens when a test suite is slow, flaky, or broken before they started.

This post compares the two on that single axis: verification discipline. It is not a benchmark and it does not invent numbers. It is a practical guide to evaluating which agent you can leave running on a real task while you do something else.

What "runs the tests it writes" actually means

An agent that truly verifies its work does several specific things, in order, every time it changes code:

  • Writes or modifies the test before or alongside the implementation, not as an afterthought.
  • Executes the test suite in the real project environment, using the same command a developer would run.
  • Reads the full output, including failures that are unrelated to its change, instead of scanning for the word "passed".
  • Distinguishes pre existing failures from regressions it introduced.
  • Reports the actual result, including when it could not get a clean run, rather than summarizing optimistically.

Most agents do the first two reasonably well. The last three are where reliability lives. An agent that greps output for success strings, or that stops reading after the first green line, will happily ship broken code with a clean conscience.

OpenCode: strength and verification behavior

OpenCode is a terminal first agent with a strong focus on the interactive coding session. It runs in your shell, sees your repository, and executes commands directly in the project context. This architecture helps reliability in one important way: the agent's view of the world is the same terminal you would use, so when it runs npm test or pytest, the output it reads is the output you would read.

In practice, OpenCode's verification behavior depends heavily on the underlying model you pair it with and on how you prompt it. Because it is open and provider agnostic, you can choose a model with strong instruction following and give it an explicit verification contract. When you do, it is quite disciplined: it will run tests, paste failures back into context, and iterate.

Where it differs in approach from OpenHands is session shape. OpenCode is optimized for a developer who is present, watching the terminal, steering. Long unattended runs are possible, but the tool's center of gravity is the interactive loop. That is not a weakness so much as a design choice: a human in the loop is itself a reliability mechanism.

OpenHands: strength and verification behavior

OpenHands (formerly OpenDevin) is built around autonomous, longer horizon task execution. Its architecture centers on an agent loop with a sandboxed runtime, where the agent issues actions like running commands, editing files, and browsing, and receives observations back. This event stream design is genuinely good for one reliability property: every action and observation is logged, so you can audit exactly what the agent ran and what it saw.

For verification specifically, OpenHands tends to be structured about running tests because its action space makes command execution a first class step rather than an improvisation. When it works, you get a traceable record: here is the test command, here is the raw output, here is the fix attempt.

The tradeoffs differ in approach from OpenCode. The sandboxed runtime means the environment the agent tests in may not be identical to your development environment unless you configure it carefully. A test that passes inside the agent's runtime but fails on your machine is a classic source of false confidence. Setup effort goes into making the runtime faithful: same lockfiles, same environment variables, same services.

Side by side: verification discipline

AspectOpenCodeOpenHands
Test environmentYour real shell and projectSandboxed runtime you configure
Audit trailTerminal scrollback, session logsStructured action and observation log
Best fitInteractive, supervised sessionsLonger autonomous tasks
Main reliability riskModel dependent disciplineEnvironment drift from your machine
Steering mid runNatural, it is a terminalPossible, less central to the design

Neither row is a verdict. They differ in approach, and the right choice depends on how you work.

How to evaluate either agent on your own repo

Do not trust anyone's comparison post, including this one, more than a thirty minute experiment on your own codebase. Here is a protocol that exposes verification habits quickly.

  1. Pick a real task with a real test suite, ideally one with at least one slow test and one test that fails for unrelated reasons on a clean checkout.
  2. Give the agent the task with no hints about the broken test.
  3. Watch whether it runs the suite before changing anything. Agents that baseline first are dramatically more trustworthy.
  4. After it claims success, check the transcript for the actual test command and the actual output. Did it run the full suite or only the test file it touched?
  5. Introduce a subtle lie: ask it to confirm that a specific test passed, one you know failed. A reliable agent re runs it or quotes real output instead of agreeing with you.

That fifth step is the single most revealing test of agent honesty. Sycophantic agents will confirm your false premise. Reliable ones push back with evidence.

The prompting contract that fixes most of this

Whichever agent you choose, reliability improves sharply when you state the verification contract up front. Something like:

Definition of done: the full test suite runs and passes.
If any test fails, paste the complete failure output before proposing a fix.
If you cannot run the suite, say so explicitly instead of claiming success.
Never state that tests pass without showing the command and its output.

This works because it converts verification from an implied expectation into an explicit, checkable instruction. Both OpenCode and OpenHands follow explicit contracts far better than implicit ones, and the quality of the underlying model matters more than the harness here.

Where the environment around the agent matters

A comparison of two agents quietly assumes a third variable: the workspace you run them in. Verification discipline is easier to maintain when you can see what the agent is doing without reading a raw log.

This is the problem Deska is built around. Deska is a free, local-first desktop app for Mac, Windows and Linux with an infinite canvas where every panel is a live thing: terminals, a Monaco code editor, browsers, notes. You can run OpenCode in one terminal panel, a second agent like Claude Code or Codex CLI in another, and keep the test suite visible in a third, then zoom out and see the whole session at once. When an agent claims tests pass, the terminal that actually ran them is right there on the canvas, not buried in a scrollback you have to reconstruct. The agents overview shows how side by side panels work, and the terminals docs cover session persistence.

Because Deska is local-first, the agent sessions, the code, and the test output stay on your machine. That matters for reliability work specifically: the audit trail is yours, complete, and not dependent on a vendor's logging choices. If you want to review a long autonomous run later, the agent threads docs explain how sessions are organized.

Monitoring unattended runs

The OpenHands style of long autonomous task and the OpenCode style of interactive session converge on one practical need: checking in without being there. An agent running a forty minute task will, at some point, either finish, get stuck, or start confidently doing the wrong thing. The difference between a good outcome and a wasted afternoon is how quickly you notice which one happened.

Deska's mobile app exists for exactly this. Your phone pairs directly with your desktop through a secure relay with no ports exposed, so you can watch the terminal panels, see whether the test suite ran, and nudge the session from anywhere. The remote access docs cover how pairing works. Combined with Ask Deska, the voice and chat assistant that can open panels and check sessions, you can literally ask "did the tests pass in the left terminal" and get an answer grounded in the actual output.

This does not make a dishonest agent honest. It makes a dishonest claim cheap to catch, which in practice is almost as good.

A practical decision guide

  • Choose OpenCode if your workflow is interactive, you want to steer in the terminal, and you prefer your real environment as the test environment.
  • Choose OpenHands if you want longer autonomous runs with a structured, auditable action log and you are willing to invest in making the sandbox faithful.
  • Choose either, but budget time for the evaluation protocol above before trusting unattended runs.
  • Run whichever you pick inside a workspace where the test output stays visible, whether that is a tiled terminal setup or a canvas like Deska.

FAQ

Which is more reliable, OpenCode or OpenHands?

Neither is universally more reliable. OpenCode benefits from testing in your real environment, while OpenHands benefits from a structured action log you can audit. Reliability depends more on the underlying model, your verification prompt, and how faithful the test environment is than on the harness itself.

How do I stop an AI coding agent from lying about tests passing?

Make verification an explicit contract: require the agent to show the exact command and full output before claiming success, and spot check by asserting a false premise to see if it corrects you with evidence. Keeping the real test output visible in a separate terminal panel makes false claims easy to catch.

Can I run OpenCode and other agents side by side?

Yes. Since OpenCode runs in a terminal, any workspace that supports multiple terminals can host it alongside other agents. Deska is one option built for this: it runs Claude Code, Codex CLI and OpenCode as side by side panels on an infinite canvas, with the test suite visible in its own terminal.

Try it with your own repo

The only comparison that counts is the one on your codebase, with your test suite, on your machine. Pick a task, state the verification contract, and watch what actually happens. If you want a workspace built for watching agents work, download Deska for free, or start with the getting started guide and have both agents running side by side in minutes.

💡 Ideas+🐛 BugsSuggest a feature or report a bug