test(gateway): harden live docker harness probes

This commit is contained in:
Peter Steinberger
2026-04-23 12:50:25 +01:00
parent af03832134
commit 47f131f6ae
3 changed files with 28 additions and 17 deletions

View File

@@ -730,11 +730,8 @@ describeLive("gateway live (ACP bind)", () => {
minAssistantCount: markerAssistantCount + 1,
timeoutMs: liveAgent === "claude" ? 60_000 : 45_000,
});
} catch (error) {
} catch {
if (attempt === 1) {
if (liveAgent === "claude") {
throw error;
}
logLiveStep(
"bound session image reply not observed; continuing to cron verification",
);
@@ -775,24 +772,15 @@ describeLive("gateway live (ACP bind)", () => {
logLiveStep(`cron mcp turn completed (attempt ${String(attempt + 1)})`);
let cronHistory: Awaited<ReturnType<typeof waitForAssistantTurn>> | null = null;
if (liveAgent === "claude") {
try {
cronHistory = await waitForAssistantTurn({
client,
sessionKey: spawnedSessionKey,
minAssistantCount: imageAssistantCount + 1,
timeoutMs: 90_000,
timeoutMs: liveAgent === "claude" ? 90_000 : 45_000,
});
} else {
try {
cronHistory = await waitForAssistantTurn({
client,
sessionKey: spawnedSessionKey,
minAssistantCount: imageAssistantCount + 1,
timeoutMs: 45_000,
});
} catch {
logLiveStep("cron assistant reply not observed yet; relying on CLI verification");
}
} catch {
logLiveStep("cron assistant reply not observed yet; relying on CLI verification");
}
if (cronHistory) {
lastCronAssistantText = cronHistory.lastAssistantText;

View File

@@ -75,6 +75,25 @@ describe("gateway codex harness live helpers", () => {
).toBe(true);
});
it("accepts missing codex shell PATH fallback with current-session model", () => {
const texts = [
[
"I can only confirm the current session model here: `codex/gpt-5.4`.",
"",
"A direct `codex models` CLI lookup is not available in this environment because `codex` is not installed on the shell path.",
].join("\n"),
[
"`codex models` is not available in this environment because the `codex` CLI is not installed on `PATH`.",
"",
"The current session model is `codex/gpt-5.4`.",
].join("\n"),
];
for (const text of texts) {
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
}
});
it("accepts sandbox escalation rejection for codex models", () => {
const texts = [
"I couldnt list them because `codex models` requires running outside the sandbox here, and that approval was rejected.",

View File

@@ -67,6 +67,10 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
normalized.includes("escalation") ||
normalized.includes("elevated execution"))) ||
normalized.includes("interactive in this environment") ||
(normalized.includes("not installed") &&
normalized.includes("path") &&
(normalized.includes("codex cli") || normalized.includes("`codex`"))) ||
normalized.includes("not installed on the shell path") ||
normalized.includes("sandboxed session") ||
normalized.includes("required user namespace") ||
normalized.includes("user-namespace restriction") ||