toolroll 0.9.110 → 0.9.111

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 (51) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +5 -1
  3. package/THIRD_PARTY_NOTICES.md +30 -0
  4. package/dist/agent-detect.js +1 -1
  5. package/dist/agent-said-schema.js +4 -0
  6. package/dist/agent-said.js +23 -0
  7. package/dist/approval-summary.js +39 -8
  8. package/dist/browser/THIRD_PARTY_NOTICES.txt +30 -0
  9. package/dist/builder.js +6 -1
  10. package/dist/claim.js +28 -13
  11. package/dist/cli-help.js +1 -1
  12. package/dist/codex-limits.js +21 -8
  13. package/dist/console-instance.js +2 -1
  14. package/dist/contracts/console-api.js +3 -2
  15. package/dist/contracts/engine-api.js +15 -3
  16. package/dist/contracts/route.js +1 -0
  17. package/dist/dispatch.js +1 -1
  18. package/dist/dispose.js +15 -9
  19. package/dist/easy-start.js +15 -1
  20. package/dist/engine-reads.js +79 -2
  21. package/dist/fast-start.js +20 -11
  22. package/dist/flexible-start.js +1 -1
  23. package/dist/integrations.js +6 -1
  24. package/dist/local-owner.js +1 -0
  25. package/dist/needs-you.js +2 -0
  26. package/dist/operate.js +55 -8
  27. package/dist/phase-routing.js +3 -1
  28. package/dist/plane-review.js +1 -1
  29. package/dist/proposal.js +2 -2
  30. package/dist/provider-connection.js +14 -2
  31. package/dist/route-store.js +1 -1
  32. package/dist/serve.js +5 -3
  33. package/dist/server/pages.js +4 -1
  34. package/dist/server/render-tasks.js +5 -2
  35. package/dist/server/route-table.js +2 -0
  36. package/dist/server/settings-section-table.js +3 -0
  37. package/dist/server/settings-sections.js +36 -0
  38. package/dist/server/settings.js +36 -0
  39. package/dist/server/tasks.js +31 -4
  40. package/dist/settings-proofs.js +1 -0
  41. package/dist/store.js +83 -11
  42. package/dist/task-sizing-schema.js +14 -0
  43. package/dist/task-sizing.js +76 -10
  44. package/dist/toolroll-update.js +3 -1
  45. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  46. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  47. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  48. package/dist/tui/linux-x64/toolroll-tui +0 -0
  49. package/dist/webhooks.js +8 -2
  50. package/dist/work-index.js +2 -2
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,44 @@ 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.111 — 2026-11-16
8
+
9
+ The terminal workbench, smoothed by five rounds of first-run testing: failures say why in the agent's own words,
10
+ and you can stop, resume, cancel and retry from the keyboard. Plus a layout pass: resize, collapse, zoom, jump to
11
+ what needs you.
12
+
13
+ ### New
14
+
15
+ - **Stop, resume and cancel from the workbench.** `x` stops a task that keeps retrying and resumes it; `X` cancels.
16
+ Each asks first and refuses if the task changed since you looked.
17
+ - **What the agent said.** When an agent fails, Live and Steps show its last lines, cleaned (no paths or keys);
18
+ they never leave Toolroll in chat, push, email or webhooks.
19
+ - **Layout keys.** `<` `>` resize the list or a split, `=` evens them, `b` cycles the list full, slim rail or hidden,
20
+ `z` zooms a panel; the list can sit on the right. Your view is remembered per project.
21
+ - **Jump to what needs you** with `!` and `@` (`'` jumps back), and finished tasks keep an unread dot until opened.
22
+ - **Search and edit.** `/` searches the focused pane; `Ctrl-E` opens its text in your editor, with modelines off.
23
+ - **Settings change in the workbench** (theme, density, glyphs, notifications), saved to `tui.toml`.
24
+ - **Task sizing by a quick model call is opt-in** (Settings → General). Off, nothing calls a model before you
25
+ approve, and uncertain tasks plan first. On, the card says which model sized it.
26
+
27
+ ### Changed
28
+
29
+ - **An agent that errors stops after one failure** and shows what it said; Retry starts it again. Machine
30
+ glitches still retry on their own, with "Last build failed · reason · next try in 40s".
31
+ - **Attempts are counted per task** ("attempt 2") everywhere you read them.
32
+ - **The approval card is shorter:** your usual settings are one line, `f` shows them all.
33
+ - **A signed-out agent is never started** in the background; status says "Codex · signed out (run `codex login`)".
34
+ - **Typing in a Terminal pane stays instant** while a build streams output (was up to a second behind).
35
+
36
+ ### Fixed
37
+
38
+ - **A filed task no longer disappears** from the list while it waits to retry.
39
+ - **First run** opens on "What would you like to work on?" instead of sending you to the browser.
40
+ - **A config folder path too long for the socket** is refused at once with the fix, not after 90 seconds.
41
+ - **Confirmations never take keys before they're drawn** (a tiny window could accept unseen).
42
+ - **Upgrading from the old `standing-orders` package:** the installer removes it first; the docs lead with
43
+ `npm uninstall -g standing-orders`.
44
+
7
45
  ## 0.9.110 — 2026-11-15
8
46
 
9
47
  A real terminal screen: run `toolroll` in a terminal and watch, steer, review and accept your agents' work there, in a
package/README.md CHANGED
@@ -40,10 +40,14 @@ curl -fsSL https://raw.githubusercontent.com/ap9000/toolroll/main/install.sh | s
40
40
  or
41
41
 
42
42
  ```sh
43
- npm install -g toolroll # or: brew install ap9000/toolroll/toolroll
43
+ npm uninstall -g standing-orders 2>/dev/null; npm install -g toolroll # or: brew install ap9000/toolroll/toolroll
44
44
  toolroll
45
45
  ```
46
46
 
47
+ The first command removes Toolroll's older package, `standing-orders`, if you
48
+ have it: npm can't install over it (it stops with `EEXIST: file already
49
+ exists … bin/standing-orders`). Without it, the command does nothing.
50
+
47
51
  Toolroll opens in your terminal and runs while that window is open. No
48
52
  password and no login file: on your own computer you're already in. Started
49
53
  in a git repository, that repository is your project; press `n` for a first
@@ -585,3 +585,33 @@ distributed under the License is distributed on an "AS IS" BASIS,
585
585
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586
586
  See the License for the specific language governing permissions and
587
587
  limitations under the License.
588
+
589
+ ## vt100 0.16.2 (Rust crate) — MIT
590
+
591
+ The terminal workbench's Terminal tab (the `toolroll-tui` binary) draws a take-over terminal through a vendored,
592
+ modified copy of vt100 0.16.2 by Jesse Luehrs (https://github.com/doy/vt100-rust), kept in `tui/vendor/vt100`. It
593
+ diverges from upstream in `grid.rs`, `row.rs` and `screen.rs` only: rows that scroll are reused and cleared only as
594
+ far as they were written, and one-row and one-column screens no longer overflow. `tui/vendor/vt100/README` lists the
595
+ exact changes.
596
+
597
+ The MIT License (MIT)
598
+
599
+ Copyright (c) 2016 Jesse Luehrs
600
+
601
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
602
+ this software and associated documentation files (the "Software"), to deal in
603
+ the Software without restriction, including without limitation the rights to
604
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
605
+ of the Software, and to permit persons to whom the Software is furnished to do
606
+ so, subject to the following conditions:
607
+
608
+ The above copyright notice and this permission notice shall be included in all
609
+ copies or substantial portions of the Software.
610
+
611
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
612
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
613
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
614
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
615
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
616
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
617
+ SOFTWARE.
@@ -165,7 +165,7 @@ const npm = (pkg) => ({ install: `npm install -g ${pkg}`, installRun: { binary:
165
165
  const ACP_CHECK = (id) => `toolroll agents check ${id} --model <model>`;
166
166
  export const AGENT_SETUP = Object.freeze({
167
167
  claude: { ...npm("@anthropic-ai/claude-code"), signIn: "claude auth login", signInRun: { binary: "claude", args: ["auth", "login"] }, key: null, check: null,
168
- note: "Flexible threads bill your Claude plan through Toolroll's relay, which needs a long-lived token: run `claude setup-token` in your own terminal (it prints the token, so Toolroll never runs it for you)." },
168
+ note: "Flexible threads (off for now) need `claude setup-token`." },
169
169
  codex: { ...npm("@openai/codex"), signIn: "codex login", signInRun: { binary: "codex", args: ["login"] }, key: null, check: null, note: null },
170
170
  gemini: { ...npm("@google/gemini-cli"), signIn: "gemini", signInRun: { binary: "gemini", args: [] },
171
171
  key: "Or run it on an API key: switch it with `toolroll keys auth gemini api-key`, then pipe the key in with `toolroll keys set gemini < key.txt` (or paste it in Settings → Agents in the browser).", check: null,
@@ -0,0 +1,4 @@
1
+ export const V170_ADDED_COLUMNS = Object.freeze({
2
+ run: { agent_said_json: { definition: "TEXT CHECK (agent_said_json IS NULL OR length(agent_said_json) BETWEEN 2 AND 4096)", saved: "NULL" } },
3
+ });
4
+ export const V170_STEPS = Object.freeze(["agent-said-column"]);
@@ -0,0 +1,23 @@
1
+ import { redactSecretLines, scanForSecrets } from "./evidence.js";
2
+ import { privateWords } from "./outbound-privacy.js";
3
+ export const AGENT_SAID_LINES = 8;
4
+ export const AGENT_SAID_CHARS = 200;
5
+ const ESCAPES = /\u001b\[[0-?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)|\u001b[@-_]/g;
6
+ const CONTROLS = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g;
7
+ const PATHS = /(^|[\s"'`(<[=:,])(?:(?:\/[^\s"'`)>\]/:,;]+){2,}\/?|\/[^\s"'`)>\]/:,;]*\.[^\s"'`)>\]/:,;]+|~[A-Za-z0-9._-]*\/[^\s"'`)>\]:,;]*|[A-Za-z]:[\\/][^\s"'`)>\]:,;]*)/g;
8
+ const URL_USERINFO = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@"'`<>]+@/gi;
9
+ const URL_QUERY = /\b([a-z][a-z0-9+.-]*:\/\/[^\s?#"'`<>]*)[?#][^\s"'`<>]*/gi;
10
+ export function agentSaidTail(text) {
11
+ if (text === null || text === undefined || text.trim() === "")
12
+ return [];
13
+ const plain = text.replace(ESCAPES, "").replace(/\r\n?/g, "\n").replace(/\t/g, " ").replace(CONTROLS, "");
14
+ const addresses = plain.split("\n").map(line => line.replace(URL_USERINFO, "$1[hidden]@").replace(URL_QUERY, "$1?[hidden]")).join("\n");
15
+ const redacted = redactSecretLines(addresses, scanForSecrets(addresses));
16
+ const lines = redacted.split("\n")
17
+ .map(line => line.split(/(\b[a-z][a-z0-9+.-]*:\/\/\S*)/i).map((part, at) => at % 2 === 1 ? part : part.replace(PATHS, "$1[path]")).join(""))
18
+ .map(line => line.replace(/\s+/g, " ").trim()).filter(line => line !== "");
19
+ return lines
20
+ .map(line => line.length <= AGENT_SAID_CHARS ? line : `${line.slice(0, AGENT_SAID_CHARS - 1).trimEnd()}…`)
21
+ .filter(line => !privateWords(line))
22
+ .slice(-AGENT_SAID_LINES);
23
+ }
@@ -5,7 +5,7 @@ import { permissionPlainWords, scopeFullAccess } from "./chat-terms.js";
5
5
  import { checkAccessWords } from "./check-access.js";
6
6
  import { networkWords, unaccountedHosts } from "./egress.js";
7
7
  import { agentModelName } from "./model-names.js";
8
- import { makesNoPlan, NO_READINESS, projectRoute, routeFromJson, sizeWords } from "./phase-routing.js";
8
+ import { makesNoPlan, NO_READINESS, PLANNED_FIRST_REASON, projectRoute, routeFromJson, sizeWords } from "./phase-routing.js";
9
9
  import { sandboxTermsWords } from "./project-sandbox.js";
10
10
  import { qualityModeTitle } from "./quality.js";
11
11
  import { approvalOf, chainTermsLines, describeApproval, liveChainFromJson, releaseAsksAgainWords, releaseCheckSentence, releaseTermsSentence } from "./scope.js";
@@ -48,6 +48,23 @@ function agentWords(route, profile) {
48
48
  const size = sizeWords(route);
49
49
  return size === null ? who : `${who} (${lowerFirst(size)})`;
50
50
  }
51
+ function timeWords(profile) {
52
+ if ("idleTimeoutSeconds" in profile)
53
+ return `${minutes(profile.timeoutSeconds)}, or ${minutes(profile.idleTimeoutSeconds)} silent`;
54
+ return `${minutes(profile.timeoutSeconds)} ${profile.timeoutKind === "idle" ? "without progress" : "per attempt"}`;
55
+ }
56
+ function usualSummaryOf(usual, profile) {
57
+ const has = (label) => usual.find(one => one.label === label);
58
+ const parts = [];
59
+ if (profile !== null && has("Reads") !== undefined && profile.fencePolicy === 2 && has("Project checks")?.words === checkAccessWords("sandboxed"))
60
+ parts.push("sandboxed");
61
+ if (profile !== null && has("Writes") !== undefined && profile.writes === "workspace")
62
+ parts.push("writes only its checkout");
63
+ const checks = has("Checks");
64
+ if (checks !== undefined)
65
+ parts.push(`${checks.words} checks`);
66
+ return parts.join(", ");
67
+ }
51
68
  function limitWords(profile) {
52
69
  if ("idleTimeoutSeconds" in profile)
53
70
  return `stops after ${minutes(profile.timeoutSeconds)}, or ${minutes(profile.idleTimeoutSeconds)} silent`;
@@ -141,15 +158,21 @@ export function approvalSummaryOf(scope, context = NO_CONTEXT) {
141
158
  decisions.push({ label: "Goal", words: scope.goal, fields: ["goal"] });
142
159
  if (scope.outOfScope !== null)
143
160
  decisions.push({ label: "Won’t touch", words: scope.outOfScope, fields: ["outOfScope"] });
161
+ const reviewOnly = scope.acceptance.length === 1 && scope.acceptance[0].statement.trim() === scope.goal.trim()
162
+ && scope.acceptance[0].evidence.length === 1 && scope.acceptance[0].evidence[0] === "manual-review";
144
163
  decisions.push(scope.acceptance.length === 0
145
164
  ? { label: "Done when", words: "You decide when you review the result.", fields: ["acceptance"] }
146
- : { label: "Done when", words: `${scope.acceptance[0].statement} (${scope.acceptance[0].evidence.map(kind => EVIDENCE_WORDS[kind] ?? kind).join(", ")})`,
147
- lines: scope.acceptance.slice(1).map(one => `${one.statement} (${one.evidence.map(kind => EVIDENCE_WORDS[kind] ?? kind).join(", ")})`), fields: ["acceptance"] });
165
+ : reviewOnly ? { label: "Done when", words: "You review the result", fields: ["acceptance"] }
166
+ : { label: "Done when", words: `${scope.acceptance[0].statement} (${scope.acceptance[0].evidence.map(kind => EVIDENCE_WORDS[kind] ?? kind).join(", ")})`,
167
+ lines: scope.acceptance.slice(1).map(one => `${one.statement} (${one.evidence.map(kind => EVIDENCE_WORDS[kind] ?? kind).join(", ")})`), fields: ["acceptance"] });
148
168
  if (scope.candidate)
149
169
  decisions.push({ label: "Commit", words: `${scope.candidate}, checked out as it is; no agent runs`, fields: ["candidate"] });
150
170
  const agent = agentWords(route, profile);
151
171
  if (agent !== null)
152
172
  decisions.push({ label: "Agent", words: agent, fields: [...(route === null ? [] : ["route", ...route.legs.map(leg => `route.${leg.phase}`)]), ...(profile === null ? [] : ["profile.provider", "profile.model"])] });
173
+ const sized = route?.size ?? null;
174
+ if (sized !== null && sized.source === "classifier" && sized.by !== undefined)
175
+ decisions.push({ label: "Sized by", words: sized.by, fields: ["route"] });
153
176
  const permissionKey = profile === null ? null : PERMISSION_KEYS.find(key => key in profile) ?? null;
154
177
  const tools = permissionPlainWords(profile);
155
178
  const usualTools = usualProfile === null ? null : permissionPlainWords(usualProfile);
@@ -163,7 +186,7 @@ export function approvalSummaryOf(scope, context = NO_CONTEXT) {
163
186
  decisions.push({ label: "Tools", words: `${tools}${usualTools !== null && usualTools !== tools ? " (not the project’s usual)" : ""}`,
164
187
  fields: permissionKey === null ? [] : [`profile.${permissionKey}`], ...(scopeFullAccess(profile) ? { risky: true } : {}) });
165
188
  }
166
- decisions.push({ label: "May cost", words: scope.budgetMicrousd === null ? "no cap: an attempt runs until it finishes or reaches its time limit" : `up to ${money(scope.budgetMicrousd)} per attempt; the agent is stopped there`,
189
+ decisions.push({ label: "May cost", words: scope.budgetMicrousd === null ? `No spend cap · stops at its time limit${profile === null ? "" : ` (${timeWords(profile)})`}` : `up to ${money(scope.budgetMicrousd)} per attempt; the agent is stopped there`,
167
190
  fields: ["budget"], ...(scope.budgetMicrousd === null ? { risky: true } : {}) });
168
191
  if (scope.releaseTerms != null) {
169
192
  const terms = scope.releaseTerms;
@@ -202,6 +225,9 @@ export function approvalSummaryOf(scope, context = NO_CONTEXT) {
202
225
  const chain = chainTermsLines(scope);
203
226
  if (chain.length > 0)
204
227
  warnings.push({ words: [...chain, ...fallbackDifferences(scope)].join(" "), fields: ["chain"] });
228
+ if (sized !== null && route !== null && sized.source === "heuristic" && sized.reason === PLANNED_FIRST_REASON && !makesNoPlan(sized, route.risk)) {
229
+ warnings.push({ words: "Planned first: task sizing is off (Settings → General)", fields: ["route"] });
230
+ }
205
231
  const rules = context.rules;
206
232
  if (rules !== null && isProtectedWork(rules, [...scope.touches]))
207
233
  warnings.push({ words: "This project protects this work: two people must approve it.", fields: [] });
@@ -213,9 +239,10 @@ export function approvalSummaryOf(scope, context = NO_CONTEXT) {
213
239
  if (context.revision?.problem != null)
214
240
  warnings.push({ words: `Toolroll can’t check what this revises (${context.revision.problem}), so no fix runs on its own.`, fields: [] });
215
241
  const usualLabel = context.usual === null ? OTHER_LABEL : USUAL_LABEL;
216
- const key = createHash("sha256").update(JSON.stringify({ v: 2, digest: scope.digest, revision, revisionChanges, decisions, differs, warnings, usual, usualLabel, baseline: context.usual }), "utf8").digest("hex").slice(0, 32);
242
+ const usualSummary = usualSummaryOf(usual, profile);
243
+ const key = createHash("sha256").update(JSON.stringify({ v: 3, digest: scope.digest, revision, revisionChanges, decisions, differs, warnings, usual, usualLabel, usualSummary, baseline: context.usual }), "utf8").digest("hex").slice(0, 32);
217
244
  const why = context.evidence == null || context.evidence === "" ? null : context.evidence.replace(/^Why this model: /, "");
218
- return { revision, revisionNotes, revisionChanges, decisions, why, differs, warnings, usual, usualLabel, key };
245
+ return { revision, revisionNotes, revisionChanges, decisions, why, differs, warnings, usual, usualLabel, usualSummary, key };
219
246
  }
220
247
  export function summaryFields(summary) {
221
248
  return new Set([...summary.decisions, ...summary.differs, ...summary.usual, ...summary.warnings].flatMap(one => one.fields));
@@ -250,7 +277,8 @@ export function summaryLines(summary) {
250
277
  ...(summary.why === null ? [] : [`${pad("Why model")}${summary.why}`]),
251
278
  ...summary.differs.flatMap(row),
252
279
  ...summary.warnings.map(one => `${pad("Note")}${one.words}`),
253
- ...(summary.usual.length === 0 ? [] : [`${pad("Usual")}${summary.usualLabel}: ${summary.usual.map(one => `${lowerFirst(one.label)} ${one.words}`).join(" · ")}`]),
280
+ ...(summary.usual.length === 0 ? [] : [`${pad("Usual")}${summary.usualSummary === "" ? summary.usualLabel : `${summary.usualLabel}: ${summary.usualSummary}`}`,
281
+ ...summary.usual.filter(one => !saidInUsualSummary(one, summary.usualSummary)).map(one => `${indent}${one.label}: ${one.words}`)]),
254
282
  ];
255
283
  }
256
284
  export function summaryText(summary, omit = () => false) {
@@ -340,5 +368,8 @@ export function approvalSummaryFor(store, taskId, now, evidence = null) {
340
368
  }
341
369
  export function shipSummaryOf(digest, decisions, warnings) {
342
370
  const key = createHash("sha256").update(JSON.stringify({ v: 2, kind: "flexible-ship", digest, decisions, warnings }), "utf8").digest("hex").slice(0, 32);
343
- return { revision: null, revisionNotes: [], revisionChanges: [], decisions, why: null, differs: [], warnings, usual: [], usualLabel: USUAL_LABEL, key };
371
+ return { revision: null, revisionNotes: [], revisionChanges: [], decisions, why: null, differs: [], warnings, usual: [], usualLabel: USUAL_LABEL, usualSummary: "", key };
372
+ }
373
+ function saidInUsualSummary(row, usualSummary) {
374
+ return row.label === "Checks" && usualSummary.split(", ").includes(`${row.words} checks`);
344
375
  }
@@ -586,6 +586,36 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586
586
  See the License for the specific language governing permissions and
587
587
  limitations under the License.
588
588
 
589
+ ## vt100 0.16.2 (Rust crate) — MIT
590
+
591
+ The terminal workbench's Terminal tab (the `toolroll-tui` binary) draws a take-over terminal through a vendored,
592
+ modified copy of vt100 0.16.2 by Jesse Luehrs (https://github.com/doy/vt100-rust), kept in `tui/vendor/vt100`. It
593
+ diverges from upstream in `grid.rs`, `row.rs` and `screen.rs` only: rows that scroll are reused and cleared only as
594
+ far as they were written, and one-row and one-column screens no longer overflow. `tui/vendor/vt100/README` lists the
595
+ exact changes.
596
+
597
+ The MIT License (MIT)
598
+
599
+ Copyright (c) 2016 Jesse Luehrs
600
+
601
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
602
+ this software and associated documentation files (the "Software"), to deal in
603
+ the Software without restriction, including without limitation the rights to
604
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
605
+ of the Software, and to permit persons to whom the Software is furnished to do
606
+ so, subject to the following conditions:
607
+
608
+ The above copyright notice and this permission notice shall be included in all
609
+ copies or substantial portions of the Software.
610
+
611
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
612
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
613
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
614
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
615
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
616
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
617
+ SOFTWARE.
618
+
589
619
 
590
620
  ## Bundled dependency: @alcalzone/ansi-tokenize 0.2.5
591
621
 
package/dist/builder.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { legacyNetwork, repositoryEcosystems } from "./egress.js";
2
2
  import { flexibleAdoption } from "./flexible-merge-guard.js";
3
+ import { agentSaidTail } from "./agent-said.js";
3
4
  import { CHECK_ACCESS_DEFAULT, checkAccessHere, checkNetworkOf, localModeCap } from "./check-access.js";
4
5
  import { localModeOn } from "./local-owner.js";
5
6
  import { checkoutGit, refusal as gitRefusal } from "./teardown-git.js";
@@ -1150,10 +1151,12 @@ export async function settleProviderOutcome(captured, result) {
1150
1151
  };
1151
1152
  }
1152
1153
  if (result.initFailed) {
1154
+ const said = agentSaidTail(result.stderr);
1153
1155
  return {
1154
1156
  ok: false,
1155
1157
  reason: "provider-init",
1156
1158
  message: `the provider harness never initialized — ${firstLine(result.stderr) || `exit ${result.code}`}`,
1159
+ ...(said.length === 0 ? {} : { agentSaid: said }),
1157
1160
  };
1158
1161
  }
1159
1162
  const liveEnding = captured.live?.close === "turn-budget" || captured.live?.close === "paused-idle";
@@ -1163,7 +1166,9 @@ export async function settleProviderOutcome(captured, result) {
1163
1166
  if (kept !== null)
1164
1167
  return kept;
1165
1168
  }
1166
- return { ok: false, reason: "agent", message: agentExitWords(result) };
1169
+ const ceiling = result.ending?.subtype === "error_max_turns" || result.ending?.subtype === "error_max_budget_usd";
1170
+ const said = agentSaidTail(result.stderr.trim() !== "" ? result.stderr : result.finalMessage);
1171
+ return { ok: false, reason: ceiling ? "agent" : "agent-error", message: agentExitWords(result), ...(said.length === 0 ? {} : { agentSaid: said }) };
1167
1172
  }
1168
1173
  if (captured.live?.close === "turn-budget" && ![done, mailbox, captured.plan?.proposal].some(name => name !== undefined && existsSync(join(worktree, name)))) {
1169
1174
  return { ok: false, reason: "agent", message: agentExitWords({ ...result, ending: { subtype: "error_max_turns", turns: captured.live.maxTurns } }) };
package/dist/claim.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { INFRASTRUCTURE_TERMINALS } from "./route-store.js";
3
+ import { RUN_REASON_WORDS } from "./needs-you.js";
2
4
  import { authenticate, drainOf } from "./runner.js";
3
5
  import { pauseForAuth } from "./provider-auth.js";
4
6
  import { DEFAULT_MAX_OPEN_DECISIONS, missingCapability, scopeApprovedForDispatch, taskReadinessBlocker, } from "./dispatch.js";
@@ -542,7 +544,7 @@ function sealFailure(store, leaseId, args) {
542
544
  if (failureClass !== "commit-failure" && run.terminalClass === "auth-expired") {
543
545
  return { ok: true, ...sealAuthExpired(store, run, taskId, now) };
544
546
  }
545
- if (failureClass === "unknown") {
547
+ if (failureClass === "unknown" || failureClass === "agent-error") {
546
548
  const moved = moveOnIfExhausted(store, runId, taskId, now);
547
549
  if (moved !== null) {
548
550
  store.finishRun(runId, { outcome: "failed", reason: "usage-exhausted", now });
@@ -566,12 +568,13 @@ function sealFailure(store, leaseId, args) {
566
568
  pushClass: "attention",
567
569
  link: `/r/${runId}`,
568
570
  subject: `${taskId}: the commit itself failed`,
569
- body: `${oneLine(message, 200)}\nThe work is preserved, uncommitted, in ${args.worktree}. Prove it and \`toolroll task requeue ${taskId}\`.`,
571
+ body: `The commit itself failed. The work is preserved, uncommitted, in the task's checkout. Prove it and \`toolroll task requeue ${taskId}\`.`,
570
572
  }, now);
571
573
  return { ok: true, disposition: "commit-incident", incidentId };
572
574
  }
573
575
  const strikes = store.addStrike(run.taskRef);
574
- if (strikes >= MAX_STRIKES) {
576
+ const agentStopped = failureClass === "agent-error" && !INFRASTRUCTURE_TERMINALS.has(run.terminalClass ?? "");
577
+ if (strikes >= MAX_STRIKES || agentStopped) {
575
578
  const closedState = exhaustUnlessClosed(store, run, taskId, now);
576
579
  if (closedState !== null)
577
580
  return { ok: true, disposition: "closed", strikes, state: closedState };
@@ -580,7 +583,8 @@ function sealFailure(store, leaseId, args) {
580
583
  taskRef: run.taskRef,
581
584
  ownerKind: "incident",
582
585
  ownerId: String(incidentId),
583
- reason: `attempts-exhausted — ${strikes} consecutive failures, last: ${failureClass}`,
586
+ reason: agentStopped ? "agent-error — the agent stopped with an error; it isn't retried on its own"
587
+ : `attempts-exhausted — ${strikes} consecutive failures, last: ${failureClass}`,
584
588
  until: null,
585
589
  }, now);
586
590
  store.enqueueNotification({
@@ -589,8 +593,10 @@ function sealFailure(store, leaseId, args) {
589
593
  kind: "attempts-exhausted",
590
594
  pushClass: "attention",
591
595
  link: `/r/${runId}`,
592
- subject: `${taskId} stalled after ${strikes} straight failures`,
593
- body: `Last failure (${failureClass}): ${oneLine(message, 200)}\nIt will not be retried. Read the runs, then \`toolroll task requeue ${taskId}\`.`,
596
+ subject: agentStopped ? `${taskId} stopped: the agent stopped with an error` : `${taskId} stalled after ${strikes} straight failures`,
597
+ body: agentStopped
598
+ ? `${outboundFailureWords(failureClass)}.\nIt isn't retried on its own. Read what the agent said on the task, then Retry (\`toolroll task requeue ${taskId}\`).`
599
+ : `Last failure (${failureClass}): ${outboundFailureWords(failureClass)}.\nIt will not be retried. Read the runs, then \`toolroll task requeue ${taskId}\`.`,
594
600
  }, now);
595
601
  return { ok: true, disposition: "stalled", strikes, incidentId };
596
602
  }
@@ -612,7 +618,7 @@ function sealFailure(store, leaseId, args) {
612
618
  subject: failureClass === "no-handoff"
613
619
  ? `${taskId}: the agent stopped before handing off; its work was kept, retry ${strikes}/${MAX_STRIKES}`
614
620
  : `${taskId}: attempt failed (${failureClass}), retry ${strikes}/${MAX_STRIKES}`,
615
- body: `${oneLine(message, 200)}\nNext attempt no earlier than ${until.toISOString()}.`,
621
+ body: `${outboundFailureWords(failureClass)}.\nNext attempt no earlier than ${until.toISOString()}.`,
616
622
  }, now);
617
623
  return { ok: true, disposition: "backoff", strikes, until: until.toISOString() };
618
624
  }
@@ -855,6 +861,8 @@ function sealPlanFailure(store, leaseId, args) {
855
861
  const malformedKind = args.malformed === "decision" ? "malformed-decision" : "malformed-plan";
856
862
  store.finishRun(runId, { outcome: "failed", reason: kind === "malformed" ? malformedKind : oneLine(message, 120), now });
857
863
  if (kind === "malformed") {
864
+ if (message.trim() !== "")
865
+ store.recordOutcomeFacts(runId, { handoff: message });
858
866
  const incidentId = store.createIncident({ run: runId, kind: malformedKind }, now);
859
867
  store.holdOwned({
860
868
  taskRef: run.taskRef,
@@ -870,7 +878,7 @@ function sealPlanFailure(store, leaseId, args) {
870
878
  pushClass: "attention",
871
879
  link: `/r/${runId}`,
872
880
  subject: `${taskId}: the planner's ${args.malformed === "decision" ? "question" : "plan"} failed validation`,
873
- body: `${oneLine(message, 300)}\nResolve the incident to let planning retry.`,
881
+ body: `The planner's ${args.malformed === "decision" ? "question" : "plan"} failed its checks; what it wrote is on the task.\nResolve the incident to let planning retry.`,
874
882
  }, now);
875
883
  return { ok: true, disposition: "malformed-incident", incidentId };
876
884
  }
@@ -891,7 +899,7 @@ function sealPlanFailure(store, leaseId, args) {
891
899
  pushClass: "attention",
892
900
  link: `/r/${runId}`,
893
901
  subject: `${taskId}: planning stalled after ${strikes} straight failures`,
894
- body: `Last failure: ${oneLine(message, 200)}\nResolve the incident to let planning retry, or write the scope yourself.`,
902
+ body: `${OUTBOUND_ATTEMPT_WORDS.plan}\nResolve the incident to let planning retry, or write the scope yourself.`,
895
903
  }, now);
896
904
  return { ok: true, disposition: "exhausted", incidentId, strikes };
897
905
  }
@@ -909,7 +917,7 @@ function sealPlanFailure(store, leaseId, args) {
909
917
  dedupeKey: `plan-run:${runId}:failed`,
910
918
  kind: "plan-failed",
911
919
  subject: `${taskId}: planning attempt failed, retry ${strikes}/${MAX_PLAN_STRIKES}`,
912
- body: `${oneLine(message, 200)}\nNext attempt no earlier than ${until.toISOString()}.`,
920
+ body: `${OUTBOUND_ATTEMPT_WORDS.plan}\nNext attempt no earlier than ${until.toISOString()}.`,
913
921
  }, now);
914
922
  return { ok: true, disposition: "backoff", strikes };
915
923
  }
@@ -952,6 +960,8 @@ function sealScoutFailure(store, leaseId, args) {
952
960
  const malformedKind = args.malformed === "decision" ? "malformed-decision" : "malformed-report";
953
961
  store.finishRun(runId, { outcome: "failed", reason: kind === "malformed" ? malformedKind : oneLine(message, 120), now });
954
962
  if (kind === "malformed") {
963
+ if (message.trim() !== "")
964
+ store.recordOutcomeFacts(runId, { handoff: message });
955
965
  const incidentId = store.createIncident({ run: runId, kind: malformedKind }, now);
956
966
  store.holdOwned({
957
967
  taskRef: run.taskRef,
@@ -967,7 +977,7 @@ function sealScoutFailure(store, leaseId, args) {
967
977
  pushClass: "attention",
968
978
  link: `/r/${runId}`,
969
979
  subject: `${taskId}: the scout's ${args.malformed === "decision" ? "question" : "report"} failed validation`,
970
- body: `${oneLine(message, 300)}\nResolve the incident to let scouting retry.`,
980
+ body: `The scout's ${args.malformed === "decision" ? "question" : "report"} failed its checks; what it wrote is on the task.\nResolve the incident to let scouting retry.`,
971
981
  }, now);
972
982
  return { ok: true, disposition: "malformed-incident", incidentId };
973
983
  }
@@ -991,7 +1001,7 @@ function sealScoutFailure(store, leaseId, args) {
991
1001
  pushClass: "attention",
992
1002
  link: `/r/${runId}`,
993
1003
  subject: `${taskId} stalled after ${strikes} straight scouting failures`,
994
- body: `Last failure: ${oneLine(message, 200)}\nIt will not be retried. Read the runs, then \`toolroll task requeue ${taskId}\`.`,
1004
+ body: `${OUTBOUND_ATTEMPT_WORDS.scout}\nIt will not be retried. Read the runs, then \`toolroll task requeue ${taskId}\`.`,
995
1005
  }, now);
996
1006
  return { ok: true, disposition: "stalled", incidentId, strikes };
997
1007
  }
@@ -1009,7 +1019,7 @@ function sealScoutFailure(store, leaseId, args) {
1009
1019
  dedupeKey: `run:${runId}:failed`,
1010
1020
  kind: "scout-failed",
1011
1021
  subject: `${taskId}: scouting attempt failed, retry ${strikes}/${MAX_STRIKES}`,
1012
- body: `${oneLine(message, 200)}\nNext attempt no earlier than ${until.toISOString()}.`,
1022
+ body: `${OUTBOUND_ATTEMPT_WORDS.scout}\nNext attempt no earlier than ${until.toISOString()}.`,
1013
1023
  }, now);
1014
1024
  return { ok: true, disposition: "backoff", strikes };
1015
1025
  }
@@ -1081,3 +1091,8 @@ export function acquireForCheckCleanup(store, checkId, attempt, runner, options)
1081
1091
  return acquireLocked(store, bound, runner, options, "refuse");
1082
1092
  });
1083
1093
  }
1094
+ function outboundFailureWords(failureClass) {
1095
+ const words = RUN_REASON_WORDS[failureClass] ?? "the attempt stopped";
1096
+ return `${words.charAt(0).toUpperCase()}${words.slice(1)}`;
1097
+ }
1098
+ const OUTBOUND_ATTEMPT_WORDS = { plan: "The planning attempt stopped; what happened is on the task.", scout: "The scouting attempt stopped; what happened is on the task." };
package/dist/cli-help.js CHANGED
@@ -2,7 +2,7 @@ import { DEFAULT_MAX_DEPTH } from "./scan.js";
2
2
  export const HELP = `Toolroll — your agents build. You decide.
3
3
 
4
4
  toolroll start here, in this terminal (--web: in the browser)
5
- keys: n new task · a approve · c accept · b send back · ? all
5
+ keys: n new task · a accept · r send back · A agents · ? all keys
6
6
  toolroll demo try it first: sample tasks, no model calls, no cost
7
7
  toolroll repos add <folder> add another project
8
8
  toolroll task add "<change>" --repo .
@@ -99,21 +99,16 @@ export function readCodexLimits(options = {}) {
99
99
  child.stdin?.write(`${JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { clientInfo: { name: "toolroll", version: "1" } } })}\n`);
100
100
  });
101
101
  }
102
- export function startCodexLimits(store, everyMs = 5 * 60_000) {
102
+ export function startCodexLimits(store, signedIn, everyMs = 5 * 60_000) {
103
103
  if (process.env["VITEST"] !== undefined || envValue(process.env, "NO_PLAN_PROBE") !== undefined || store.isDemo())
104
104
  return () => { };
105
105
  let stopped = false, busy = false;
106
106
  const pass = async () => {
107
- if (stopped || busy || billingOf("codex") !== "subscription")
108
- return;
109
- const recent = new Date(Date.now() - 6 * 3_600_000).toISOString();
110
- if (store.handle.prepare("SELECT 1 AS live FROM run WHERE provider = 'codex' AND outcome IS NULL AND started_at > ? LIMIT 1").get(recent) !== undefined)
107
+ if (stopped || busy)
111
108
  return;
112
109
  busy = true;
113
110
  try {
114
- const reading = await readCodexLimits();
115
- if (reading !== null && !stopped)
116
- store.recordProviderLimits(reading, new Date());
111
+ await codexLimitsPass(store, { signedIn, stopped: () => stopped });
117
112
  }
118
113
  catch {
119
114
  }
@@ -127,3 +122,21 @@ export function startCodexLimits(store, everyMs = 5 * 60_000) {
127
122
  first.unref?.();
128
123
  return () => { stopped = true; clearInterval(timer); clearTimeout(first); };
129
124
  }
125
+ export async function codexLimitsPass(store, seams) {
126
+ if (billingOf("codex") !== "subscription")
127
+ return "skipped";
128
+ const recent = new Date(Date.now() - 6 * 3_600_000).toISOString();
129
+ if (store.handle.prepare("SELECT 1 AS live FROM run WHERE provider = 'codex' AND outcome IS NULL AND started_at > ? LIMIT 1").get(recent) !== undefined)
130
+ return "skipped";
131
+ if (!(await seams.signedIn()))
132
+ return "skipped";
133
+ const reading = await (seams.read ?? (() => readCodexLimits()))();
134
+ if (reading !== null && seams.stopped?.() !== true)
135
+ store.recordProviderLimits(reading, new Date());
136
+ return "read";
137
+ }
138
+ export async function codexSignedInNow(check) {
139
+ if ((await check("codex")).state !== "connected")
140
+ return false;
141
+ return (await check("codex", true)).state === "connected";
142
+ }
@@ -106,7 +106,8 @@ export function instanceSocketTooLong(databaseFile) {
106
106
  const needs = Buffer.byteLength(join(instanceRunDir(databaseFile), "0123456789abcdef.sock"));
107
107
  if (needs <= SOCKET_PATH_MAX)
108
108
  return null;
109
- return `the database's folder is too deep for Toolroll's socket (${needs} of at most ${SOCKET_PATH_MAX} bytes), so nothing can find a console started on it — move it to a shorter folder (for example ~/.toolroll) or start with --db at a shorter path`;
109
+ const folderMax = SOCKET_PATH_MAX - Buffer.byteLength(`/${INSTANCE_DIR}/0123456789abcdef.sock`);
110
+ return `the database's folder is too deep for Toolroll's socket (${needs} of at most ${SOCKET_PATH_MAX} bytes), so nothing can find a console started on it — move it to a shorter folder (at most ${folderMax} bytes long), or point TOOLROLL_DB at an orders.db in one: \`TOOLROLL_DB=/short/folder/orders.db toolroll\``;
110
111
  }
111
112
  export function socketPathProblem(path) {
112
113
  if (!SOCKET_NAME.test(basename(path)))
@@ -50,6 +50,7 @@ export const CONSOLE_FORMS = {
50
50
  passwordless: formContract("POST /settings/passwordless", ["action", "password"]),
51
51
  localModeOff: formContract("POST /settings/local-mode/off", ["password"]),
52
52
  justMe: formContract("POST /settings/install-mode/solo", ["password"]),
53
+ taskSizing: formContract("POST /settings/task-sizing", ["password", "enabled", "sizer"]),
53
54
  releaseApproval: formContract("POST /settings/release-approval", ["repo", "action", "password"]),
54
55
  projectFlexible: formContract("POST /settings/project/flexible", ["repo", "action", "max", "digest", "password"]),
55
56
  threadAnswer: formContract("POST /agents/live/thread/<id>/answer", ["request", "card", "decision", "question", "answer"]),
@@ -180,6 +181,7 @@ export const CONSOLE_FORMS = {
180
181
  taskSteer: formContract("POST /t/<task>/steer", ["note", "return", "run", "key", "after", "request"]),
181
182
  taskReply: formContract("POST /t/<task>/reply", ["question", "answer"]),
182
183
  taskHold: formContract("POST /t/<task>/hold", ["reason"]),
184
+ taskUnhold: formContract("POST /t/<task>/unhold", ["hold"]),
183
185
  taskBlock: formContract("POST /t/<task>/block|unblock", ["on"]),
184
186
  taskRepairDependency: formContract("POST /t/<task>/repair-dependency", ["blocker", "operation", "replacement"]),
185
187
  taskNext: formContract("POST /t/<task>/next", ["undo"]),
@@ -189,7 +191,7 @@ export const CONSOLE_FORMS = {
189
191
  taskFollowUp: formContract("POST /t/<task>/follow-up", ["index"]),
190
192
  taskPlanEdit: formContract("POST /t/<task>/plan-edit", ["saw-plan", "plan-document"]),
191
193
  taskRevision: formContract("POST /t/<task>/accept-revision|reject-revision", ["revision-id", "token"]),
192
- taskCancel: formContract("POST /t/<task>/cancel", ["reason"]),
194
+ taskCancel: formContract("POST /t/<task>/cancel", ["reason", "state", "run"]),
193
195
  taskRoute: formContract("POST /t/<task>/route", ["size", "risky", "phase", "clear-phase", "agent", "provider", "model", "sawDigest", "return"]),
194
196
  taskScope: formContract("POST /t/<task>/scope", ["sawDigest", "permission-mode", "quality-mode", "budget-usd", "budget-microusd", "requirement", "requirement-new", "requirement-how", "requirement-new-how", "goal-brief", "goal", "not", "touches", "acceptance"]),
195
197
  taskApprove: formContract("POST /t/<task>/approve", ["return", "digest", "token", "nonce", "rebuild", "sheet"]),
@@ -208,7 +210,6 @@ export const BODILESS_POSTS = [
208
210
  "POST /settings/telegram/retry",
209
211
  "POST /providers/<provider>/resume",
210
212
  "POST /logout",
211
- "POST /t/<task>/unhold",
212
213
  "POST /t/<task>/stop-carrying",
213
214
  "POST /t/<task>/retry-review",
214
215
  "POST /settings/updates/check",
@@ -73,17 +73,22 @@ const needRowSchema = z.object({
73
73
  question: z.object({ id: z.number().int(), text: z.string(), recap: z.string(),
74
74
  options: z.array(z.object({ id: z.string(), label: z.string(), consequence: z.string(), recommended: z.boolean() })) }).nullable(),
75
75
  });
76
+ export const waitingSchema = z.object({ retryAt: iso.nullable(), lastFailure: z.string().nullable() });
77
+ export const WORK_ROW_GROUPS = ["decide", "review", "unblock", "building", "rest"];
78
+ export const WORK_STATUS_TONES = ["attention", "problem", "live", "ready", "done", "muted", "neutral"];
79
+ export const WORK_WORD_TONES = ["", "needs", "ask", "live", "done", "failed"];
76
80
  const workRowSchema = z.object({
77
81
  id: z.string(), title: z.string(), href: z.string(), project: z.string().nullable(), age: z.string(),
78
- status: z.object({ label: z.string(), tone: z.string(), token: z.string() }),
79
- word: z.object({ word: z.string(), tone: z.string() }),
82
+ status: z.object({ label: z.string(), tone: z.enum(WORK_STATUS_TONES), token: z.string() }),
83
+ word: z.object({ word: z.string(), tone: z.enum(WORK_WORD_TONES) }),
80
84
  ask: z.string().nullable(),
81
85
  chip: z.string().nullable(),
82
- group: z.string(),
86
+ group: z.enum(WORK_ROW_GROUPS),
83
87
  rank: z.number().int(),
84
88
  detail: z.string().nullable(),
85
89
  problem: z.string().nullable(),
86
90
  need: needRowSchema.nullable(),
91
+ waiting: waitingSchema.nullable(),
87
92
  });
88
93
  export const workRowsSchema = z.object({
89
94
  version,
@@ -108,6 +113,7 @@ export const stepCardSchema = z.object({
108
113
  inChain: z.boolean(),
109
114
  agent: z.object({ provider: z.string(), model: z.string().nullable() }).nullable(),
110
115
  startedAt: iso.nullable(),
116
+ latestStartedAt: iso.nullable(),
111
117
  finishedAt: iso.nullable(),
112
118
  costUsd: z.number().nullable(),
113
119
  runs: z.array(z.number().int()),
@@ -130,6 +136,12 @@ export const stepCardsSchema = z.object({
130
136
  review: z.object({ run: z.number().int(), receipt: z.string().regex(/^[0-9a-f]{64}$/), source: z.string(),
131
137
  accept: z.object({ owed: z.enum(["person-check", "exception"]).nullable(), blockers: z.array(z.string()), needs: z.string().nullable() }),
132
138
  }).nullable(),
139
+ failure: z.object({ line: z.string(), failedInARow: z.number().int(), suggestion: z.string().nullable(),
140
+ agentSaid: z.array(z.string()).max(8).nullable() }).nullable(),
141
+ waiting: waitingSchema.extend({ agentSaid: z.array(z.string()).max(8).nullable() }).nullable(),
142
+ held: z.object({ id: z.number().int(), reason: z.string(), lastFailure: z.string().nullable() }).nullable(),
143
+ retry: z.object({ run: z.number().int(), digest: z.string() }).nullable(),
144
+ approval: z.object({ by: z.string(), you: z.boolean(), automatic: z.boolean() }).nullable(),
133
145
  room: z.string(),
134
146
  });
135
147
  const diffProblemSchema = z.string().nullable();
@@ -19,6 +19,7 @@ export const taskSizingSchema = z.strictObject({
19
19
  risky: z.boolean(),
20
20
  source: z.enum(["classifier", "heuristic", "person"]),
21
21
  reason: limited("size reason", "sizeReason"),
22
+ by: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9 .:/~()_-]{0,79}$/).optional(),
22
23
  });
23
24
  export const routeOverrideSchema = z.strictObject({ phase, provider, model, by: text, at: text });
24
25
  function legSchema(tiers) {