Skip to content

Commit 75f7562

Browse files
authored
Merge pull request #10 from d3cker/release
Release v0.6.4
2 parents 11f6fcc + 2fd1049 commit 75f7562

18 files changed

Lines changed: 230 additions & 72 deletions

‎.github/release-state.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"pullRequest": 7,
3-
"sourceSHA": "0607dc761f2bff2bafca5c820f1427109cc13fde",
4-
"version": "0.6.3"
2+
"pullRequest": 9,
3+
"sourceSHA": "a5804b907dc37d653bb9b339300dc3865159ec84",
4+
"version": "0.6.4"
55
}

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ include the full version, for example `## 0.7.0-beta.1`.
88

99
## Unreleased
1010

11+
## 0.6.4
12+
13+
### Fixed
14+
15+
- Prevent hourly owner eviction using durable activity on one empty maintenance
16+
session. The previous plugin-list heartbeat did not refresh OpenCode's session
17+
inactivity timer. Keepalive never prompts a model or modifies a work session.
18+
- Bound SDK waits independently of adapters that ignore AbortSignal, allowing
19+
shutdown to release locks without interrupting a healthy worktree session.
20+
A replacement dispatcher reconciles the saved session before publication.
21+
- Wait briefly for a retiring owner's locks, bound RPC disposal, and reject
22+
queued checkpoint writes after shutdown to prevent failed plugin reloads.
23+
1124
## 0.6.3
1225

1326
### Fixed

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Nothing needs to be published to npm. `$HOME` expands to your home directory.
2626
Run this command on the machine running OpenCode 2:
2727

2828
<!-- latest-release:start -->
29-
Latest stable release: **[v0.6.3](https://github.com/d3cker/opencode2-github-automation/releases/tag/v0.6.3)**.
29+
Latest stable release: **[v0.6.4](https://github.com/d3cker/opencode2-github-automation/releases/tag/v0.6.4)**.
3030

31-
[Download the .tgz package](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz) · [SHA-256 checksum](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz.sha256)
31+
[Download the .tgz package](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.4/opencode2-automation-0.6.4.tgz) · [SHA-256 checksum](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.4/opencode2-automation-0.6.4.tgz.sha256)
3232

3333
```bash
34-
npm install --global --prefix "$HOME/.local" "https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz"
34+
npm install --global --prefix "$HOME/.local" "https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.4/opencode2-automation-0.6.4.tgz"
3535
```
3636
<!-- latest-release:end -->
3737

‎docs/advanced.md‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,23 @@ uncertain network results. Uncertain initial prompt delivery is not automaticall
101101
resent. Issue replies and helper prompts use deterministic IDs for admission retries.
102102
Merge requests pin the verified head SHA and reconcile an already-merged PR.
103103

104-
The shared service can evict an idle owner location even while an agent works in
105-
a different worktree. Scheduler and dispatcher components therefore refresh the
106-
owner every 30 seconds through the public plugin-list API, after confirming the
107-
service PID matches their own process. Transient heartbeat errors are logged and
108-
retried; requests do not overlap. A standalone server without a matching service
109-
registration skips this mechanism. Keep its owner location in use or use the
110-
shared background service for unattended automation.
111-
112-
Cleanup aborts and settles work before releasing ownership. All cleanup steps
113-
are attempted even when RPC disposal fails; locks are not forcibly removed or
114-
stolen from another owner. A held-lock startup error should be investigated via
115-
plugin details and server logs. Back up the queue and worktree before recovery;
116-
do not assume a failed session means its edits were lost.
104+
The shared service evicts owner locations after roughly an hour without durable
105+
session activity, even if plugin RPC or HTTP requests continue. Components use one
106+
deterministically identified, empty maintenance session per owner directory and
107+
rename it at startup and every ten minutes. Creation is idempotent, metadata and
108+
location are checked before renaming, and no model is prompted. Requests have a
109+
15-second deadline, never overlap, and require a matching service PID. Standalone
110+
servers without a matching service registration skip this mechanism; use the
111+
shared service for unattended automation.
112+
113+
SDK adapters may ignore AbortSignal. The plugin therefore bounds its own SDK waits,
114+
preserves healthy worker execution on owner disposal, and settles local state writes
115+
before releasing ownership. A replacement waits up to 15 seconds for the retiring
116+
owner's locks. RPC disposal has a five-second deadline per component; cleanup still
117+
attempts every remaining step. No live lock is forcibly removed. A held-lock startup
118+
error should be investigated via plugin details and server logs. Back up the queue,
119+
worktree, and session database before recovery. Reconcile an already-published PR
120+
and saved session instead of restarting implementation or deleting the worktree.
117121

118122
Only one issue executes at a time. Checks must succeed before publication. Push
119123
uses the exact verified commit without force. Worktrees remain available for

‎docs/architecture.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ The primary checkout owns scheduling. Worker worktrees do not start additional
4242
schedulers. A shared Git-directory state folder holds the queue and locks; separate
4343
machines require separate test repositories to avoid duplicate execution.
4444

45-
In the shared background service, each scheduler/dispatcher component sends a
46-
periodic request back to its owner location to prevent idle eviction while work
47-
runs elsewhere. It checks the service PID before touching the location, so a
48-
standalone instance cannot activate another owner in a different service.
49-
Shutdown settles work and attempts all cleanup steps, including lock release,
50-
even if an SDK registration fails to dispose after location eviction.
45+
In the shared background service, each scheduler/dispatcher component renews one
46+
empty maintenance session in the owner location at startup and every ten minutes.
47+
OpenCode counts durable session events as activity; polling plugin APIs alone
48+
does not prevent its hourly inactivity eviction. No model is prompted by keepalive.
49+
The service PID must match the plugin process before any maintenance session is
50+
created. Shutdown releases local SDK waits independently of adapter cancellation,
51+
settles state writes, bounds RPC disposal, and releases locks. A healthy worktree
52+
session continues and the replacement owner reconciles its saved identity.
5153

5254
See [advanced configuration](advanced.md) for retry commands, limits, and RPC
5355
settings, and the [README](../README.md) for installation and user-facing behavior.

‎docs/bot-workflow.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,22 @@ flowchart TD
3535
cancel accepted work or active sessions.
3636
- A scan cannot overlap another scan in the same dispatcher. Only one worker
3737
invocation runs at a time; one scheduler job cannot overlap itself.
38-
- Each component refreshes the owner through the matching background service's
39-
plugin-list API every 30 seconds. A PID check prevents activating a second
40-
owner in another service. Requests do not overlap and have a 15-second deadline.
41-
This heartbeat keeps the owner loaded while execution happens in worktrees;
42-
pausing issue scans does not pause it. Standalone servers without a matching
43-
registered service skip the refresh.
38+
- Each component renews one empty owner maintenance session at startup and every
39+
ten minutes. Durable session events refresh OpenCode's inactivity timer; listing
40+
plugins does not. No model is prompted. A PID check prevents touching a different
41+
service. Requests do not overlap and have a 15-second deadline. Pausing issue
42+
scans does not pause keepalive. Standalone servers without a matching registered
43+
service skip it.
4444
- State is schema-validated and saved through a temporary file, file sync, and
4545
rename. A corrupt state file fails to load rather than resetting the queue.
4646
Local locks prevent duplicate owners sharing this state directory; independent
4747
machines do not share ownership.
48-
- Shutdown clears timers, aborts operations, waits for in-flight work, disposes
49-
registrations, and releases locks. Cleanup attempts the remaining steps even
50-
if an earlier step fails, so an evicted RPC registration cannot skip lock
51-
release. Executor shutdown interrupts its task session.
48+
- Shutdown clears timers and aborts local SDK waits even if the adapter ignores
49+
cancellation. It settles local writes, bounds RPC disposal to five seconds per
50+
component, and attempts all cleanup steps before releasing ownership. A replacement
51+
waits up to 15 seconds for locks without removing them. Healthy worktree sessions
52+
continue; the next owner reconciles the saved session before verifying and publishing.
53+
5254

5355
Sources: [index.ts](../src/index.ts), [easy.ts](../src/easy.ts),
5456
[GitHub plugin](../src/plugins/github.ts),

‎docs/runtime.md‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ After restarting the service, load the owner project again to resume polling.
4646
No terminal UI is needed to answer in GitHub.
4747

4848
The automation owner must remain loaded while its worktree sessions run. In the
49-
shared background service, the plugin refreshes the owner location every 30
50-
seconds, independently of issue polling and its pause setting. This prevents
51-
idle owner eviction from disconnecting worker hooks and publication. The refresh
52-
only targets a service whose PID matches the plugin process; standalone servers
53-
without a matching registered service do not receive this heartbeat.
49+
shared background service, keepalive runs at startup and every ten minutes,
50+
independently of issue polling and its pause setting. It reuses one empty session
51+
named `Automation owner keepalive` in the primary checkout. The session has no
52+
messages, consumes no model tokens, and is not an issue task. Its durable rename
53+
event refreshes OpenCode's activity timer; requests to list plugins do not.
54+
Keepalive only targets a service whose PID matches the plugin process. Standalone
55+
servers without a matching registered service do not receive this protection.
56+
57+
On owner reload, the dispatcher stops waiting locally and releases its lock without
58+
interrupting a healthy worker. The next owner reconnects to the saved session ID,
59+
checks its outcome, verifies the changes, and resumes publication. Explicit task
60+
cancellation, unanswered questions, and session deadlines still interrupt workers.
5461

5562
If the plugin reports a held lock or a worker reports unavailable automation RPC,
5663
inspect plugin details, logs, and queue state before retrying. Preserve the

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode2-automation",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "Issue-to-PR automation for OpenCode 2 with a scheduler and GitHub dispatcher",
55
"main": "./dist/index.js",
66
"files": [

‎src/dispatcher.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export class Dispatcher {
7777
this.signal.throwIfAborted();
7878
let announce = false;
7979
await this.serial.run(async () => {
80+
this.signal.throwIfAborted();
8081
announce = Boolean(patch.sessionReady && !task.sessionReady) || Boolean(patch.status && patch.status !== task.status && ["done", "blocked", "failed", "waiting"].includes(patch.status));
8182
announce ||= patch.pr?.state === "closed" && task.pr?.state !== "closed";
8283
if (patch.sessionID) task.sessionIDs = [...new Set([...task.sessionIDs ?? [], ...[task.previousSessionID, task.sessionID, patch.sessionID].filter((id): id is string => Boolean(id))])];

0 commit comments

Comments
 (0)