test(gateway): trust codex guardian status · openclaw/openclaw@9f4ef61
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -388,14 +388,16 @@ async function verifyCodexGuardianProbe(params: {
|
388 | 388 | events: allowResult.events, |
389 | 389 | label: "allow probe", |
390 | 390 | }); |
391 | | -if (allowResult.text.includes(allowToken)) { |
392 | | -expect(findGuardianReviewStatus(allowResult.events) ?? "approved").toBe("approved"); |
393 | | -} else { |
| 391 | +const allowStatus = findGuardianReviewStatus(allowResult.events); |
| 392 | +if (allowStatus === "denied") { |
394 | 393 | // Guardian policy is owned by Codex and may reject even low-risk escalations. |
395 | 394 | // The OpenClaw contract is that the review completes and the agent receives |
396 | 395 | // a final response instead of hanging on approval plumbing. |
397 | 396 | expect(allowResult.text.toLowerCase()).toMatch(/approv|permission|guardian|reject|denied/); |
398 | | -expect(allowReview?.data?.status ?? "denied").toBe("denied"); |
| 397 | +expect(allowReview?.data?.status).toBe("denied"); |
| 398 | +} else { |
| 399 | +expect(allowResult.text).toContain(allowToken); |
| 400 | +expect(allowStatus ?? "approved").toBe("approved"); |
399 | 401 | } |
400 | 402 | |
401 | 403 | const askBackToken = `OPENCLAW-GUARDIAN-ASK-BACK-${randomBytes(3).toString("hex").toUpperCase()}`; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。