agent-dealer 1.4.4 → 1.4.5
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/bundle/server/dist/adapters/muse-capability.js +81 -8
- package/bundle/server/dist/adapters/muse-capability.test.js +89 -1
- package/bundle/server/dist/coordinator/commands.js +2 -1
- package/bundle/server/package.json +2 -2
- package/bundle/server/static-ui/assets/index-2IuALSbV.js +64 -0
- package/bundle/server/static-ui/assets/index-MgimDoh2.css +1 -0
- package/bundle/server/static-ui/index.html +2 -2
- package/bundle/shared/package.json +1 -1
- package/dist/bin.js +0 -0
- package/package.json +2 -3
- package/bundle/server/dist/adapters/authority-lifecycle.js +0 -289
- package/bundle/server/dist/adapters/execution-authority.js +0 -103
- package/bundle/server/dist/adapters/execution-authority.test.js +0 -166
- package/bundle/server/dist/adapters/external.js +0 -20
- package/bundle/server/dist/coordinator/authority-recovery.integration.test.js +0 -661
- package/bundle/server/dist/coordinator/dispatcher.js +0 -58
- package/bundle/server/dist/coordinator/dispatcher.test.js +0 -81
- package/bundle/server/dist/coordinator/intent-forecast.js +0 -13
- package/bundle/server/dist/coordinator/intent-forecast.test.js +0 -34
- package/bundle/server/dist/coordinator/session-lifecycle.integration.test.js +0 -127
- package/bundle/server/dist/coordinator/session-lifecycle.js +0 -280
- package/bundle/server/dist/coordinator/session-lifecycle.test.js +0 -121
- package/bundle/server/dist/db/authority-attempts-stale-at-migration.test.js +0 -65
- package/bundle/server/dist/intake/agent-routing.js +0 -32
- package/bundle/server/dist/queue/answers.test.js +0 -117
- package/bundle/server/dist/queue/dispatcher-recovery.test.js +0 -37
- package/bundle/server/dist/queue/dispatcher.js +0 -597
- package/bundle/server/dist/queue/plan-delegation.js +0 -27
- package/bundle/server/dist/queue/plan-delegation.test.js +0 -61
- package/bundle/server/dist/queue/plan-gate.test.js +0 -55
- package/bundle/server/dist/queue/result-qa.js +0 -66
- package/bundle/server/dist/queue/result-qa.test.js +0 -146
- package/bundle/server/dist/repository/authority-attempts.js +0 -189
- package/bundle/server/dist/repository/result-qa.js +0 -37
- package/bundle/server/dist/runners/codex-args.js +0 -59
- package/bundle/server/dist/runners/codex-args.test.js +0 -72
- package/bundle/server/dist/runners/codex-resume.test.js +0 -19
- package/bundle/server/dist/runners/codex.js +0 -46
- package/bundle/server/dist/runners/muse-code-settings.js +0 -23
- package/bundle/server/dist/runners/muse-code-settings.test.js +0 -18
- package/bundle/server/dist/runners/persist.js +0 -142
- package/bundle/server/dist/runners/qa.js +0 -54
- package/bundle/server/dist/runners/run-context.js +0 -183
- package/bundle/server/dist/runners/stream-json.test.js +0 -95
- package/bundle/server/dist/trace-summary.js +0 -93
- package/bundle/server/dist/usage-summary.js +0 -61
- package/bundle/server/dist/usage-summary.test.js +0 -33
- package/bundle/server/static-ui/assets/index-CHCiztRI.css +0 -1
- package/bundle/server/static-ui/assets/index-CrLQFFpw.js +0 -64
- package/bundle/server/static-ui/fonts/Monaco.ttf +0 -0
- package/bundle/shared/dist/cursor-auth-health.d.ts +0 -12
- package/bundle/shared/dist/cursor-auth-health.js +0 -36
- package/bundle/shared/dist/cursor-auth-health.test.d.ts +0 -1
- package/bundle/shared/dist/cursor-auth-health.test.js +0 -40
- package/bundle/shared/dist/plan-triage.d.ts +0 -317
- package/bundle/shared/dist/plan-triage.js +0 -65
- package/bundle/shared/dist/plan-triage.test.d.ts +0 -1
- package/bundle/shared/dist/plan-triage.test.js +0 -66
- package/bundle/shared/dist/result-qa.d.ts +0 -45
- package/bundle/shared/dist/result-qa.js +0 -25
- package/bundle/shared/dist/result-qa.test.d.ts +0 -1
- package/bundle/shared/dist/result-qa.test.js +0 -60
|
@@ -67,7 +67,7 @@ function normalizeChecked(raw, currentVersion) {
|
|
|
67
67
|
const c = raw;
|
|
68
68
|
if (typeof c.version !== "string" || c.version !== currentVersion)
|
|
69
69
|
return null;
|
|
70
|
-
if (c.status !== "capable" && c.status !== "missing" && c.status !== "error")
|
|
70
|
+
if (c.status !== "capable" && c.status !== "missing" && c.status !== "host-sandbox" && c.status !== "error")
|
|
71
71
|
return null;
|
|
72
72
|
if (typeof c.checkedAt !== "number")
|
|
73
73
|
return null;
|
|
@@ -170,6 +170,20 @@ function formatDuration(ms) {
|
|
|
170
170
|
function issueFor(checked, from, exhausted = false) {
|
|
171
171
|
if (checked.status === "capable")
|
|
172
172
|
return [];
|
|
173
|
+
// NOT-641: the host cannot start Muse's sandbox (e.g. AppArmor blocking unprivileged
|
|
174
|
+
// user namespaces) — a host problem, never a version regression. Names the sandbox
|
|
175
|
+
// error and the host fix; deliberately not the "update removed access" text.
|
|
176
|
+
if (checked.status === "host-sandbox") {
|
|
177
|
+
return [
|
|
178
|
+
{
|
|
179
|
+
code: "runtime_capability",
|
|
180
|
+
message: `Muse's shell sandbox failed to start on this host (${checked.detail}) — ` +
|
|
181
|
+
`developer admission blocked until the host allows Muse's sandbox ` +
|
|
182
|
+
`(e.g. an AppArmor profile permitting unprivileged user namespaces). ` +
|
|
183
|
+
`This is a host problem, not a Muse Code version regression (probed ${checked.version}).`,
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
}
|
|
173
187
|
const head = transition(from, checked.version);
|
|
174
188
|
if (checked.status === "missing") {
|
|
175
189
|
return [
|
|
@@ -269,7 +283,7 @@ function startCheck(version) {
|
|
|
269
283
|
console.log(`[muse-capability] ${transition(from, version)}: developer ${CAPABILITY} confirmed`);
|
|
270
284
|
dropMissWatchersExcept(null);
|
|
271
285
|
}
|
|
272
|
-
else if (result.status === "missing") {
|
|
286
|
+
else if (result.status === "missing" || result.status === "host-sandbox") {
|
|
273
287
|
console.warn(`[muse-capability] ${issueFor(checked, from)[0].message}`);
|
|
274
288
|
escalateWatchedVersion(version);
|
|
275
289
|
}
|
|
@@ -331,7 +345,9 @@ export function museCapabilityIssues(version, onSettled = () => { }) {
|
|
|
331
345
|
return s.confirmedVersion ? [] : verifyingIssue(version, from);
|
|
332
346
|
if (checked.status === "capable")
|
|
333
347
|
return [];
|
|
334
|
-
|
|
348
|
+
// NOT-641: a host sandbox failure blocks like a confirmed loss (the host cannot run
|
|
349
|
+
// shell sessions on any version), with the host message — never the version text.
|
|
350
|
+
if (checked.status === "missing" || checked.status === "host-sandbox") {
|
|
335
351
|
return s.overriddenVersions.includes(checked.version) ? [] : issueFor(checked, from);
|
|
336
352
|
}
|
|
337
353
|
// Inconclusive: never a block while any baseline exists to work on. With none, the
|
|
@@ -362,13 +378,13 @@ function actionKindOf(action, fallback) {
|
|
|
362
378
|
const evidence = action.evidenceJson
|
|
363
379
|
? JSON.parse(action.evidenceJson)
|
|
364
380
|
: null;
|
|
365
|
-
if (evidence?.kind === "missing" || evidence?.kind === "unverified")
|
|
381
|
+
if (evidence?.kind === "missing" || evidence?.kind === "unverified" || evidence?.kind === "host-sandbox")
|
|
366
382
|
return evidence.kind;
|
|
367
383
|
}
|
|
368
384
|
catch {
|
|
369
385
|
// Fall through to the request_id prefix below.
|
|
370
386
|
}
|
|
371
|
-
const prefixed = /^muse-capability:(missing|unverified):/.exec(action.requestId ?? "");
|
|
387
|
+
const prefixed = /^muse-capability:(missing|unverified|host-sandbox):/.exec(action.requestId ?? "");
|
|
372
388
|
if (prefixed)
|
|
373
389
|
return prefixed[1];
|
|
374
390
|
return fallback;
|
|
@@ -405,6 +421,21 @@ function escalationFor(checked, s) {
|
|
|
405
421
|
`on ${checked.version} anyway${rollback}`,
|
|
406
422
|
};
|
|
407
423
|
}
|
|
424
|
+
// NOT-641: host sandbox start failure — names the host cause and the host fix, never
|
|
425
|
+
// the version-regression text. Acknowledging records an override like `missing` (the
|
|
426
|
+
// operator fixed the host and wants this version admitted).
|
|
427
|
+
if (checked.status === "host-sandbox" && !s.overriddenVersions.includes(checked.version)) {
|
|
428
|
+
return {
|
|
429
|
+
kind: "host-sandbox",
|
|
430
|
+
reason: `Muse's shell sandbox failed to start on this host (${checked.detail}). Last probe ran ` +
|
|
431
|
+
`${formatDuration(checked.durationMs)} (probe timeout ${formatDuration(PROBE_TIMEOUT_MS)}). ` +
|
|
432
|
+
`Developer admission is blocked for ${checked.version}; last confirmed baseline is ${baseline}. ` +
|
|
433
|
+
`This is a host problem, not a Muse Code version regression — no pin/roll back will fix it.`,
|
|
434
|
+
question: `Muse's sandbox cannot start on this host (${checked.detail}). Allow Muse's sandbox on the ` +
|
|
435
|
+
`host (e.g. an AppArmor profile permitting unprivileged user namespaces), then acknowledge ` +
|
|
436
|
+
`to admit developers on ${checked.version} anyway?`,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
408
439
|
if (isExhausted(checked) && checked.status === "error") {
|
|
409
440
|
const detail = checked.detail;
|
|
410
441
|
// With a baseline, admission proceeds on it and probing stops; with none (fresh
|
|
@@ -476,7 +507,7 @@ export function ensureMuseCapabilityEscalation(issueId) {
|
|
|
476
507
|
// parseable choice) falls through and re-raises a fresh action below.
|
|
477
508
|
const acknowledged = sameKind.some((a) => a.status === "resolved" && resolutionChoiceOf(a) === "acknowledge");
|
|
478
509
|
if (acknowledged) {
|
|
479
|
-
if (escalation.kind === "missing")
|
|
510
|
+
if (escalation.kind === "missing" || escalation.kind === "host-sandbox")
|
|
480
511
|
recordMuseCapabilityOverride(checked.version);
|
|
481
512
|
return null;
|
|
482
513
|
}
|
|
@@ -493,7 +524,7 @@ export function ensureMuseCapabilityEscalation(issueId) {
|
|
|
493
524
|
durationMs: checked.durationMs,
|
|
494
525
|
capability: CAPABILITY,
|
|
495
526
|
},
|
|
496
|
-
responseOptions: [{ choice: "acknowledge", label: `Acknowledge — ${escalation.kind === "
|
|
527
|
+
responseOptions: [{ choice: "acknowledge", label: `Acknowledge — ${escalation.kind === "unverified" ? "keep working on baseline" : `admit on ${checked.version}`}` }],
|
|
497
528
|
requestId,
|
|
498
529
|
});
|
|
499
530
|
}
|
|
@@ -572,6 +603,27 @@ export function countMuseShellToolCalls(logPath) {
|
|
|
572
603
|
}
|
|
573
604
|
return parsed === 0 ? null : shells;
|
|
574
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* NOT-641: extract a host sandbox start failure from probe session log text (the
|
|
608
|
+
* normalized `probe.ndjson` plus the raw stdout envelopes, whichever holds it).
|
|
609
|
+
* Matches bubblewrap/`bwrap` start errors (e.g. AppArmor's unprivileged user-namespace
|
|
610
|
+
* restriction: `bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted`).
|
|
611
|
+
*
|
|
612
|
+
* The log may be JSON envelopes (raw stdout, tool output double-encoded) or plain
|
|
613
|
+
* text (stderr trailer), so the error itself is matched — stopping at JSON escapes,
|
|
614
|
+
* quotes, or newlines — rather than whole lines. Returns the error text, or null.
|
|
615
|
+
*
|
|
616
|
+
* Deliberately narrow: a bare `Operation not permitted` is a normal sandbox denial
|
|
617
|
+
* (e.g. writing outside the workspace) and never counts — only sandbox-startup
|
|
618
|
+
* signatures (`bwrap:`, `bubblewrap`, `RTM_NEWADDR`) do.
|
|
619
|
+
*/
|
|
620
|
+
export function extractHostSandboxError(logText) {
|
|
621
|
+
const m = /bwrap:[^\n\\"]{0,300}|bubblewrap[^\n\\"]{0,300}|Failed RTM_NEWADDR[^\n\\"]{0,200}/i.exec(logText);
|
|
622
|
+
if (!m)
|
|
623
|
+
return null;
|
|
624
|
+
const line = m[0].trim();
|
|
625
|
+
return line === "" ? null : line;
|
|
626
|
+
}
|
|
575
627
|
/**
|
|
576
628
|
* NOT-308 safety net: a developer session ending with a dirty worktree but zero shell
|
|
577
629
|
* tool calls is exactly what a shell-less build looks like from the outside, so when
|
|
@@ -594,7 +646,7 @@ export function museCapabilitySafetyNetAfterSession(input) {
|
|
|
594
646
|
if (s.confirmedVersion === version)
|
|
595
647
|
return "skipped";
|
|
596
648
|
const checked = s.lastChecked;
|
|
597
|
-
if (checked && checked.version === version && checked.status === "missing") {
|
|
649
|
+
if (checked && checked.version === version && (checked.status === "missing" || checked.status === "host-sandbox")) {
|
|
598
650
|
ensureMuseCapabilityEscalation(input.issueId);
|
|
599
651
|
return "escalated";
|
|
600
652
|
}
|
|
@@ -749,6 +801,27 @@ export async function defaultMuseCapabilityProbe(version, opts = {}) {
|
|
|
749
801
|
catch {
|
|
750
802
|
written = null;
|
|
751
803
|
}
|
|
804
|
+
// NOT-641: when the shell did not produce its output, a sandbox start failure in
|
|
805
|
+
// the session logs (bwrap/AppArmor userns) is a host problem, not a version
|
|
806
|
+
// regression — report it as such whatever the exit/failure said. A bare
|
|
807
|
+
// `Operation not permitted` without sandbox-startup context is a normal denial
|
|
808
|
+
// and never takes this path (see extractHostSandboxError).
|
|
809
|
+
if (written !== gitBlobSha1(nonce)) {
|
|
810
|
+
const logTexts = [];
|
|
811
|
+
for (const logFile of [run.logPath, run.muse?.rawLogPath]) {
|
|
812
|
+
if (!logFile)
|
|
813
|
+
continue;
|
|
814
|
+
try {
|
|
815
|
+
logTexts.push(fs.readFileSync(logFile, "utf8"));
|
|
816
|
+
}
|
|
817
|
+
catch {
|
|
818
|
+
// An unreadable log is not a sandbox failure — ignore it.
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
const sandboxError = logTexts.length > 0 ? extractHostSandboxError(logTexts.join("\n")) : null;
|
|
822
|
+
if (sandboxError)
|
|
823
|
+
return { status: "host-sandbox", detail: sandboxError };
|
|
824
|
+
}
|
|
752
825
|
// A session that did not complete cleanly is never a verdict, even if the shell ran first.
|
|
753
826
|
if (run.timedOut)
|
|
754
827
|
return { status: "error", detail: `probe session on ${version} timed out` };
|
|
@@ -24,7 +24,7 @@ after(() => {
|
|
|
24
24
|
// best-effort — a failed rm must not fail the suite
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const { museCapabilityIssues, museCapabilityCheckInFlight, parseMuseVersion, settleMuseCapabilityCheckForTests, setMuseCapabilityProbeForTests, resetMuseCapabilityStateForTests, ageMuseCapabilityCheckForTests, ensureMuseCapabilityEscalation, recordMuseCapabilityOverride, museCapabilitySafetyNetAfterSession, countMuseShellToolCalls, museCapabilityRequestId, defaultMuseCapabilityProbe, } = await import("./muse-capability.js");
|
|
27
|
+
const { museCapabilityIssues, museCapabilityCheckInFlight, parseMuseVersion, settleMuseCapabilityCheckForTests, setMuseCapabilityProbeForTests, resetMuseCapabilityStateForTests, ageMuseCapabilityCheckForTests, ensureMuseCapabilityEscalation, recordMuseCapabilityOverride, museCapabilitySafetyNetAfterSession, countMuseShellToolCalls, extractHostSandboxError, museCapabilityRequestId, defaultMuseCapabilityProbe, } = await import("./muse-capability.js");
|
|
28
28
|
const { migrate, getDb } = await import("../db/index.js");
|
|
29
29
|
const { listHumanActionsByRequestId, resolveHumanAction } = await import("../repository/human-actions.js");
|
|
30
30
|
migrate();
|
|
@@ -188,6 +188,28 @@ describe("muse-capability", { concurrency: false }, () => {
|
|
|
188
188
|
assert.equal(calls.get(NEW), 1);
|
|
189
189
|
assert.equal(JSON.parse(fs.readFileSync(STATE, "utf8")).confirmedVersion, OLD);
|
|
190
190
|
});
|
|
191
|
+
// NOT-641: a host sandbox start failure blocks with the host cause and fix — never
|
|
192
|
+
// the version-regression text ("no longer get shell/write access").
|
|
193
|
+
test("a host sandbox failure blocks with the sandbox error and fix, not a version regression", async () => {
|
|
194
|
+
const calls = stubProbe({
|
|
195
|
+
[OLD]: { status: "capable" },
|
|
196
|
+
[NEW]: { status: "host-sandbox", detail: "bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted" },
|
|
197
|
+
});
|
|
198
|
+
await check(OLD);
|
|
199
|
+
const { settled } = await check(NEW);
|
|
200
|
+
assert.deepEqual(settled.map((i) => i.code), ["runtime_capability"]);
|
|
201
|
+
assert.match(settled[0].message, /Muse's shell sandbox failed to start on this host/);
|
|
202
|
+
assert.match(settled[0].message, /bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted/);
|
|
203
|
+
assert.match(settled[0].message, /AppArmor profile permitting unprivileged user namespaces/);
|
|
204
|
+
assert.match(settled[0].message, /host problem, not a Muse Code version regression/);
|
|
205
|
+
assert.match(settled[0].message, /developer admission blocked/);
|
|
206
|
+
assert.doesNotMatch(settled[0].message, /no longer get shell\/write access/);
|
|
207
|
+
assert.doesNotMatch(settled[0].message, /Muse Code updated/);
|
|
208
|
+
// Stays blocked on this version without re-probing; the baseline is still the old version.
|
|
209
|
+
assert.deepEqual(museCapabilityIssues(NEW), settled);
|
|
210
|
+
assert.equal(calls.get(NEW), 1);
|
|
211
|
+
assert.equal(JSON.parse(fs.readFileSync(STATE, "utf8")).confirmedVersion, OLD);
|
|
212
|
+
});
|
|
191
213
|
test("a later update that restores the capability unblocks by itself", async () => {
|
|
192
214
|
const FIXED = "1.4.0-R4302.1";
|
|
193
215
|
stubProbe({
|
|
@@ -368,6 +390,44 @@ describe("muse-capability", { concurrency: false }, () => {
|
|
|
368
390
|
assert.deepEqual(museCapabilityIssues(NEW), [], "acknowledge lifts the block");
|
|
369
391
|
assert.equal(ensureMuseCapabilityEscalation(issueId), null, "no re-raise after acknowledge");
|
|
370
392
|
});
|
|
393
|
+
// NOT-641: a host sandbox failure escalates with the host cause and fix — never the
|
|
394
|
+
// version-regression text — and acknowledge lifts the block (the operator fixed the host).
|
|
395
|
+
test("a host-sandbox version escalates with the host fix; acknowledge lifts the block", async () => {
|
|
396
|
+
const calls = stubProbe({
|
|
397
|
+
[OLD]: { status: "capable" },
|
|
398
|
+
[NEW]: { status: "host-sandbox", detail: "bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted" },
|
|
399
|
+
});
|
|
400
|
+
await check(OLD);
|
|
401
|
+
await check(NEW);
|
|
402
|
+
const issueId = makeIssue();
|
|
403
|
+
const action = ensureMuseCapabilityEscalation(issueId);
|
|
404
|
+
assert.ok(action, "a host-sandbox verdict raises an action");
|
|
405
|
+
assert.equal(action.actionType, "muse_capability");
|
|
406
|
+
assert.equal(action.requestId, museCapabilityRequestId(NEW, "host-sandbox"));
|
|
407
|
+
assert.match(action.reason, /Muse's shell sandbox failed to start on this host/);
|
|
408
|
+
assert.match(action.reason, /bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted/);
|
|
409
|
+
assert.match(action.reason, /host problem, not a Muse Code version regression/);
|
|
410
|
+
assert.match(action.reason, new RegExp(`admission is blocked for ${NEW}`));
|
|
411
|
+
assert.doesNotMatch(action.reason, /no longer get shell\/write access/);
|
|
412
|
+
assert.doesNotMatch(action.reason, /Muse Code updated/);
|
|
413
|
+
assert.match(action.question, /Allow Muse's sandbox on the host/);
|
|
414
|
+
assert.match(action.question, /AppArmor profile permitting unprivileged user namespaces/);
|
|
415
|
+
assert.doesNotMatch(action.question, /lost developer/);
|
|
416
|
+
assert.doesNotMatch(action.question, /pin\/roll back/);
|
|
417
|
+
assert.deepEqual(JSON.parse(action.responseOptionsJson), [
|
|
418
|
+
{ choice: "acknowledge", label: `Acknowledge — admit on ${NEW}` },
|
|
419
|
+
]);
|
|
420
|
+
const evidence = JSON.parse(action.evidenceJson);
|
|
421
|
+
assert.equal(evidence.kind, "host-sandbox");
|
|
422
|
+
assert.equal(evidence.version, NEW);
|
|
423
|
+
// Deduped per version, not per poll.
|
|
424
|
+
assert.equal(ensureMuseCapabilityEscalation(issueId)?.id, action.id);
|
|
425
|
+
assert.equal(calls.get(NEW), 1, "a host-sandbox verdict is conclusive: never re-probed");
|
|
426
|
+
assert.deepEqual(museCapabilityIssues(NEW).map((i) => i.code), ["runtime_capability"]);
|
|
427
|
+
recordMuseCapabilityOverride(NEW);
|
|
428
|
+
assert.deepEqual(museCapabilityIssues(NEW), [], "acknowledge lifts the block");
|
|
429
|
+
assert.equal(ensureMuseCapabilityEscalation(issueId), null, "no re-raise after acknowledge");
|
|
430
|
+
});
|
|
371
431
|
// NOT-308 repair round 3: aborting or closing the issue that holds a `missing`
|
|
372
432
|
// escalation resolves its open action with a lifecycle reason (never a choice) —
|
|
373
433
|
// that is not the operator's capability decision, so the next poll must re-raise
|
|
@@ -529,6 +589,27 @@ describe("muse-capability", { concurrency: false }, () => {
|
|
|
529
589
|
assert.equal(countMuseShellToolCalls(writeLog(["not json", ""])), null);
|
|
530
590
|
assert.equal(countMuseShellToolCalls(path.join(os.tmpdir(), `dealer-muse-nope-${randomUUID()}`)), null);
|
|
531
591
|
});
|
|
592
|
+
// NOT-641: sandbox start failures are extracted from plain text (stderr trailer) and
|
|
593
|
+
// JSON-encoded tool output (raw stdout envelopes); a bare EPERM denial never matches.
|
|
594
|
+
test("extractHostSandboxError finds bwrap failures in plain and JSON-encoded logs", () => {
|
|
595
|
+
const BWRAP = "bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted";
|
|
596
|
+
assert.equal(extractHostSandboxError(`${BWRAP}\n`), BWRAP);
|
|
597
|
+
assert.equal(extractHostSandboxError(`prefix ${BWRAP} suffix`), `${BWRAP} suffix`);
|
|
598
|
+
// Raw stdout envelope with double-encoded tool output, as the probe's raw log holds it.
|
|
599
|
+
const envelope = JSON.stringify({
|
|
600
|
+
payload_type: "tool.result",
|
|
601
|
+
payload: {
|
|
602
|
+
call_id: "call-1",
|
|
603
|
+
text: JSON.stringify({ output: `${BWRAP}\n` }),
|
|
604
|
+
correlation_facts: { tool_name: "bash", outcome: "failure" },
|
|
605
|
+
},
|
|
606
|
+
});
|
|
607
|
+
assert.equal(extractHostSandboxError(envelope), BWRAP);
|
|
608
|
+
// Bare EPERM denials (normal sandbox policy) are not start failures.
|
|
609
|
+
assert.equal(extractHostSandboxError("/bin/sh: /outside.txt: Operation not permitted\n"), null);
|
|
610
|
+
assert.equal(extractHostSandboxError("all good, shell ran\n"), null);
|
|
611
|
+
assert.equal(extractHostSandboxError(""), null);
|
|
612
|
+
});
|
|
532
613
|
// NOT-308 safety net: a dirty, shell-less session ending on an unconfirmed version
|
|
533
614
|
// probes immediately (no backoff wait) and a `missing` verdict escalates on the issue.
|
|
534
615
|
test("safety net: dirty + zero-shell on an unconfirmed version probes immediately, missing escalates", async () => {
|
|
@@ -762,6 +843,13 @@ describe("defaultMuseCapabilityProbe (fake muse)", { concurrency: false }, () =>
|
|
|
762
843
|
const result = await probeWith("capability-no-shell");
|
|
763
844
|
assert.equal(result.status, "missing");
|
|
764
845
|
});
|
|
846
|
+
// NOT-641: the session completes cleanly but its tool output holds a bwrap sandbox
|
|
847
|
+
// start failure — a host problem with that error text, never `missing` for the version.
|
|
848
|
+
test("a session whose sandbox fails to start is host-sandbox with the bwrap line", async () => {
|
|
849
|
+
const result = await probeWith("capability-sandbox-failure");
|
|
850
|
+
assert.equal(result.status, "host-sandbox");
|
|
851
|
+
assert.match(result.detail, /bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted/);
|
|
852
|
+
});
|
|
765
853
|
test("a session that fails to run at all is an error (could not verify), not missing", async () => {
|
|
766
854
|
const result = await probeWith("auth");
|
|
767
855
|
assert.equal(result.status, "error");
|
|
@@ -1845,7 +1845,8 @@ export function resolveHumanActionAndAdvance(actionId, resolvedBy, choice, opts)
|
|
|
1845
1845
|
// File first, then the row: if the resolve below fails the action stays open and
|
|
1846
1846
|
// the operator retries idempotently; the reverse order could leave a resolved
|
|
1847
1847
|
// action whose version still blocks with no way to re-acknowledge.
|
|
1848
|
-
|
|
1848
|
+
// NOT-641: a host-sandbox acknowledge also lifts the block (the operator fixed the host).
|
|
1849
|
+
if ((evidence?.kind === "missing" || evidence?.kind === "host-sandbox") && typeof evidence.version === "string" && evidence.version) {
|
|
1849
1850
|
recordMuseCapabilityOverride(evidence.version);
|
|
1850
1851
|
}
|
|
1851
1852
|
// The lifted block must be visible on the next health read, not after the cache TTL.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-dealer/server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "AGENT_DEALER_SKIP_GITHUB_HEALTH=1 AGENT_DEALER_SKIP_AGENT_HEALTH=1 npm run build -w @agent-dealer/shared && AGENT_DEALER_SKIP_GITHUB_HEALTH=1 AGENT_DEALER_SKIP_AGENT_HEALTH=1 node ../../scripts/run-workspace-tests.mjs"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agent-dealer/shared": "1.4.
|
|
26
|
+
"@agent-dealer/shared": "1.4.5",
|
|
27
27
|
"@fastify/cors": "^11.0.1",
|
|
28
28
|
"@fastify/static": "^8.2.0",
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.29.0",
|