Files
alzeo/extras/opencode
Hasan Basbunar 7850b02b0f extras/opencode: the auto-continue plugin ported to the OpenCode 2 plugin API (auto-continue-v2.js)
v2 does not run v1 plugin implementations (packages/core/src/plugin/module.ts of the
v2.3.2 tag requires a default export of { id, setup }; a function default export is a
LoadError), so the port is a separate file and the v1 auto-continue.js is untouched: on a
v2 box copy auto-continue-v2.js to ~/.config/opencode/plugins/ and take the v1 file out
(docs/operations.md says so).

Same policy on the v2 event set (measured shapes on the pinned 2.3.2 in a sandbox, SSE
/api/event): relaunch after session.execution.failed (the runner's own retry policy is
exhausted by then; a failed execution leaves the session idle, projector.ts), unless the
error matches the v1 exclusions or is the same 4xx refusal (not 429) a third time in a
row (numbers masked); session.execution.started cancels a pending relaunch;
session.execution.succeeded with nothing pending is progress and resets the cap. A manual
/compact (session.compaction.ended, reason manual) still ends idle without resuming, so
it arms the relaunch; reason auto deliberately does not: the v2 runner compacts inside
the running turn and continues (runner/llm.ts), and compaction.background (default true
since 2.3.1, pinned in our v2 config) has the summary precomputed from the cached prefix,
so the auto swap is instant and the stuck-after-auto-compaction case of v1 does not exist.
The relaunch is ctx.session.prompt({ sessionID, text }), the flat v2 prompt input.
Tests (node, fake v2 context, scripted events): 12, all red on the old code (the plugin
file does not exist there).

Generated by Mistral Vibe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:37:31 +01:00
..