New:Socket for Asana Is Now Available.Learn more
Get Started

@vaur94/opencode2-goal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaur94/opencode2-goal

Evidence-checked autonomous Goal loop for OpenCode V2.

latest
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

opencode2-goal

Persistent autonomous Goal loop for OpenCode V2.

Behavior

  • /goal <objective> sets or replaces the current session goal and starts its continuation loop.
  • /goal status shows it.
  • /goal pause, /goal resume, and /goal clear manage the loop.
  • An explicit user Stop/interrupt pauses the active goal; shutdown and superseded executions keep it active for recovery.
  • Active goals are injected as system context on every model turn.
  • After every successful or failed execution boundary, a synthetic continuation wakes the agent again.
  • The agent may mark a goal completed only after auditing its objective and constraints against concrete files, commands, tests, logs, benchmarks, or artifacts.
  • Completion evidence is stored with the completed goal; confidence, narration, todo status, or partial progress alone are insufficient.
  • Active loops restart when the plugin reloads or the service restarts.
  • There are no round limits, token budgets, or time budgets; completion is an evidence-audited model decision.
  • The loop continues until evidence supports completion or the user pauses, clears, or interrupts it.

The /goal command is model-mediated by OpenCode V2. Lifecycle mutations are implemented by one non-CodeMode goal_manage tool. User-controlled lifecycle actions remain user-controlled; the agent receives only the additional authority to call complete with an evidence ledger. Continuations are durable synthetic session inputs; they retain the selected agent, model, permissions, and safety rules. State is stored per session under ${XDG_STATE_HOME:-~/.local/state}/opencode2-goal/sessions.

Backend API

The plugin also starts an authenticated loopback backend for trusted local clients such as opencode2-web. Its random endpoint and bearer credential are written with mode 0600 to ${XDG_STATE_HOME:-~/.local/state}/opencode2-goal/backend.json. The credential must remain in the bridge process and must never be sent to a browser.

  • GET /v1/goals returns all persisted goals and process-lifetime telemetry counters.
  • GET /v1/goals/:sessionID returns one goal.
  • POST /v1/goals/:sessionID accepts set, update, pause, stop, resume, or clear.
  • GET /v1/events streams snapshots, lifecycle changes, and execution telemetry over SSE.

pause and stop both immediately pause the goal and interrupt its current execution without deleting state. update interrupts the old execution, replaces the objective, and immediately wakes the loop. resume also wakes the loop without waiting for another session event.

Plugin options apiPort and apiDiscoveryFile can override the random port and discovery path.

Development

bun install
bun run check

Local loading

Add the built bundle as its own entry in opencode.json:

{
  "plugins": [
    "/home/ugur/Projects/opencode2-goal/dist/plugin.js"
  ]
}

The plugin owns /goal and the exposed goal_manage tool.

FAQs

Package last updated on 17 Aug 2026

Related posts