toolroll 0.9.125 → 0.9.127

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +1 -1
  3. package/dist/agent-detect.js +23 -3
  4. package/dist/assignment.js +14 -4
  5. package/dist/bounded-spawn.js +5 -36
  6. package/dist/browser/workspace.css +1 -1
  7. package/dist/browser/workspace.js +29 -29
  8. package/dist/browser-open.js +49 -0
  9. package/dist/chat-acceptance.js +1 -1
  10. package/dist/check-only.js +1 -1
  11. package/dist/cli.js +2 -2
  12. package/dist/connect-cli.js +2 -8
  13. package/dist/contracts/engine-api.js +8 -0
  14. package/dist/direct-chat.js +26 -18
  15. package/dist/doctor.js +30 -3
  16. package/dist/easy-start.js +44 -17
  17. package/dist/engine-reads.js +34 -1
  18. package/dist/evals.js +17 -19
  19. package/dist/first-run.js +5 -1
  20. package/dist/flexible-conversation.js +79 -1
  21. package/dist/flexible-import.js +162 -4
  22. package/dist/flexible-save.js +51 -4
  23. package/dist/flexible-session.js +34 -8
  24. package/dist/flexible-start.js +2 -1
  25. package/dist/flow-code.js +2 -2
  26. package/dist/invoke.js +4 -4
  27. package/dist/landed-rows.js +138 -0
  28. package/dist/laptop-background.js +2 -11
  29. package/dist/linux-packages.js +46 -0
  30. package/dist/local-landing.js +46 -7
  31. package/dist/merge-checklist.js +62 -8
  32. package/dist/operate.js +90 -33
  33. package/dist/preflight.js +14 -0
  34. package/dist/process-identity.js +155 -0
  35. package/dist/quick-start.js +6 -1
  36. package/dist/release.js +8 -0
  37. package/dist/result-follow-ups.js +8 -1
  38. package/dist/revision-catch-up.js +98 -0
  39. package/dist/runner-process.js +9 -25
  40. package/dist/sandbox-launch.js +3 -2
  41. package/dist/sandbox-runtime.js +115 -15
  42. package/dist/sandbox-tools.js +91 -6
  43. package/dist/server/direct-chat.js +4 -3
  44. package/dist/server/engine-api.js +13 -8
  45. package/dist/server/merge-ready-view.js +4 -2
  46. package/dist/server/pages.js +5 -2
  47. package/dist/server/render-pages.js +1 -0
  48. package/dist/server/render-results.js +9 -7
  49. package/dist/server/render-tasks.js +2 -2
  50. package/dist/server/task-views.js +16 -9
  51. package/dist/server/tasks.js +2 -2
  52. package/dist/shown-text.js +14 -0
  53. package/dist/skill-library.js +2 -12
  54. package/dist/status-probe.js +32 -0
  55. package/dist/task-base.js +13 -2
  56. package/dist/task-status.js +18 -8
  57. package/dist/teardown-git.js +6 -0
  58. package/dist/telegram-status.js +1 -1
  59. package/dist/toolroll-update-cli.js +2 -1
  60. package/dist/toolroll-update.js +4 -0
  61. package/dist/trust-repair.js +187 -0
  62. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  63. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  64. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  65. package/dist/tui/linux-x64/toolroll-tui +0 -0
  66. package/dist/unreachable.js +15 -0
  67. package/dist/work-index.js +51 -3
  68. package/dist/workspace-ui.js +4 -2
  69. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,70 @@ Each release opens with one line on its theme, then **New**, **Changed**, **Fixe
4
4
  the ones it has). Each item is at most two lines and says where to find it. Notes for maintainers (CI, the release
5
5
  tooling) go on the GitHub release, not here. Entries before 0.9.104 use the older format.
6
6
 
7
+ ## 0.9.127 — 2026-11-26
8
+
9
+ Two tasks built from the same main can both land; a thread's leftover edits are saved; accepted work reads accepted.
10
+
11
+ ### Changed
12
+
13
+ - **Send back brings work behind main up to date**: Toolroll merges the current main into the new attempt before
14
+ the agent starts, so it can land. If main conflicts, the task page and `task land` say to merge it by hand.
15
+ - **The workbench offers Send back (r)** on accepted work that is behind main.
16
+ - **Accepted work reads accepted**: "Can I merge?" agrees with Land, "No check is set" is a note rather than a
17
+ blocker, and Looks right / Not right go away once you've accepted it.
18
+ - **Landed work shows "Landed on main (sha)"** in the workbench list and detail, `task list`, and first in `task
19
+ show`. Pressing B on it says it's already landed.
20
+ - **Attempts count the same everywhere**: the third build of a task is "attempt 3" in the workbench and on the web.
21
+ - **Checks read "out of date"** when the check command changed after a failed run.
22
+
23
+ ### Fixed
24
+
25
+ - **Saving a thread after it ends keeps edits its agent left uncommitted**, and ending a thread says when it left
26
+ some. "Already saved" now appears only when nothing new is left.
27
+ - **An ended thread's transcript** shows the replies and work steps you saw live.
28
+ - **A new thread's Diff tab** no longer shows the previously selected task's diff.
29
+ - **The approval card for a send back** shows the note you typed.
30
+ - **`toolroll verify set`** with no password says to run `toolroll password set` first, without prompting.
31
+ - **`toolroll update` offline** says it couldn't reach the release server and that nothing changed.
32
+ - **`toolroll open --web`** with no working browser says what to do next.
33
+ - **The workbench** leaves the screen on a fresh line, and a refusal too long for the status line opens in full.
34
+
35
+ ## 0.9.126 — 2026-11-26
36
+
37
+ Toolroll starts on more machines and says exactly what to fix when it can't; finished work reads finished everywhere.
38
+
39
+ ### New
40
+
41
+ - **Run checks again from the workbench** (in the palette) on accepted work whose checks are out of date or failed.
42
+ - **One check at the first start** lists everything that would stop Toolroll (sandbox tools, a sandbox that can't
43
+ start, git version, process start times), each with its fix, before anything is created.
44
+
45
+ ### Changed
46
+
47
+ - **Landed work says "Landed on main (sha)"** at the top of the task page, in `task show` and in the CLI, and no longer
48
+ asks "Can I merge?" or offers Send back. "Behind main" is gone from landed work.
49
+ - **Checks out of date** (the check command changed) show as out of date, not failed or unreadable, in the task list,
50
+ the workbench and the task page; the web keeps Run checks on the top card after a failed re-check.
51
+ - **Install lines use this machine's package manager** (apt, dnf, zypper, pacman, apk), with `sudo` only when needed.
52
+ - **When the sandbox can't start** (Docker, devcontainers), Toolroll says the cause only when it can see it, with the
53
+ options and what each one weakens.
54
+
55
+ ### Fixed
56
+
57
+ - **Linux installs with a group-writable folder** (Ubuntu/Fedora with nvm or a user npm folder) get the exact repair
58
+ for each path instead of a password-only start; untrusted system programs are named with a real reinstall command.
59
+ - **Fedora, minimal Debian and Alpine** no longer need `ps` to start.
60
+ - **Servers and SSH sessions** no longer crash for want of a browser: Toolroll shows the address; a browser you chose
61
+ still opens.
62
+ - **Running `toolroll` without a terminal** no longer creates a password install behind your back.
63
+ - **The workbench diff** shows the new revision's changes once it's ready; a Direct Chat whose changes couldn't be read
64
+ says so instead of "No changes".
65
+ - **`toolroll update` with no database** says so before doing anything.
66
+
67
+ ### Action needed
68
+
69
+ - Native Windows isn't supported: use WSL 2. 32-bit Linux isn't supported.
70
+
7
71
  ## 0.9.125 — 2026-11-26
8
72
 
9
73
  Everything in 0.9.124, which was tagged but never reached npm.
package/README.md CHANGED
@@ -31,7 +31,7 @@ For Claude Code, Codex, and Gemini — using the subscriptions already on your m
31
31
 
32
32
  ### CLI & Terminal Workbench (macOS or Linux)
33
33
 
34
- Requires Node.js 22.20+, git 2.41+, and Claude Code (`claude`), Codex (`codex`), or Gemini signed in on this computer. On Linux, also install the sandbox tools: `sudo apt update && sudo apt install bubblewrap socat ripgrep`.
34
+ Requires Node.js 22.20+, git 2.41+, and Claude Code (`claude`), Codex (`codex`), or Gemini signed in on this computer. On Linux (64-bit), also install the sandbox tools: `sudo apt update && sudo apt install bubblewrap socat ripgrep bash debianutils` (other distributions: [Linux](docs/guide/linux.md#install-the-sandbox-tools)). Windows isn't supported; use WSL 2.
35
35
 
36
36
  ```sh
37
37
  curl -fsSL https://raw.githubusercontent.com/ap9000/toolroll/main/install.sh | sh
@@ -4,7 +4,9 @@ import { delimiter, isAbsolute, join } from "node:path";
4
4
  import { ACP_AGENTS, ACP_PROVIDER_IDS, isAcpProvider } from "./acp-agents.js";
5
5
  import { inspectAcpAgent } from "./acp-inspect.js";
6
6
  import { resolveExecutable } from "./attest.js";
7
- import { statusProbe, STATUS_TIMEOUT_MS } from "./status-probe.js";
7
+ import { excludedFolders, statusBinaryDiagnosis, statusProbe, STATUS_TIMEOUT_MS } from "./status-probe.js";
8
+ import { platformAcl } from "./trusted-path.js";
9
+ import { shownText } from "./shown-text.js";
8
10
  import { keyStatus, OWN_KEY_ENV, readAuthMode } from "./keys.js";
9
11
  import { createConnectionChecker } from "./provider-connection.js";
10
12
  export const DETECT_TIMEOUT_MS = STATUS_TIMEOUT_MS;
@@ -86,15 +88,25 @@ export async function detectAgents(options = {}) {
86
88
  return present(join(home, ".gemini", "oauth_creds.json")) ? out("signed-in", "Google account") : out("signed-out");
87
89
  }
88
90
  const answer = await within(check(row.id).then(value => value), timeoutMs, null);
91
+ const unknown = async () => {
92
+ const why = await (options.trustProblem ?? defaultTrustProblem)(row.binary);
93
+ return why === null ? out("unknown") : { ...out("unknown"), next: why };
94
+ };
95
+ const defaultTrustProblem = async (binary) => {
96
+ const untrusted = await excludedFolders({ store: options.store, databaseFile: options.databaseFile }, options.untrusted?.() ?? []);
97
+ if (untrusted === null)
98
+ return null;
99
+ return agentTrustWords(statusBinaryDiagnosis(binary, { path, uid: process.getuid?.(), untrusted, acl: platformAcl() }));
100
+ };
89
101
  if (answer === null)
90
- return out(resolved === null ? "not-installed" : "unknown");
102
+ return resolved === null ? out("not-installed") : unknown();
91
103
  if (answer.state === "not-installed" || (KEY_ANSWERS.has(answer.state) && resolved === null))
92
104
  return out("not-installed");
93
105
  if (answer.launchIssue === "command-not-found")
94
106
  return { ...out("unknown"), next: "The status command exited with code 127. Check that the agent and its helpers are on Toolroll's trusted PATH." };
95
107
  if (SIGNED_IN.has(answer.state))
96
108
  return out("signed-in", KEY_ANSWERS.has(answer.state) ? "API key" : answer.method ?? "signed in");
97
- return out(SIGNED_OUT.has(answer.state) ? "signed-out" : "unknown");
109
+ return SIGNED_OUT.has(answer.state) ? out("signed-out") : unknown();
98
110
  };
99
111
  const seen = await Promise.all(DETECTED_AGENTS.map(row => one(row).catch(() => ({ id: row.id, name: row.name, state: "unknown", how: null, signIn: row.signIn, ready: false, next: null }))));
100
112
  const agents = seen.map(agent => withNext(agent, routed, options.acpChecked));
@@ -252,3 +264,11 @@ export function npmRegistryOf(home, pkg) {
252
264
  return { url: null, unsure };
253
265
  return { url: `${url.protocol}//${url.host}${url.pathname}`.replace(/[\u0000-\u001f\u007f]/g, ""), unsure };
254
266
  }
267
+ export function agentTrustWords(diagnosis) {
268
+ if (diagnosis === null)
269
+ return null;
270
+ const commands = diagnosis.repair?.commands ?? [];
271
+ const fix = commands.length > 0 ? ` Fix it: run ${commands.map(one => `\`${one}\``).join(", then ")}, then \`toolroll agents\` to check again.`
272
+ : " Reinstall it into a folder only you can change.";
273
+ return shownText(`Toolroll won't run its sign-in check: ${diagnosis.why}.${fix}`);
274
+ }
@@ -92,6 +92,10 @@ export function assignmentChecksForRun(given, root, runId, now, asOf) {
92
92
  const batch = waitingBatch ? { state: "waiting", tested: null, peers: [] }
93
93
  : sealedBatch !== null && latest !== undefined ? { state: sealedBatch.mode, tested: latest.tested ?? sealedBatch.tested,
94
94
  peers: sealedBatch.members.filter(one => one.run !== runId).map(one => one.task) } : null;
95
+ if (latest?.state === "failed" && latest.outdated === true && read.status === "failed") {
96
+ return { ...own, running: read.running, ...(batch === null ? {} : { batch }), status: "unavailable", cause: "command-changed", level: read.level, exitCode: null,
97
+ logArtifactId: latest.logArtifactId ?? own.logArtifactId, detail: "The check command changed since this check." };
98
+ }
95
99
  return { ...own, running: read.running, ...(batch === null ? {} : { batch }),
96
100
  ...(changed ? { status: read.status, level: read.level, exitCode: read.exitCode, logArtifactId: latest?.logArtifactId ?? own.logArtifactId,
97
101
  detail: read.status === "passed" ? `${words} passed.` : `${words} failed (exit ${read.exitCode}).` } : {}) };
@@ -261,8 +265,9 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
261
265
  : completionKind === "accepted-exception" ? "An operator accepted this result with its recorded limitations. The lead can inspect that decision; the recorded checks are unchanged."
262
266
  : receipt.checks.detail;
263
267
  primaryAction = { code: "open-result", label: completionKind === "research-report" ? "Read report" : "Open result", target: { taskId: current.id, runId: result.id, decisionId: null }, access: "read", retry: "read-again" };
264
- const exact = store.handle.prepare("SELECT actor,at,detail FROM action_ledger WHERE task_id = ? AND run_id = ? AND action = ? AND outcome = ? AND source = 'work' ORDER BY id DESC")
265
- .all(family.root.id, result.id, CHECK_ACTION, receipt.digest).find(row => COMPLETER_ACTOR.test(String(row["actor"])));
268
+ const exactRows = store.handle.prepare("SELECT actor,at,detail FROM action_ledger WHERE task_id = ? AND run_id = ? AND action = ? AND outcome = ? AND source = 'work' ORDER BY id DESC")
269
+ .all(family.root.id, result.id, CHECK_ACTION, receipt.digest);
270
+ const exact = exactRows.find(row => COMPLETER_ACTOR.test(String(row["actor"])));
266
271
  const historical = exact !== undefined ? undefined : store.handle.prepare("SELECT actor,at,detail,outcome FROM action_ledger WHERE task_id = ? AND run_id = ? AND action = ? AND source = 'work' ORDER BY id DESC LIMIT 3")
267
272
  .all(family.root.id, result.id, CHECK_ACTION).filter(row => COMPLETER_ACTOR.test(String(row["actor"])) && !Number.isNaN(Date.parse(String(row["at"]))))
268
273
  .find(row => sealFor(assignmentChecksForRun(store, root, result.id, now, new Date(String(row["at"]))), new Date(String(row["at"]))).receipt?.digest === String(row["outcome"]));
@@ -271,8 +276,12 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
271
276
  const rootRef = store.lookupRef(family.root.id);
272
277
  const byLead = rootRef !== null && olderStoreSafe(() => store.taskActs(rootRef.id), []).filter(one => one.act === "completed").at(-1)?.lead === true;
273
278
  const landed = landedReasonOf(String(checked["actor"]), checked["detail"] == null ? null : String(checked["detail"]));
279
+ const byPerson = (row) => String(row["actor"]).startsWith("operator:") && row["detail"] === COMPLETION_BY_PERSON;
280
+ const personRow = exact === undefined ? (byPerson(checked) ? checked : undefined) : byPerson(exact) ? exact : exactRows.find(byPerson);
281
+ const person = personRow === undefined ? null : String(personRow["actor"]).slice("operator:".length);
274
282
  completion = { actor: String(checked["actor"]), at: String(checked["at"]), digest: exact === undefined ? String(checked["outcome"]) : receipt.digest,
275
- ...(byLead && landed === null ? { lead: true } : {}), ...(landed === null ? {} : { landed }), ...(exact === undefined ? { historical: true } : {}) };
283
+ ...(byLead && landed === null ? { lead: true } : {}), ...(landed === null ? {} : { landed }), ...(exact === undefined ? { historical: true } : {}),
284
+ ...(person === null ? {} : { person }) };
276
285
  state = "complete";
277
286
  primaryAction = { ...primaryAction, label: completionKind === "research-report" ? "Read report" : "Open result" };
278
287
  const label = byLead ? "the lead" : completion.actor.startsWith("operator:") ? completion.actor.slice(9) : owner && completion.actor === actorOf(owner) ? owner.label : "the previous lead";
@@ -472,7 +481,8 @@ function acknowledgeCurrent(store, current, receiptDigest, actor, now, root, acc
472
481
  store.noteTaskAct(ref.id, "completed", now, undefined, by);
473
482
  store.bumpWake();
474
483
  }
475
- else if (person !== null && personCompletionOwed(store, receipt.taskId, receipt.runId, receiptDigest, person, root)) {
484
+ else if (person !== null && (personCompletionOwed(store, receipt.taskId, receipt.runId, receiptDigest, person, root)
485
+ || (current.completion !== null && current.completion.digest === receiptDigest && current.completion.historical !== true && current.completion.person === undefined))) {
476
486
  store.recordAction({ at: now.toISOString(), actor, repo: current.repo,
477
487
  taskId: current.rootId, runId: receipt.runId, action: CHECK_ACTION, outcome: receiptDigest, source: "work", detail: COMPLETION_BY_PERSON });
478
488
  store.bumpWake();
@@ -1,6 +1,7 @@
1
- import { execFile, execFileSync, spawn } from "node:child_process";
1
+ import { spawn } from "node:child_process";
2
2
  import { lstatSync, readdirSync, rmSync } from "node:fs";
3
3
  import { join, relative, isAbsolute } from "node:path";
4
+ import { processGroupId, processGroupRss, processIdentity, sameProcess } from "./process-identity.js";
4
5
  import { createContainer, effectiveContainment, probeContainmentCapability } from "./containment.js";
5
6
  const SAMPLE_MS = 250;
6
7
  const PIDS = 64;
@@ -9,42 +10,10 @@ let containment = null;
9
10
  const preferred = () => containment ??= effectiveContainment("preferred", probeContainmentCapability());
10
11
  export function resetBoundedContainmentForTests() { containment = null; }
11
12
  export function processStartedAt(pid) {
12
- if (process.platform === "win32")
13
- return null;
14
- try {
15
- return execFileSync("ps", ["-o", "lstart=", "-p", String(pid)], { encoding: "utf8", timeout: 2_000, stdio: ["ignore", "pipe", "ignore"] }).trim() || null;
16
- }
17
- catch {
18
- return null;
19
- }
20
- }
21
- function processGroupOf(pid) {
22
- if (process.platform === "win32")
23
- return null;
24
- try {
25
- const group = Number(execFileSync("ps", ["-o", "pgid=", "-p", String(pid)], { encoding: "utf8", timeout: 2_000, stdio: ["ignore", "pipe", "ignore"] }).trim());
26
- return Number.isInteger(group) && group > 1 ? group : null;
27
- }
28
- catch {
29
- return null;
30
- }
13
+ return processIdentity(pid);
31
14
  }
32
15
  function groupRss(pgid) {
33
- return new Promise(done => {
34
- execFile("ps", ["-A", "-o", "pgid=,rss="], { encoding: "utf8", timeout: 2_000, maxBuffer: 4 * 1024 * 1024 }, (error, stdout) => {
35
- if (error !== null) {
36
- done(null);
37
- return;
38
- }
39
- let kilobytes = 0;
40
- for (const line of stdout.split("\n")) {
41
- const [group, rss] = line.trim().split(/\s+/);
42
- if (Number(group) === pgid)
43
- kilobytes += Number(rss) || 0;
44
- }
45
- done(kilobytes * 1024);
46
- });
47
- });
16
+ return Promise.resolve().then(() => processGroupRss(pgid));
48
17
  }
49
18
  export function folderBytes(folder) {
50
19
  let total = 0;
@@ -178,7 +147,7 @@ export const boundedRun = async (file, args, options) => {
178
147
  };
179
148
  export function cleanupLeftover(record, root) {
180
149
  let killed = false, removed = false;
181
- if (record.pid !== null && record.pgid !== null && record.startedAt !== null && processStartedAt(record.pid) === record.startedAt && processGroupOf(record.pid) === record.pgid) {
150
+ if (record.pid !== null && record.pgid !== null && record.startedAt !== null && sameProcess(record.pid, record.startedAt) === "same" && processGroupId(record.pid) === record.pgid) {
182
151
  killGroup(record.pgid);
183
152
  killed = true;
184
153
  }