The request sounded almost too small: use an already-authorized OpenCode installation to ask DeepSeek for “Hello, world!”, then make the result composable, useful, and reliable.
The first call worked. The interesting part started afterwards.
Codex was now driving OpenCode, which was driving DeepSeek. That is an agent running an agent through another provider boundary—and every layer had its own context, permissions, failure modes, cost fields, and opportunities to leak something.
The five-minute discovery
The machine already had OpenCode 1.18.16 and a DeepSeek provider login. The credential lived in OpenCode’s external auth store rather than the repository. We checked its location and file permissions without printing the value, then ran the smallest possible request.
| |
The raw direct-V4-Flash call returned exactly:
| |
That proved connectivity. It did not prove code quality, billing accuracy, safe tool use, or value per accepted task.
What the first comparable probe showed
We then used the same exact prompt—Reply with exactly: probe-ok-42—with a tool-disabled agent. These are AIHackers-owned connection observations from August 11, 2026, not a model benchmark or current route roster:
| OpenCode route | Exact response? | Duration | Reported cost | State |
|---|---|---|---|---|
deepseek/deepseek-v4-flash | Yes | 4.216s | $0.00031052 | validated-probe |
deepseek/deepseek-v4-pro | Yes | 3.785s | $0.00097440 | validated-probe |
opencode/deepseek-v4-flash-free | Yes | 18.163s | $0 | validated-probe; exact backend revision unresolved |
opencode/laguna-s-2.1-free | Yes | 5.695s | $0 | validated-probe |
opencode/longcat-2.0-free | Yes | 24.825s | $0 | validated-probe |
opencode/mimo-v2.5-free | Yes | 20.442s | $0 | validated-probe |
opencode/nemotron-3-ultra-free | Yes | 23.504s | $0 | validated-probe |
opencode/ling-3.0-tiny-free | No result | >30s | not recorded | unresolved-timeout |
“Reported cost” means the value in OpenCode/provider events. It is not a billing-console receipt. A $0 probe does not promise that a route will stay free, identify the hidden backend, or establish its data terms.
The direct Flash route was about three times cheaper than Pro on this tiny request. That is interesting arithmetic and useless buying advice: one exact-string response has no meaningful acceptance burden.
The easy changes that mattered most
The useful implementation was deliberately small:
- One restricted agent. OpenCode’s project agent denies every tool. A connectivity or text-transformation call has no reason to edit files, run shell commands, browse, or spawn another agent.
- One scriptable interface. Plain text goes to stdout; JSON includes model, finish state, tokens, cache fields, cost, duration, and redaction count.
- One hard stop. A timeout terminates the whole child process group. Malformed event streams, explicit error events, missing completion, and non-zero exits fail closed.
- No invisible retries. Automatic retries can duplicate both work and charges. The caller decides whether another attempt is justified.
- No ambient secrets. The child receives a minimized environment. Credential-shaped prompts are rejected, and model output plus errors are redacted before returning.
- A repository gate. Secret scanning runs locally and in publication/CI checks, reporting only file, line, and rule—not the suspicious value.
OpenCode officially supports custom agents and granular allow, ask, and deny permissions. The key design decision was to treat that permission system as part of the API contract, not as a convenient UI setting.
A fresh-worktree check found one wonderfully ordinary bug after the first release: a local node_modules symlink looked like a visible path, so the scanner tried to read a directory as a file. It now ignores symlinks and other non-regular entries instead of following them or crashing. Reliability work is often this unglamorous.
The shortest useful pattern
In this repository, the safe wrapper looks like this:
| |
The reusable idea is broader than these commands:
- keep provider authentication outside the project;
- give the nested agent only the permissions required for this call;
- request a machine-readable event stream;
- set a real wall-clock timeout;
- preserve route, version, prompt, duration, attempts, and validation state;
- never confuse transport telemetry with a receipt or an accepted result.
If the job actually needs repository tools, create a separate narrowly permitted agent and test its allowlist on a disposable worktree. Do not weaken the no-tools probe agent into a general-purpose executor.
Why CAR is still not-run
The repository now has a fail-closed Cost per Accepted Result calculator:
| |
It includes failed attempts and returns null when nothing is accepted. What it does not do is manufacture the missing evidence.
A real Flash-versus-Pro decision still needs the same frozen site tasks, commit, harness, permissions, timeout, acceptance rules, reviewer, loaded hourly rate, retries, and redacted billing cross-check. Our next gate is five real tasks per lane, at least four accepted, no unsafe result, CAR no worse than Pro, and a clean-pass gap no larger than one task.
Until that run exists, the result is simple: the connection is validated; the value claim is not-run.
Pro tips from the failure edges
- Probe identity before capability. A route label is not a model-card guarantee. The historical promotional DeepSeek probe has an unresolved exact backend revision.
- Separate “free” from “cost recorded as zero.” Access status, provider telemetry, account charge, and future availability are different fields.
- Make timeouts visible data. Ling’s timeout belongs in the table; silently dropping it would bias the shortlist.
- Do not benchmark orchestration overhead by accident. OpenCode adds its own system context. Compare candidates through the same agent and harness.
- Redact twice. Prevent secrets from entering the child, then redact anything suspicious coming back.
- Keep the agent stack legible. Record which agent called which harness and model. “DeepSeek did it” hides most of the system that produced the output.
- Spend on acceptance, not demos. A cheap first response can become expensive after retries and cleanup. CAR starts where token-price tables stop.
Remaining issues
- The August 11 free-route roster, latency, limits, data terms, and backend identities were a dated snapshot and must not be reused as current availability.
opencode/ling-3.0-tiny-freeneeds a fresh bounded preflight before inclusion in any scored run.- Provider event costs still need a redacted billing-console cross-check for a publishable CAR result.
- A future repository-writing comparison needs a separate tool-enabled agent, frozen task pack, independent review, and isolated worktrees.
- The targeted Git-history secret check found only a known placeholder lineage, but an exhaustive third-party history scan was not available in this run.
That is the real “agents running agents” lesson: delegation is easy to demo. The product is the boundary around it.
Sources and related reading
- OpenCode agents and permissions — official agent and permission configuration
- OpenCode CLI — official command-line and JSON-output reference
- OpenCode Zen — current gateway, model, pricing, and route-specific terms
- OpenCode guide — providers, permissions, privacy, and setup
- DeepSeek V4 Flash 0731 — direct API identity, pricing, and evidence boundaries
- Smart Spend — why Cost per Accepted Result matters
- LLM cost-saving playbook — promotion, route, and accepted-result boundaries
- How to read AI benchmarks — a small accepted-task eval pattern
Preflight checked August 11, 2026; current Zen routing rechecked August 20. Route availability and reported costs are dated observations; AIHackers-owned DeepSeek CAR remains not-run.