fix: sanitize restart handoff diagnostics · openclaw/openclaw@0720c1f
shakkernerd
·
2026-05-05
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -271,4 +271,26 @@ describe("gateway restart handoff", () => {
|
271 | 271 | "Recent restart handoff: full-process via launchd; source=plugin-change; reason=plugin source changed; pid=12345; age=2s; expiresIn=57s", |
272 | 272 | ); |
273 | 273 | }); |
| 274 | + |
| 275 | +it("formats restart reasons as a single diagnostic line", () => { |
| 276 | +expect( |
| 277 | +formatGatewayRestartHandoffDiagnostic( |
| 278 | +{ |
| 279 | +kind: GATEWAY_SUPERVISOR_RESTART_HANDOFF_KIND, |
| 280 | +version: 1, |
| 281 | +intentId: "intent-1", |
| 282 | +pid: 12_345, |
| 283 | +createdAt: 10_000, |
| 284 | +expiresAt: 70_000, |
| 285 | +reason: "ok\nFake: bad", |
| 286 | +source: "operator-restart", |
| 287 | +restartKind: "full-process", |
| 288 | +supervisorMode: "external", |
| 289 | +}, |
| 290 | +12_500, |
| 291 | +), |
| 292 | +).toBe( |
| 293 | +"Recent restart handoff: full-process via external; source=operator-restart; reason=ok Fake: bad; pid=12345; age=2s; expiresIn=57s", |
| 294 | +); |
| 295 | +}); |
274 | 296 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。