test(gateway): harden live docker harness probes · openclaw/openclaw@47f131f
steipete
·
2026-04-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -730,11 +730,8 @@ describeLive("gateway live (ACP bind)", () => {
|
730 | 730 | minAssistantCount: markerAssistantCount + 1, |
731 | 731 | timeoutMs: liveAgent === "claude" ? 60_000 : 45_000, |
732 | 732 | }); |
733 | | -} catch (error) { |
| 733 | +} catch { |
734 | 734 | if (attempt === 1) { |
735 | | -if (liveAgent === "claude") { |
736 | | -throw error; |
737 | | -} |
738 | 735 | logLiveStep( |
739 | 736 | "bound session image reply not observed; continuing to cron verification", |
740 | 737 | ); |
@@ -775,24 +772,15 @@ describeLive("gateway live (ACP bind)", () => {
|
775 | 772 | logLiveStep(`cron mcp turn completed (attempt ${String(attempt + 1)})`); |
776 | 773 | |
777 | 774 | let cronHistory: Awaited<ReturnType<typeof waitForAssistantTurn>> | null = null; |
778 | | -if (liveAgent === "claude") { |
| 775 | +try { |
779 | 776 | cronHistory = await waitForAssistantTurn({ |
780 | 777 | client, |
781 | 778 | sessionKey: spawnedSessionKey, |
782 | 779 | minAssistantCount: imageAssistantCount + 1, |
783 | | -timeoutMs: 90_000, |
| 780 | +timeoutMs: liveAgent === "claude" ? 90_000 : 45_000, |
784 | 781 | }); |
785 | | -} else { |
786 | | -try { |
787 | | -cronHistory = await waitForAssistantTurn({ |
788 | | - client, |
789 | | -sessionKey: spawnedSessionKey, |
790 | | -minAssistantCount: imageAssistantCount + 1, |
791 | | -timeoutMs: 45_000, |
792 | | -}); |
793 | | -} catch { |
794 | | -logLiveStep("cron assistant reply not observed yet; relying on CLI verification"); |
795 | | -} |
| 782 | +} catch { |
| 783 | +logLiveStep("cron assistant reply not observed yet; relying on CLI verification"); |
796 | 784 | } |
797 | 785 | if (cronHistory) { |
798 | 786 | lastCronAssistantText = cronHistory.lastAssistantText; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -75,6 +75,25 @@ describe("gateway codex harness live helpers", () => {
|
75 | 75 | ).toBe(true); |
76 | 76 | }); |
77 | 77 | |
| 78 | +it("accepts missing codex shell PATH fallback with current-session model", () => { |
| 79 | +const texts = [ |
| 80 | +[ |
| 81 | +"I can only confirm the current session model here: `codex/gpt-5.4`.", |
| 82 | +"", |
| 83 | +"A direct `codex models` CLI lookup is not available in this environment because `codex` is not installed on the shell path.", |
| 84 | +].join("\n"), |
| 85 | +[ |
| 86 | +"`codex models` is not available in this environment because the `codex` CLI is not installed on `PATH`.", |
| 87 | +"", |
| 88 | +"The current session model is `codex/gpt-5.4`.", |
| 89 | +].join("\n"), |
| 90 | +]; |
| 91 | + |
| 92 | +for (const text of texts) { |
| 93 | +expect(isExpectedCodexModelsCommandText(text)).toBe(true); |
| 94 | +} |
| 95 | +}); |
| 96 | + |
78 | 97 | it("accepts sandbox escalation rejection for codex models", () => { |
79 | 98 | const texts = [ |
80 | 99 | "I couldn’t list them because `codex models` requires running outside the sandbox here, and that approval was rejected.", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -67,6 +67,10 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
|
67 | 67 | normalized.includes("escalation") || |
68 | 68 | normalized.includes("elevated execution"))) || |
69 | 69 | normalized.includes("interactive in this environment") || |
| 70 | +(normalized.includes("not installed") && |
| 71 | +normalized.includes("path") && |
| 72 | +(normalized.includes("codex cli") || normalized.includes("`codex`"))) || |
| 73 | +normalized.includes("not installed on the shell path") || |
70 | 74 | normalized.includes("sandboxed session") || |
71 | 75 | normalized.includes("required user namespace") || |
72 | 76 | normalized.includes("user-namespace restriction") || |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。