@koalaauto/agentchannel 3.53.2 → 3.53.4
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/dist/src/envcheck.d.ts +8 -0
- package/dist/src/envcheck.js +12 -0
- package/dist/src/prompts.d.ts +34 -0
- package/dist/src/prompts.js +30 -2
- package/dist/src/runner/runner.d.ts +2 -0
- package/dist/src/runner/runner.js +18 -4
- package/dist/src/runner/structured.d.ts +2 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/envcheck.d.ts
CHANGED
|
@@ -40,5 +40,13 @@ export declare function accountProblem(s: string): AccountProblem | null;
|
|
|
40
40
|
/** The runtime refused the effort level it was asked for (one the model does not take). */
|
|
41
41
|
export declare function effortRejected(s: string | undefined): boolean;
|
|
42
42
|
export declare function modelRejected(s: string | undefined): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The runtime's own program was not where its SDK looks: Claude Code's "Native CLI binary for darwin-arm64 not found", Codex's
|
|
45
|
+
* "Unable to locate Codex CLI binaries". npx installs every ach that starts with the same spec into one cache directory and, on a
|
|
46
|
+
* new release, the first one to restart installs it again in place: for those seconds the platform package is gone, so a run
|
|
47
|
+
* that starts then on another agent of the same machine fails this way although nothing is wrong with the install. The same
|
|
48
|
+
* words as the hub's 'install' cause (worker fail-cause.ts), minus the spawn ENOENT of a program that is not installed at all.
|
|
49
|
+
*/
|
|
50
|
+
export declare function programMissing(s: string | undefined): boolean;
|
|
43
51
|
/** Does a run's error say the tool is not logged in (or its key was refused)? */
|
|
44
52
|
export declare function looksLikeLoginError(s: string): boolean;
|
package/dist/src/envcheck.js
CHANGED
|
@@ -118,6 +118,18 @@ export function modelRejected(s) {
|
|
|
118
118
|
return false;
|
|
119
119
|
return /issue with the selected model|failed to set model|\bmodel\b[^\n]{0,80}\b(does not exist|not found|not available|not supported|is not (a )?valid|unknown|invalid|you do not have access)|\b(invalid|unknown|unsupported) model\b|not_found_error[^\n]{0,40}model/i.test(s);
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The runtime's own program was not where its SDK looks: Claude Code's "Native CLI binary for darwin-arm64 not found", Codex's
|
|
123
|
+
* "Unable to locate Codex CLI binaries". npx installs every ach that starts with the same spec into one cache directory and, on a
|
|
124
|
+
* new release, the first one to restart installs it again in place: for those seconds the platform package is gone, so a run
|
|
125
|
+
* that starts then on another agent of the same machine fails this way although nothing is wrong with the install. The same
|
|
126
|
+
* words as the hub's 'install' cause (worker fail-cause.ts), minus the spawn ENOENT of a program that is not installed at all.
|
|
127
|
+
*/
|
|
128
|
+
export function programMissing(s) {
|
|
129
|
+
if (!s)
|
|
130
|
+
return false;
|
|
131
|
+
return /unable to locate codex cli|codex cli binaries|claude code (?:executable|native binary) not found|native cli binary for \S+ not found/i.test(s);
|
|
132
|
+
}
|
|
121
133
|
/** Does a run's error say the tool is not logged in (or its key was refused)? */
|
|
122
134
|
export function looksLikeLoginError(s) {
|
|
123
135
|
return /\b401\b|unauthori[sz]ed|not logged in|please (run|log)[^.\n]*login|invalid (api )?key|authentication (failed|required|error)|credentials? (expired|missing|invalid)/i.test(s);
|
package/dist/src/prompts.d.ts
CHANGED
|
@@ -190,6 +190,40 @@ export declare const ANSWER_SCHEMA: {
|
|
|
190
190
|
};
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Structured mention runs: an answer schema with the escalation's one-line ask and who it goes to. Strict output schemas need every
|
|
195
|
+
* property required, so an answer sends ask "" and to "asker".
|
|
196
|
+
*/
|
|
197
|
+
export declare const MENTION_SCHEMA: {
|
|
198
|
+
readonly type: "object";
|
|
199
|
+
readonly additionalProperties: false;
|
|
200
|
+
readonly required: readonly ["action", "text", "evidence", "ask", "to"];
|
|
201
|
+
readonly properties: {
|
|
202
|
+
readonly action: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly enum: readonly ["answer", "decide"];
|
|
205
|
+
};
|
|
206
|
+
readonly text: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
};
|
|
209
|
+
readonly evidence: {
|
|
210
|
+
readonly type: "string";
|
|
211
|
+
};
|
|
212
|
+
readonly ask: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
};
|
|
215
|
+
readonly to: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly enum: readonly ["asker", "owner"];
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* 2026-11-18: a post asked "Evan, please judge this yourself: which option do you prefer?" through @evan-reelworker-staging. The run
|
|
223
|
+
* dug up the facts and wrote "Evan makes the final call" in a plain reply, so it sat among the Inbox's replies, never a to-do, and
|
|
224
|
+
* Evan reads only to-dos. A question put to the owner in person is theirs even when the agent can find every fact.
|
|
225
|
+
*/
|
|
226
|
+
export declare function ownerAskedRule(owner: string | undefined, structured: boolean): string;
|
|
193
227
|
/**
|
|
194
228
|
* Live test (gpt-6-luna): without this, a Codex answer run replied "decide"
|
|
195
229
|
* after zero tool calls although the answer was in a file of its cwd.
|
package/dist/src/prompts.js
CHANGED
|
@@ -414,6 +414,32 @@ export const ANSWER_SCHEMA = {
|
|
|
414
414
|
evidence: { type: 'string' },
|
|
415
415
|
},
|
|
416
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* Structured mention runs: an answer schema with the escalation's one-line ask and who it goes to. Strict output schemas need every
|
|
419
|
+
* property required, so an answer sends ask "" and to "asker".
|
|
420
|
+
*/
|
|
421
|
+
export const MENTION_SCHEMA = {
|
|
422
|
+
type: 'object',
|
|
423
|
+
additionalProperties: false,
|
|
424
|
+
required: ['action', 'text', 'evidence', 'ask', 'to'],
|
|
425
|
+
properties: {
|
|
426
|
+
action: { type: 'string', enum: ['answer', 'decide'] },
|
|
427
|
+
text: { type: 'string' },
|
|
428
|
+
evidence: { type: 'string' },
|
|
429
|
+
ask: { type: 'string' },
|
|
430
|
+
to: { type: 'string', enum: ['asker', 'owner'] },
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* 2026-11-18: a post asked "Evan, please judge this yourself: which option do you prefer?" through @evan-reelworker-staging. The run
|
|
435
|
+
* dug up the facts and wrote "Evan makes the final call" in a plain reply, so it sat among the Inbox's replies, never a to-do, and
|
|
436
|
+
* Evan reads only to-dos. A question put to the owner in person is theirs even when the agent can find every fact.
|
|
437
|
+
*/
|
|
438
|
+
export function ownerAskedRule(owner, structured) {
|
|
439
|
+
const who = owner ? `your owner (${owner})` : 'your owner';
|
|
440
|
+
const how = structured ? 'answer with action "decide" and to "owner"' : 'reply with `--escalate --to owner`';
|
|
441
|
+
return `- If the post asks ${who} in person (names them, or wants their own judgment, choice or approval), the decision is theirs even when you can find every fact: put what you found in the reply and ${how}, with an ask naming the choice. Writing in a plain reply that they decide does not reach them; only an escalation lands in their Inbox to-dos.`;
|
|
442
|
+
}
|
|
417
443
|
/**
|
|
418
444
|
* Live test (gpt-6-luna): without this, a Codex answer run replied "decide"
|
|
419
445
|
* after zero tool calls although the answer was in a file of its cwd.
|
|
@@ -484,8 +510,9 @@ export function buildMentionPrompt(c) {
|
|
|
484
510
|
const how = c.structured
|
|
485
511
|
? [
|
|
486
512
|
'- Do not run `ach`; the runner posts your reply in the thread. End with a JSON object only:',
|
|
487
|
-
' {"action":"answer","text":"<reply>","evidence":"<files/commands you checked>"} if you can answer from evidence, or',
|
|
488
|
-
' {"action":"decide","ask":"<the one thing the person must decide, one line>","text":"<why a human must decide, with options and money impact>","evidence":"<what you checked; claims you relay without checking, and whose>"} if it needs a human.',
|
|
513
|
+
' {"action":"answer","text":"<reply>","evidence":"<files/commands you checked>","ask":"","to":"asker"} if you can answer from evidence, or',
|
|
514
|
+
' {"action":"decide","ask":"<the one thing the person must decide, one line>","text":"<why a human must decide, with options and money impact>","evidence":"<what you checked; claims you relay without checking, and whose>","to":"asker"} if it needs a human (money, product direction, anything irreversible, or you are not sure). It goes to whoever mentioned you; "to":"owner" sends it to your own owner instead.',
|
|
515
|
+
ownerAskedRule(c.ownerName, true),
|
|
489
516
|
]
|
|
490
517
|
: [
|
|
491
518
|
'- If you can answer from evidence, reply in the thread. Write the reply after `-` as a quoted heredoc, so backticks and quotes in it stay text (a reply in double quotes with a backtick in it is refused):',
|
|
@@ -493,6 +520,7 @@ export function buildMentionPrompt(c) {
|
|
|
493
520
|
' <reply, markdown>',
|
|
494
521
|
' EOF',
|
|
495
522
|
"- If it needs a human (money, product direction, anything irreversible, or you are not sure): `ach reply --escalate --evidence '<what you checked; claims you relay without checking, and whose>' --ask '<the one thing they must decide, one line>' - <<'EOF'`, the reply saying why, with options and money impact, then `EOF` (it goes to whoever mentioned you; add `--to owner` when the decision is your own owner's, e.g. your owner must approve something)",
|
|
523
|
+
ownerAskedRule(c.ownerName, false),
|
|
496
524
|
"- Flag values go in single quotes, with no backtick or `$` in them; the heredoc's last line is `EOF` alone.",
|
|
497
525
|
'- `ach thread` shows the whole thread; `ach channel` the channel. Reply once, then stop.',
|
|
498
526
|
'- Besides these three `ach` commands only `git log`, `git show`, `git diff`, `git blame` and `git status` run here, each as one plain command (no pipes, no `cd`); any other command is refused (that does not mean `ach reply` is). Read files with Read, Glob and Grep.',
|
|
@@ -24,6 +24,8 @@ export interface RunnerOptions {
|
|
|
24
24
|
/** The hub answered 426 client_too_old: this release is below its floor (the updater checks at once). */
|
|
25
25
|
onClientTooOld?: () => void;
|
|
26
26
|
heartbeatMs?: number;
|
|
27
|
+
/** How long a run whose runtime program was missing waits before it is tried once more (default 30 s: see programMissing). */
|
|
28
|
+
programRetryMs?: number;
|
|
27
29
|
/** Keep execution traces on this machine (`ach run --no-trace`, ACH_NO_TRACE=1): the task's readers see results, not commands and output. */
|
|
28
30
|
noTrace?: boolean;
|
|
29
31
|
/** How often a parked run is looked at on the hub (default 12 s; tests that drive the runner by hand use 0). */
|
|
@@ -15,10 +15,10 @@ import { taskFiles } from '../attachments.js';
|
|
|
15
15
|
import { buildAgentEnv, inheritedEnv } from '../env.js';
|
|
16
16
|
import { unlinkWindowsSandbox } from '../codexhome.js';
|
|
17
17
|
import { effectivePerm } from '../perm.js';
|
|
18
|
-
import { ANSWER_SCHEMA, buildAnswerPrompt, buildMentionPrompt, buildPreparePrompt, buildResumePrompt, buildTaskPrompt, postUrl, refOf, REMOTE_FAILED_PREFIX, taskUrl } from '../prompts.js';
|
|
18
|
+
import { ANSWER_SCHEMA, MENTION_SCHEMA, buildAnswerPrompt, buildMentionPrompt, buildPreparePrompt, buildResumePrompt, buildTaskPrompt, postUrl, refOf, REMOTE_FAILED_PREFIX, taskUrl } from '../prompts.js';
|
|
19
19
|
import { RunnerState } from './state.js';
|
|
20
20
|
import { isGitRepo } from './workspace.js';
|
|
21
|
-
import { accountProblem, effortRejected, looksLikeLoginError, modelRejected, summarizeRuntimeError } from '../envcheck.js';
|
|
21
|
+
import { accountProblem, effortRejected, looksLikeLoginError, modelRejected, programMissing, summarizeRuntimeError } from '../envcheck.js';
|
|
22
22
|
import { redact } from '../redact.js';
|
|
23
23
|
import { TraceRecorder } from '../trace.js';
|
|
24
24
|
import { detectHost, looksLikeSandboxError, sandboxFix } from '../sandboxcheck.js';
|
|
@@ -1437,7 +1437,7 @@ export class Runner {
|
|
|
1437
1437
|
threadUrl: !this.o.publicUrl && typeof run.thread.url === 'string' && /^https?:\/\//.test(run.thread.url) ? run.thread.url : postUrl(this.base(), threadId),
|
|
1438
1438
|
structured,
|
|
1439
1439
|
});
|
|
1440
|
-
const result = await this.execute(rec, entry, prompt, undefined, 'mention', structured ?
|
|
1440
|
+
const result = await this.execute(rec, entry, prompt, undefined, 'mention', structured ? MENTION_SCHEMA : undefined, {
|
|
1441
1441
|
threadId,
|
|
1442
1442
|
usage: (cost, est, used) => client.mentionUsage(mid, runId, cost, est, used),
|
|
1443
1443
|
recorder: (r) => { recorded = r; },
|
|
@@ -1472,7 +1472,7 @@ export class Runner {
|
|
|
1472
1472
|
await c.reply(threadId, String(out.text), { evidence: String(out.evidence) });
|
|
1473
1473
|
}
|
|
1474
1474
|
else if (String(out.text ?? '').trim()) {
|
|
1475
|
-
await c.reply(threadId, String(out.text), { escalate: true, ...(String(out.evidence ?? '').trim() ? { evidence: String(out.evidence) } : {}), ...(String(out.ask ?? '').trim() ? { ask: String(out.ask).replace(/\s+/g, ' ').trim().slice(0, 200) } : {}) });
|
|
1475
|
+
await c.reply(threadId, String(out.text), { escalate: true, ...(out.to === 'owner' ? { escalateTo: 'owner' } : {}), ...(String(out.evidence ?? '').trim() ? { evidence: String(out.evidence) } : {}), ...(String(out.ask ?? '').trim() ? { ask: String(out.ask).replace(/\s+/g, ' ').trim().slice(0, 200) } : {}) });
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
catch (e) {
|
|
@@ -1749,6 +1749,20 @@ export class Runner {
|
|
|
1749
1749
|
let m = model;
|
|
1750
1750
|
let ef = effort;
|
|
1751
1751
|
result = await go(m, ef);
|
|
1752
|
+
// the runtime's program was not there: most often another ach on this machine is installing a new release into the npx
|
|
1753
|
+
// cache they share, which takes seconds. Once more after a wait; only a second miss reaches the hub as a broken install.
|
|
1754
|
+
if (!result.ok && !toolsRan && !entry.controller.signal.aborted && programMissing(result.error)) {
|
|
1755
|
+
const wait = this.o.programRetryMs ?? 30_000;
|
|
1756
|
+
const note = `the runtime's program was not found (${summarizeRuntimeError(result.error ?? '').slice(0, 160)}); trying once more in ${Math.round(wait / 1000)} s`;
|
|
1757
|
+
recorder.event({ type: 'error', data: note });
|
|
1758
|
+
this.taskLog(taskId, note);
|
|
1759
|
+
await new Promise((res) => {
|
|
1760
|
+
const t = setTimeout(res, wait);
|
|
1761
|
+
entry.controller.signal.addEventListener('abort', () => (clearTimeout(t), res()), { once: true });
|
|
1762
|
+
});
|
|
1763
|
+
if (!entry.controller.signal.aborted)
|
|
1764
|
+
result = await go(m, ef);
|
|
1765
|
+
}
|
|
1752
1766
|
// a model or an effort level the runtime does not take (a typo, one the account cannot use, a level the model lacks) must
|
|
1753
1767
|
// not stop the agent: run again on the default, and say so in the trace (the run's chip then shows what really answered)
|
|
1754
1768
|
for (let i = 0; i < 2 && !result.ok && !toolsRan && !entry.controller.signal.aborted; i++) {
|
package/dist/src/version.d.ts
CHANGED
package/dist/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koalaauto/agentchannel",
|
|
3
|
-
"version": "3.53.
|
|
3
|
+
"version": "3.53.4",
|
|
4
4
|
"description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentchannel",
|