# opencode · Result checks

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [opencode](https://ai-agents-review.com/runtime/opencode.md)
- Column: [Result checks](https://ai-agents-review.com/column/result-checks.md) (Operations and verification)
- Mark: 3 s
- Default deployment: 3
- Best supported configuration: 3
- Page: https://ai-agents-review.com/cell/opencode/result-checks

## Rationale

Built-in `/goal` judge re-prompts with stated caps (50 rounds, 3 stalls) and pauses; the caps are constants, not configurable per check

## Rubric criteria for this column

- 0: No result checks
- 1: Structural checks only (schema on tool args/output, or structured final output), with no hook for result checks
- 2: Owner-defined checks available (Stop/finalize hooks, check scripts), but on failure the answer is released after a cap or fails open
- 3: Owner-defined checks where failure either blocks release with an error **or** re-prompts with a stated cap and records the outcome
- 4: Level 3, plus checks available by default (a built-in verifier or default check) **and** retry/release policy configurable per check

## Review finding

Tool inputs are decoded against their schema (error asks the model to retry) and outputs against declared output schemas. Only `tool.execute.before` hooks can reject. Built-in `/goal` LLM judge (≤50 rounds, 3 stalls). Schema-checked Code Mode `agent()` exists only behind a flag that is off in releases. No LSP or test gate. [O88][O89][O90][O92][O93][O95]

## Evidence cited by the mark

- [O90] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/plugin/goal.ts#L15-L19 — Goal plugin limits: MAX_ROUNDS 50, MAX_STALLS 3, WAIT_LIMIT 30 min; armed goal from earlier process comes back paused — [S]
- [O91] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/plugin/internal.ts#L222 — GoalPlugin registered as built-in plugin — [S]
- [O88] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/tool/runtime.ts#L84-L140 — Tool input decoded against schema (error tells model to retry); output encoded against declared output schema, error on mismatch — [S]

## Evidence also cited by the review finding

- [O89] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/plugin/hooks.ts#L23-L30 — Only `tool.execute.before` may fail (reject the call) — [S]
- [O92] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/schema/src/config/flag.ts#L6-L19 — Flags on in local/dev builds, off in releases; `codemode_agents` = schema-checked agent()/llm() in Code Mode — [S]
- [O93] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/tool/plugin/codemode-agents.ts#L38-L75 — Gated on `codemode_agents`; structured-output tool validates child result — [S]
- [O95] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/tool/plugin/edit.ts#L254 — LSP diagnostics after edit still a TODO — [S]

## Grading record

- Grader A (default / best): 3 / 3
- Grader B (default / best): 3 / 3
