Skip to content

v1.3.0

Choose a tag to compare

@sblattj sblattj released this 05 Oct 01:26
· 20 commits to main since this release
  • Fixed: "Goal plugin is locked by another opencode process" no longer pins a session to whichever process touched it first. Before this release, a process took a session's lease the first time any hook saw that session, even an ordinary chat message with no goal, and kept it until the process exited. A second OpenCode process opening the same session was passive for good. Now a process holds a session's lease only while it is driving it. That means an active or queued goal, a /goal turn, a continuation, a prompt, a session load, or a hook or tool call still running for it. After the session has been idle for idleLeaseReleaseMs (new option, default 3000; 0 restores the old keep-until-exit behaviour), the owner persists, drops its in-memory copy, and releases the lease. Paused, stopped, and finished goals do not hold it. Goals in different sessions already ran concurrently, one shard per session. Two processes can now also hand a single session back and forth. A session with a running goal stays exclusive to its owner, and forking (opencode --continue --fork) remains the way to run two goals at once from one conversation.
    • New: lease heartbeat and stale reclaim. Each claim records heartbeatMs and its mtime is refreshed every leaseHeartbeatMs (default 15000). A heartbeating claim older than max(leaseStaleAfterMs, 4 × heartbeat) (leaseStaleAfterMs defaults to 120000) is reclaimable whatever its pid or host. A crashed process, a reused pid, or a claim left by another machine on a shared filesystem no longer pins the session. Claims from older releases, which carry no heartbeatMs, keep the earlier pid/host rule, and also become reclaimable after 24 hours when they come from another host. The claim layout and protocol (claims-v2) are unchanged, so 1.2.x and 1.3.0 processes interoperate. A 1.2.x owner still never releases early, though.
    • New: writes are fenced after a lost lease. Before each persist, ledger append, and goal-driving prompt, the owner checks that its claim is still there. If it was reclaimed or removed, the process stops touching that session, logs a warning, and unloads it, so two processes never write one shard. Behaviour change: a host that sleeps for longer than the stale window (about 2 minutes by default) can wake to find another process has taken over its session. It then stands down instead of writing.
    • Changed: the passive-mode message says what to do. It now explains that an idle owner releases the session within a few seconds, so you should retry, and that opencode --continue --fork is the way to work in parallel.
    • New: npm run smoke:multi-process. It runs two real opencode serve processes on one project. It asserts that goals in distinct sessions run at once, that a session left idle by process A is taken over by process B, and that a session with a running goal stays with its owner. Like the smoke:todo-* rungs, it needs the opencode binary and is not part of release:check. Against 1.2.0 the takeover arm fails, and against 1.3.0 all three arms pass.
    • Types and docs. index.d.ts adds the three options to GoalPluginOptions. docs/reference.md (state and persistence, options table, troubleshooting) and docs/compatibility.md describe idle release, the heartbeat and stale rule, and the sleep caveat.

Install: opencode-goal-pro-max-complete-plugin@github:sblattj/opencode-goal-pro-max-complete-plugin#v1.3.0 (see docs/reference.md).