orquesta-agent 0.2.242 → 0.2.245
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/claude-transcript.d.ts +14 -0
- package/dist/claude-transcript.d.ts.map +1 -1
- package/dist/claude-transcript.js +4 -0
- package/dist/claude-transcript.js.map +1 -1
- package/dist/executor.d.ts +19 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +119 -8
- package/dist/executor.js.map +1 -1
- package/dist/hook.d.ts.map +1 -1
- package/dist/hook.js +5 -1
- package/dist/hook.js.map +1 -1
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +65 -9
- package/dist/logger.js.map +1 -1
- package/dist/redact.d.ts +15 -0
- package/dist/redact.d.ts.map +1 -1
- package/dist/redact.js +26 -0
- package/dist/redact.js.map +1 -1
- package/dist/sandbox.d.ts +29 -0
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +54 -0
- package/dist/sandbox.js.map +1 -1
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js +5 -3
- package/dist/supabase.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,20 @@ export interface StartTranscriptTailOptions {
|
|
|
17
17
|
onLog: (entry: AgentLogEntry) => void;
|
|
18
18
|
/** Optional logger for diagnostics (best-effort, never throws). */
|
|
19
19
|
log?: (msg: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Fired once if the transcript file never showed up within
|
|
22
|
+
* DISCOVERY_TIMEOUT_MS.
|
|
23
|
+
*
|
|
24
|
+
* This is a TELEMETRY failure, not a session failure — the tailer only feeds
|
|
25
|
+
* the dashboard's structured timeline, and the session runs fine without it.
|
|
26
|
+
* Do not hang a kill off this callback: "no transcript" has causes that have
|
|
27
|
+
* nothing to do with a broken session (claude changing where it writes
|
|
28
|
+
* between versions, or strict mode's `--tmpfs` on ~/.claude/projects hiding a
|
|
29
|
+
* transcript written under a project dir we did not pre-create). Killing on
|
|
30
|
+
* those would take healthy sessions down. Report; let the reaper judge health
|
|
31
|
+
* from PTY output, which is the signal that actually means "alive".
|
|
32
|
+
*/
|
|
33
|
+
onDiscoveryTimeout?: () => void;
|
|
20
34
|
}
|
|
21
35
|
/**
|
|
22
36
|
* Begin tailing the Claude transcript for a session. Returns a handle with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-transcript.d.ts","sourceRoot":"","sources":["../src/claude-transcript.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,aAAa,EAKd,MAAM,uBAAuB,CAAA;AAO9B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB;AAwID,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IACrC,oEAAoE;IACpE,KAAK,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACrC,mEAAmE;IACnE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"claude-transcript.d.ts","sourceRoot":"","sources":["../src/claude-transcript.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,aAAa,EAKd,MAAM,uBAAuB,CAAA;AAO9B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB;AAwID,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IACrC,oEAAoE;IACpE,KAAK,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACrC,mEAAmE;IACnE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,YAAY,CAgFlF"}
|
|
@@ -183,6 +183,10 @@ export function startTranscriptTail(opts) {
|
|
|
183
183
|
if (Date.now() > discoveryDeadline) {
|
|
184
184
|
opts.log?.('[transcript] file never appeared — giving up');
|
|
185
185
|
stopped = true;
|
|
186
|
+
try {
|
|
187
|
+
opts.onDiscoveryTimeout?.();
|
|
188
|
+
}
|
|
189
|
+
catch { /* never throws into the timer */ }
|
|
186
190
|
return;
|
|
187
191
|
}
|
|
188
192
|
return schedule();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-transcript.js","sourceRoot":"","sources":["../src/claude-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAEL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAE9B,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAC5B,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAMnC,iEAAiE;AACjE,SAAS,kBAAkB;IACzB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AACvD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,aAA4B,EAAE,OAAe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tB,IAAI,GAA4B,CAAA;oBAChC,IAAI,CAAC;wBACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;oBAC3B,CAAC;oBAAC,MAAM,CAAC;wBACP,SAAQ,CAAC,8BAA8B;oBACzC,CAAC;oBACD,KAAK,MAAM,KAAK,IAAI,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;wBACjE,IAAI,CAAC;4BAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;wBAAC,CAAC;wBAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;oBACzD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,EAAE,CAAC,4BAA4B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC5F,CAAC;QACD,QAAQ,EAAE,CAAA;IACZ,CAAC,CAAA;IAED,QAAQ,EAAE,CAAA;IACV,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAA;QAChC,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/executor.d.ts
CHANGED
|
@@ -120,6 +120,25 @@ export declare function checkClaudeAuth(): {
|
|
|
120
120
|
method: string | null;
|
|
121
121
|
available: boolean;
|
|
122
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* The argv for `git clone`, as a list rather than a command line.
|
|
125
|
+
*
|
|
126
|
+
* Pure so the quoting rule can actually be tested. It used to be built by
|
|
127
|
+
* interpolating into a shell string, which broke on the first destination with
|
|
128
|
+
* a space in it: `D:\DUOC\Practica profesional\...` reached git as three
|
|
129
|
+
* arguments, git answered with its usage screen, and the agent retried the same
|
|
130
|
+
* failure forever. Argv has no such ambiguity — and it is also what closes the
|
|
131
|
+
* shell injection the old form carried, since `targetDir` comes from project
|
|
132
|
+
* configuration, not from a constant.
|
|
133
|
+
*
|
|
134
|
+
* NOTE ON THE TOKEN: it still goes into the URL, and therefore into
|
|
135
|
+
* `.git/config` as the origin remote. That is deliberate for now — gitPull()
|
|
136
|
+
* and gitPush() run with no credential helper of their own, so they work on
|
|
137
|
+
* private repos only because the clone left the credential there. Removing it
|
|
138
|
+
* has to be paired with giving pull/push their own credentials; doing it here
|
|
139
|
+
* alone would break every private-repo agent in the fleet.
|
|
140
|
+
*/
|
|
141
|
+
export declare function buildCloneArgs(repoUrl: string, targetDir: string, githubToken?: string): string[];
|
|
123
142
|
export declare function gitClone(repoUrl: string, targetDir: string, githubToken?: string): Promise<void>;
|
|
124
143
|
export declare function gitPull(targetDir: string): Promise<void>;
|
|
125
144
|
/**
|
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAmItD,OAAO,EAAmI,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAoPhL,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAOhF;AAGD,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE/D;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,CAAA;AAOlD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAA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;CAAE,CAetN;AAyCD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CA+BzD"}
|
package/dist/executor.js
CHANGED
|
@@ -118,10 +118,11 @@ import { randomUUID } from 'crypto';
|
|
|
118
118
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
119
119
|
import { createRequire } from 'module';
|
|
120
120
|
import * as logger from './logger.js';
|
|
121
|
+
import { redactSecrets } from './redact.js';
|
|
121
122
|
// ESM require for resolving the bundled orquesta-cli entry on Windows (see the
|
|
122
123
|
// interactive-session spawn — node-pty can't launch the `.cmd` shim).
|
|
123
124
|
const nodeRequire = createRequire(import.meta.url);
|
|
124
|
-
import { isSandboxAvailable, buildBwrapArgs, shQuote, ensureStrictProjectDirs, encodeClaudeProjectDir } from './sandbox.js';
|
|
125
|
+
import { isSandboxAvailable, buildBwrapArgs, shQuote, ensureStrictProjectDirs, encodeClaudeProjectDir, findStaleBinds, criticalBindPaths } from './sandbox.js';
|
|
125
126
|
import { isLoggedOutMessage } from './cli-auth-detect.js';
|
|
126
127
|
import { parseCoordSpec, runCoordination } from './coordination.js';
|
|
127
128
|
import { parseSudosudoInstallSpec, runSudosudoInstall } from './sudosudo.js';
|
|
@@ -1152,15 +1153,36 @@ export function checkClaudeAuth() {
|
|
|
1152
1153
|
// instead of hanging forever waiting for credentials it can't read.
|
|
1153
1154
|
const GIT_NET_TIMEOUT_MS = 120_000;
|
|
1154
1155
|
const GIT_NONINTERACTIVE_ENV = { ...process.env, GIT_TERMINAL_PROMPT: '0' };
|
|
1155
|
-
|
|
1156
|
-
|
|
1156
|
+
/**
|
|
1157
|
+
* The argv for `git clone`, as a list rather than a command line.
|
|
1158
|
+
*
|
|
1159
|
+
* Pure so the quoting rule can actually be tested. It used to be built by
|
|
1160
|
+
* interpolating into a shell string, which broke on the first destination with
|
|
1161
|
+
* a space in it: `D:\DUOC\Practica profesional\...` reached git as three
|
|
1162
|
+
* arguments, git answered with its usage screen, and the agent retried the same
|
|
1163
|
+
* failure forever. Argv has no such ambiguity — and it is also what closes the
|
|
1164
|
+
* shell injection the old form carried, since `targetDir` comes from project
|
|
1165
|
+
* configuration, not from a constant.
|
|
1166
|
+
*
|
|
1167
|
+
* NOTE ON THE TOKEN: it still goes into the URL, and therefore into
|
|
1168
|
+
* `.git/config` as the origin remote. That is deliberate for now — gitPull()
|
|
1169
|
+
* and gitPush() run with no credential helper of their own, so they work on
|
|
1170
|
+
* private repos only because the clone left the credential there. Removing it
|
|
1171
|
+
* has to be paired with giving pull/push their own credentials; doing it here
|
|
1172
|
+
* alone would break every private-repo agent in the fleet.
|
|
1173
|
+
*/
|
|
1174
|
+
export function buildCloneArgs(repoUrl, targetDir, githubToken) {
|
|
1157
1175
|
let cloneUrl = repoUrl;
|
|
1158
1176
|
if (githubToken && repoUrl.includes('github.com')) {
|
|
1159
1177
|
// Insert token into URL for private repos
|
|
1160
1178
|
cloneUrl = repoUrl.replace('https://github.com', `https://${githubToken}@github.com`);
|
|
1161
1179
|
}
|
|
1180
|
+
return ['clone', cloneUrl, targetDir];
|
|
1181
|
+
}
|
|
1182
|
+
export async function gitClone(repoUrl, targetDir, githubToken) {
|
|
1183
|
+
logger.info(`Cloning repository: ${repoUrl}`);
|
|
1162
1184
|
try {
|
|
1163
|
-
|
|
1185
|
+
execFileSync('git', buildCloneArgs(repoUrl, targetDir, githubToken), {
|
|
1164
1186
|
stdio: 'inherit',
|
|
1165
1187
|
timeout: GIT_NET_TIMEOUT_MS,
|
|
1166
1188
|
env: GIT_NONINTERACTIVE_ENV,
|
|
@@ -1168,7 +1190,12 @@ export async function gitClone(repoUrl, targetDir, githubToken) {
|
|
|
1168
1190
|
logger.success('Repository cloned successfully');
|
|
1169
1191
|
}
|
|
1170
1192
|
catch (error) {
|
|
1171
|
-
|
|
1193
|
+
// Node puts the whole failing command in the message, and the clone URL
|
|
1194
|
+
// carries the token — so this string is the one that put a live GitHub
|
|
1195
|
+
// credential on a QA screenshot. The logger redacts its own console and
|
|
1196
|
+
// file output now, but this error also travels to the dashboard and into
|
|
1197
|
+
// callers that format it themselves, so scrub it at the source too.
|
|
1198
|
+
throw new Error(redactSecrets(`Failed to clone repository: ${error}`));
|
|
1172
1199
|
}
|
|
1173
1200
|
}
|
|
1174
1201
|
export async function gitPull(targetDir) {
|
|
@@ -3527,6 +3554,13 @@ let onSessionEndedCallback = null;
|
|
|
3527
3554
|
// terminate sessions idle past the timeout or beyond a hard max lifetime.
|
|
3528
3555
|
const SESSION_IDLE_TIMEOUT_MS = 60 * 60 * 1000; // 1h with no PTY output
|
|
3529
3556
|
const SESSION_MAX_LIFETIME_MS = 6 * 60 * 60 * 1000; // 6h hard ceiling
|
|
3557
|
+
// A session that has produced NO output at all since spawn never came up: the
|
|
3558
|
+
// CLI hung before its first paint (a sandbox handed it a stale ~/.claude.json,
|
|
3559
|
+
// a login prompt it cannot draw, a binary that died without a word). Held to a
|
|
3560
|
+
// far shorter fuse than the idle timeout, because an hour of a dead terminal
|
|
3561
|
+
// blocking the slot is an hour the operator spends wondering. Healthy sessions
|
|
3562
|
+
// paint within seconds — `session:started` is itself gated on first output.
|
|
3563
|
+
const SESSION_NO_FIRST_OUTPUT_MS = 5 * 60 * 1000; // 5m without ever painting
|
|
3530
3564
|
let sessionReaper = null;
|
|
3531
3565
|
function ensureSessionReaper() {
|
|
3532
3566
|
if (sessionReaper)
|
|
@@ -3536,7 +3570,12 @@ function ensureSessionReaper() {
|
|
|
3536
3570
|
for (const s of [...sessions.values()]) {
|
|
3537
3571
|
const idle = now - (s.lastPtyOutputAt ?? s.startTime);
|
|
3538
3572
|
const age = now - s.startTime;
|
|
3539
|
-
if (
|
|
3573
|
+
if (!s.sawPtyOutput && age > SESSION_NO_FIRST_OUTPUT_MS) {
|
|
3574
|
+
logger.warn(`[Session] Reaping session ${s.sessionId} that never produced output (age ${Math.round(age / 60000)}m)`);
|
|
3575
|
+
void reportAgentError('warn', 'session_never_started', `Reaped an interactive session that produced no output in ${Math.round(age / 60000)}m — the CLI hung before its first paint`, { sessionId: s.sessionId, workingDirectory: s.workingDirectory });
|
|
3576
|
+
terminateSession(s.sessionId);
|
|
3577
|
+
}
|
|
3578
|
+
else if (idle > SESSION_IDLE_TIMEOUT_MS || age > SESSION_MAX_LIFETIME_MS) {
|
|
3540
3579
|
logger.warn(`[Session] Reaping stale session ${s.sessionId} (idle ${Math.round(idle / 60000)}m, age ${Math.round(age / 60000)}m)`);
|
|
3541
3580
|
void reportAgentError('info', 'session_reap', `Reaped stale interactive session (idle ${Math.round(idle / 60000)}m, age ${Math.round(age / 60000)}m)`, { sessionId: s.sessionId });
|
|
3542
3581
|
terminateSession(s.sessionId);
|
|
@@ -3546,7 +3585,10 @@ function ensureSessionReaper() {
|
|
|
3546
3585
|
clearInterval(sessionReaper);
|
|
3547
3586
|
sessionReaper = null;
|
|
3548
3587
|
}
|
|
3549
|
-
|
|
3588
|
+
// 60s, not 5m: the no-first-output fuse is 5m, and sweeping at 5m would
|
|
3589
|
+
// make it fire anywhere between 5 and 10 minutes. The sweep walks a map
|
|
3590
|
+
// that holds a handful of sessions and clears itself once empty.
|
|
3591
|
+
}, 60 * 1000);
|
|
3550
3592
|
}
|
|
3551
3593
|
// Per-file byte offset into /tmp/rr-*.log (rogerthat-handoff listener inboxes).
|
|
3552
3594
|
// Shared across interactive sessions AND one-shot execute() prompts so phone
|
|
@@ -4073,13 +4115,48 @@ export async function startSession(options) {
|
|
|
4073
4115
|
logger.info(`Sandbox active for interactive session — confining writes to ${cwd}`);
|
|
4074
4116
|
}
|
|
4075
4117
|
}
|
|
4076
|
-
|
|
4118
|
+
// Captured into a const: the null guard above narrows the module-level
|
|
4119
|
+
// `ptySpawn`, but a closure over a mutable binding cannot keep that
|
|
4120
|
+
// narrowing, and this has to be a closure so the stale-bind path can spawn
|
|
4121
|
+
// twice with identical arguments.
|
|
4122
|
+
const spawnWithPty = ptySpawn;
|
|
4123
|
+
const spawnPty = () => spawnWithPty(ptyFile, ptyArgsFinal, {
|
|
4077
4124
|
name: 'xterm-256color',
|
|
4078
4125
|
cols,
|
|
4079
4126
|
rows,
|
|
4080
4127
|
cwd,
|
|
4081
4128
|
env: ptyEnv,
|
|
4082
4129
|
});
|
|
4130
|
+
ptyProcess = spawnPty();
|
|
4131
|
+
// A bind whose source was deleted and recreated between buildBwrapArgs and
|
|
4132
|
+
// the spawn leaves the sandbox reading a stale inode — see findStaleBinds.
|
|
4133
|
+
// The window is small but real: claude's own auto-updater rewrites
|
|
4134
|
+
// ~/.claude.json by delete+recreate, and it does that while sessions start.
|
|
4135
|
+
// Respawning is the whole fix, because the second buildBwrapArgs resolves
|
|
4136
|
+
// the new inode. Retry ONCE: if the updater is still churning, a loop would
|
|
4137
|
+
// fight it forever, and a session on a stale config is worse than a session
|
|
4138
|
+
// that says why it is unhappy.
|
|
4139
|
+
if (ptyFile === 'bwrap' && typeof ptyProcess.pid === 'number') {
|
|
4140
|
+
const stale = await staleBindsAfterSpawn(ptyProcess.pid);
|
|
4141
|
+
if (stale.length > 0) {
|
|
4142
|
+
logger.warn(`Sandbox spawned with stale bind(s): ${stale.join(', ')} — respawning once`);
|
|
4143
|
+
killSessionTree(ptyProcess, 'SIGKILL');
|
|
4144
|
+
ptyProcess = spawnPty();
|
|
4145
|
+
const stillStale = typeof ptyProcess.pid === 'number'
|
|
4146
|
+
? await staleBindsAfterSpawn(ptyProcess.pid)
|
|
4147
|
+
: [];
|
|
4148
|
+
if (stillStale.length > 0) {
|
|
4149
|
+
// Continue rather than refuse. The session may still be perfectly
|
|
4150
|
+
// usable (a stale ~/.claude.json costs a re-login, not a crash), and
|
|
4151
|
+
// refusing to start would turn a degraded session into no session.
|
|
4152
|
+
logger.warn(`Bind(s) still stale after respawn: ${stillStale.join(', ')} — starting anyway`);
|
|
4153
|
+
void reportAgentError('warn', 'sandbox_stale_bind', `Sandbox bind still stale after one respawn: ${stillStale.join(', ')}. A background process is rewriting it (claude's auto-updater does this to ~/.claude.json); the session may start logged out.`, { sessionId, paths: stillStale });
|
|
4154
|
+
}
|
|
4155
|
+
else {
|
|
4156
|
+
void reportAgentError('info', 'sandbox_stale_bind', `Respawned the sandbox to clear a stale bind: ${stale.join(', ')}`, { sessionId, paths: stale });
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4083
4160
|
// The CLI reads the temp system-prompt file at startup; remove it shortly
|
|
4084
4161
|
// after so it doesn't linger in the temp dir.
|
|
4085
4162
|
if (sysPromptFile) {
|
|
@@ -4138,6 +4215,17 @@ export async function startSession(options) {
|
|
|
4138
4215
|
void sendSessionLog(channel, sessionId, entry);
|
|
4139
4216
|
},
|
|
4140
4217
|
log: (msg) => logger.debug(`[Session ${sessionId}] ${msg}`),
|
|
4218
|
+
// Report, do not kill. The tailer is telemetry: losing it costs the
|
|
4219
|
+
// dashboard its structured timeline and nothing else, and its timeout
|
|
4220
|
+
// fires for causes that say nothing about session health. What DOES mean
|
|
4221
|
+
// "this session is dead" is the absence of PTY output, which the reaper
|
|
4222
|
+
// already watches — so a missing transcript on a session that is happily
|
|
4223
|
+
// painting is a reporting bug to chase, not a terminal to kill.
|
|
4224
|
+
onDiscoveryTimeout: () => {
|
|
4225
|
+
const live = sessions.get(sessionId);
|
|
4226
|
+
logger.warn(`[Session ${sessionId}] transcript never appeared — structured logs unavailable for this session`);
|
|
4227
|
+
void reportAgentError('warn', 'transcript_missing', 'Claude transcript never appeared within 60s; the session keeps running but its structured timeline will be empty.', { sessionId, sawPtyOutput: Boolean(live?.sawPtyOutput), workingDirectory: cwd });
|
|
4228
|
+
},
|
|
4141
4229
|
});
|
|
4142
4230
|
}
|
|
4143
4231
|
// Send session:started only after Claude produces its first output.
|
|
@@ -4175,6 +4263,9 @@ export async function startSession(options) {
|
|
|
4175
4263
|
const liveSession = sessions.get(sessionId);
|
|
4176
4264
|
if (liveSession) {
|
|
4177
4265
|
liveSession.lastPtyOutputAt = Date.now();
|
|
4266
|
+
// First byte ever = the CLI came up. The reaper reads this to tell a
|
|
4267
|
+
// session that went quiet from one that never spoke at all.
|
|
4268
|
+
liveSession.sawPtyOutput = true;
|
|
4178
4269
|
}
|
|
4179
4270
|
// Confirm session is ready on first output from Claude
|
|
4180
4271
|
if (!sessionStartedSent) {
|
|
@@ -4531,6 +4622,26 @@ export function getSessionStatus() {
|
|
|
4531
4622
|
* session/group leader, so signalling the NEGATIVE pid reaches every process in
|
|
4532
4623
|
* its group (bwrap + the CLI). We hit the group first, then the pty leader.
|
|
4533
4624
|
*/
|
|
4625
|
+
/**
|
|
4626
|
+
* Give bwrap a moment to build its namespace, then report stale binds.
|
|
4627
|
+
*
|
|
4628
|
+
* Polls because the mounts do not exist at the instant node-pty returns the
|
|
4629
|
+
* pid — bwrap is still setting them up. Bounded and fail-open: if the process
|
|
4630
|
+
* dies, is not Linux, or simply never shows the mounts, we report nothing and
|
|
4631
|
+
* the session proceeds exactly as it did before this check existed.
|
|
4632
|
+
*/
|
|
4633
|
+
async function staleBindsAfterSpawn(pid) {
|
|
4634
|
+
const paths = criticalBindPaths();
|
|
4635
|
+
if (paths.length === 0)
|
|
4636
|
+
return [];
|
|
4637
|
+
for (let attempt = 0; attempt < 8; attempt++) {
|
|
4638
|
+
await new Promise(r => setTimeout(r, 75));
|
|
4639
|
+
const stale = findStaleBinds(pid, paths);
|
|
4640
|
+
if (stale.length > 0)
|
|
4641
|
+
return stale;
|
|
4642
|
+
}
|
|
4643
|
+
return [];
|
|
4644
|
+
}
|
|
4534
4645
|
function killSessionTree(ptyProcess, signal) {
|
|
4535
4646
|
const pid = ptyProcess.pid;
|
|
4536
4647
|
if (typeof pid === 'number' && pid > 1) {
|