@sorenllm/opencode-forge 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -265,7 +265,7 @@ the stdio-EOF bug):
|
|
|
265
265
|
| --- | --- | --- | --- |
|
|
266
266
|
| process exit | — | final; exit code + output tail returned | **terminal evidence** — output delivered in full; the job self-clears from the registry (no wake, no clear needed) |
|
|
267
267
|
| `success_pattern` regex matches new output | opt-in | completes as success; process kept alive by default (server semantics), `keep_alive: false` kills its tree | kept alive → later exit still wakes (the server dying is real news); killed inline → self-clears |
|
|
268
|
-
| `idle_ms` with no new output | default 60000 | early return `still-running` + `jobId`; process stays alive | later exit queues a wake
|
|
268
|
+
| `idle_ms` with no new output | default 60000 | early return `still-running` + `jobId`; process stays alive | later exit queues a wake — unless a poll has already read the terminal state (a terminal poll consumes the entry); stays listed until then |
|
|
269
269
|
| `max_wait_ms` hard cap | default 120000, max 600000 | early return `still-running`; never kills | same as idle |
|
|
270
270
|
|
|
271
271
|
`run_in_background: true` skips all waiting and returns
|
|
@@ -292,7 +292,11 @@ idle (exactly once; `notify: false` opts out per job). A foreground call
|
|
|
292
292
|
resolved on the exit event is terminal evidence: the caller already holds
|
|
293
293
|
the complete output, so no wake fires and the registry entry self-clears —
|
|
294
294
|
a stale `poll`/`kill`/`clear` on such an id answers "already consumed"
|
|
295
|
-
instead of "unknown job".
|
|
295
|
+
instead of "unknown job". The same consumption applies to a poll that
|
|
296
|
+
observes a finished job: the poll itself delivered the exit status and the
|
|
297
|
+
drained output, so the queued wake is dropped and the entry self-clears —
|
|
298
|
+
no duplicate notification, no manual clear. Wakes fire only for
|
|
299
|
+
completions that were never read.
|
|
296
300
|
|
|
297
301
|
**Ownership.** Jobs belong to the session that created them. Session
|
|
298
302
|
deleted → its live session-scoped jobs are killed and the event is recorded
|
package/dist/index.js
CHANGED
|
@@ -13449,8 +13449,11 @@ function createJobManager(opts = {}) {
|
|
|
13449
13449
|
markTerminal(job, "killed", null);
|
|
13450
13450
|
}
|
|
13451
13451
|
function poll(job) {
|
|
13452
|
-
if (isTerminal2(job))
|
|
13452
|
+
if (isTerminal2(job)) {
|
|
13453
13453
|
job.readAfterEnd = true;
|
|
13454
|
+
jobs.delete(job.id);
|
|
13455
|
+
rememberConsumed(job.id);
|
|
13456
|
+
}
|
|
13454
13457
|
const cursor = job.outLen;
|
|
13455
13458
|
const start = job.pollCursor;
|
|
13456
13459
|
const newOutput = sliceFromCursor(job, start);
|
|
@@ -16242,7 +16245,7 @@ ${r.outputTail || "(none yet)"}`,
|
|
|
16242
16245
|
});
|
|
16243
16246
|
var FORGE_JOBS_ACTIONS = ["list", "poll", "log", "kill", "clear", "handoff"];
|
|
16244
16247
|
var forgeJobsTool = tool({
|
|
16245
|
-
description: "Manage forge_shell jobs. Actions: list (all jobs, newest first); poll {jobId, waitMs<=30000} — bounded wait for NEW output or exit, drains it; log {jobId, offset?, limit?} — line paging over the on-disk log (omitted offset = tail window, default 200 lines); kill {jobId} — terminate the job's whole process tree; clear {jobId} — drop a finished job from the registry (only early-returned/background jobs need this — synchronously consumed jobs self-clear at completion); handoff {jobId} — rebind ownership to the root session so the job survives this (sub)session's end. A delegated agent MUST poll its jobs before yielding its conclusion.",
|
|
16248
|
+
description: "Manage forge_shell jobs. Actions: list (all jobs, newest first); poll {jobId, waitMs<=30000} — bounded wait for NEW output or exit, drains it (polling a finished job consumes it: the entry self-clears and no wake fires); log {jobId, offset?, limit?} — line paging over the on-disk log (omitted offset = tail window, default 200 lines); kill {jobId} — terminate the job's whole process tree; clear {jobId} — drop a finished job from the registry (only un-polled early-returned/background jobs need this — synchronously consumed jobs self-clear at completion, and a terminal poll consumes the entry); handoff {jobId} — rebind ownership to the root session so the job survives this (sub)session's end. A delegated agent MUST poll its jobs before yielding its conclusion.",
|
|
16246
16249
|
args: {
|
|
16247
16250
|
action: tool.schema.string().describe(`One of: ${FORGE_JOBS_ACTIONS.join(", ")}`),
|
|
16248
16251
|
jobId: tool.schema.string().optional().describe("Job id from forge_shell (required for every action except list)"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorenllm/opencode-forge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Single general-purpose forge agent for opencode: static worker subagents defined in forge.json (pinned model + thoughtLevel pair, or an Auto worker inheriting the parent model; dispatched through the native task tool — TUI-visible), a plan harness (file-backed plans with approve/close confirmation gates and a hard draft write-ban), a goal harness (autonomous, host-verified objectives), a /crew orchestration command (declared-plan waves with an evidence-checked close gate), a job supervisor (forge_shell with exit-bound completion, idle/success early return, background jobs with poll/log/kill/handoff), and a builtin-shell hang watchdog.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|