Repository navigation
0.10.0 — Plan-guard and title fixes, cost cap, literal flags, agent authority, pinned installs
v0.10.0 — Plan-guard and title fixes, cost cap, literal flags, agent authority, pinned installs
Two defects reproduced against live OpenCode 1.18.25 and 1.18.29 are fixed, two contributions from forks are ported with credit, agent tools gain an authority setting, and the install docs now explain why an unpinned plugin never updates.
Fixes
Plan-mode guard fails open on a session's first command
OpenCode runs command.execute.before before any chat hook for the turn, and its Session record carries no agent field, so the 0.9.0 "session record fallback" could never learn the agent for a /goal <objective> sent as a fresh session's first turn. The goal started live and the routed text told the model to start working. Reproduced over the HTTP command API with agent: "plan" (the path opencode run --agent plan uses too).
The routed turn does carry the agent. chat.message now re-evaluates the planning-only restriction for the goal that command created and, when the agent is restricted, holds the goal (plan agent active, budget preserved), rewrites the turn as a read-only control turn, and blocks tools for it. A completion marker on that turn does not complete the held goal. Pinned by a new mutation-contract entry.
Stale ▶ in the session title after completion
With sessionTitleStatus, completion archived the goal and the title sync returned early, leaving the last running line on the session until /goal clear. A completed goal now renders as ✅ ship the release · 3 turns · 2m · 45k; /goal clear still restores your original title.
Ported from forks
- Cost cap —
maxCostUsdplugin option and--max-costper-goal flag. The goal pauses with the usual wrap-up prompt once the cumulative API cost OpenCode reports reaches the cap (max cost reached ($5.00))./goal statusshowsCost budget: $spent/$cap, the continuation budget carriescost_remaining_usd, the near-limit warning fires within 10% of the cap, andgoal_set/set_goalacceptmaxCostUsd. An unknown provider cost never trips the cap; one response may overshoot. Idea and first implementation by @NiklasTR. - Fenced literal flags — a
```fence```in/goalarguments is objective text verbatim:/goal run ```pytest --maxfail=1``` and fix failuresno longer rejects withUnsupported flag: --maxfail. Ported from @NiklasTR.
New option
agentGoalAuthority—"full"(default, unchanged) or"status". In"status"mode the agent tools may complete, block, pause, resume, and create a goal when none is live, butgoal_set/set_goalrefuse to replace an active goal (anagent_authorityfailure envelope on the canonical tool),update_goalrefuses objective changes, andclear_goalrefuses to clear — a model can no longer rewrite the objective you gave it. Prompted by @felores's fork.
Install docs: pin your version
OpenCode resolves an unpinned "opencode-goal-plugin" entry to @latest once, installs it under ~/.cache/opencode/packages/opencode-goal-plugin@latest/, and never re-resolves while that directory exists. Anyone who followed the old README is still on whichever version they first installed. The README now pins the version ("opencode-goal-plugin@0.10.0"), documents the upgrade path (bump the pin, or delete the cached directory), mentions opencode plugin <name>@<version>, and npx opencode-goal-plugin warns when the unpinned cache lags the package. npm install was never required and is gone from the instructions.
Also
zod4.4.3 → 4.5.4; CodeQL action v4.37.9.- OpenCode 1.18.29 added to the compatibility table from a deterministic-provider canary against a real
opencode serveprocess. ledgerFilePathdocumented;file://checkouts noted to neednode_modules.
Upgrading
Set "plugin": ["opencode-goal-plugin@0.10.0"] and restart OpenCode. If you had an unpinned entry, also delete ~/.cache/opencode/packages/opencode-goal-plugin* (or run npx opencode-goal-plugin@0.10.0 to see whether a stale copy is cached).