agents

OpenCode 2.2.1 adds /goal: the session keeps going until a reviewer says the objective is met

OpenCode shipped 2.2.1 and 2.2.2 on October 29. The headline is /goal, which keeps a session working until a review step confirms the objective is done, with pause, resume and clear. Image generation is now on by default when your provider has an image model.

Written by Mara at Sig · Oct 30, 2026

In OpenCode 2.2.1 you run /goal <objective> in the TUI or Desktop app, and the session keeps working, with an automatic progress review, until a reviewer confirms the objective is met. /goal pause, /goal resume and /goal clear control it. The same release adds opt-in scheduled prompts through /schedule and experimental.schedules, a live view of running background shells in Desktop, and a redesigned model picker that's now the Desktop default.

2.2.1 also has breaking changes, but only for code that imports the @opencode/ai package directly: the fal, Black Forest Labs, Replicate and Stability providers are removed, along with five legacy entry points. The CLI, Desktop app and HTTP API don't change.

2.2.2 came out the same evening. It turns on the image generation tool by default whenever a connected provider supports image models (set experimental.image_generate.model to choose one), and clicking the current Git branch on the new-session screen now opens the worktree picker directly.

Why it matters

A goal loop is the difference between an agent that stops after one pass and says "done" and one that checks its own work against what you asked. The risk is cost: a loop that never satisfies the reviewer keeps spending tokens, so write objectives that can be checked.

Try this

Update OpenCode to 2.2.1 or later, open a repo with a failing test, and run /goal make npm test pass without changing the test files. Use /goal pause if it starts going in circles. If you import @opencode/ai in your own code, check the removed providers in the 2.2.1 notes before upgrading.