fix(gateway): keep restart probe auth local#72405
Conversation
Greptile SummaryThis PR fixes the remote credential fallback bug in Confidence Score: 4/5Safe to merge; the fix is correct and well-targeted, with only a minor test organisation issue present. Only P2 findings (misplaced test describe block). Core logic of stripping remote credentials for local-mode probes is sound, handles edge cases correctly, and is backed by two new regression tests. No files require special attention beyond the minor test placement issue in Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/gateway/probe-auth.test.ts
Line: 135-163
Comment:
**Test placed in wrong describe block**
This test calls `resolveGatewayProbeAuthSafeWithSecretInputs` but lives inside `describe("resolveGatewayProbeAuthSafe")`. The `describe("resolveGatewayProbeAuthSafeWithSecretInputs")` block already exists lower in the file (line 199) and is the natural home for this case. Misplacement makes the suite output misleading and can confuse future contributors tracing failures back to the right function.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(gateway): keep restart probe auth lo..." | Re-trigger Greptile |
|
Thanks for opening the replacement PR and preserving credit for #57374. I agree with the Greptile P2: the SecretInputs regression test should be moved under the existing The focused validation looks aligned with the changed files. The currently failing CI jobs seem to touch areas outside this PR’s changed files; could a maintainer confirm whether those are unrelated or need a rerun? |
|
I could not push directly to this PR branch, so I opened a tiny follow-up PR targeting this PR head branch to address the Greptile P2 test placement comment: #72433. It only moves the SecretInputs regression test under the matching |
da48b76 to
8bb983c
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #72405 |
8bb983c to
0d0ce1f
Compare
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
* fix(gateway): keep restart probe auth local * fix(gateway): repair local restart probe auth replacement
Summary
Review notes
resolveLocalGatewayProbeAuthSafeWithEnvFallback.Validation
pnpm check:changedpnpm -s vitest run --config vitest.unit.config.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/restart-health.test.ts src/cli/daemon-cli/status.gather.test.tspnpm -s vitest run --config vitest.gateway.config.ts src/gateway/probe-auth.test.tsProjectClownfish replacement details:
Finished in 874ms on 5 files using 4 threads.
tool-display snapshot is up to date
OK apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift
extensions/discord/src/draft-chunking.ts(27,17): error TS2339: Property 'draftChunk' does not exist on type 'DiscordAccountConfig'.
extensions/discord/src/draft-chunking.ts(28,29): error TS2339: Property 'draftChunk' does not exist on type 'DiscordConfig'.
extensions/memory-wiki/src/gateway.ts(74,7): error TS2536: Type '"respond"' cannot be used to index type 'T'.
extensions/memory-wiki/src/gateway.ts(79,29): error TS2741: Property 'code' is missing in type '{ message: string; }' but required in type '{ code: string; message: string; details?: unknown; retryable?: boolean | undefined; retryAfterMs?: number | undefined; }'.
extensions/memory-wiki/src/gateway.ts(158,13): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/gateway.ts(232,13): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/gateway.ts(279,13): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/gateway.ts(310,57): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/gateway.ts(323,55): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/gateway.ts(336,58): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
extensions/memory-wiki/src/obsidian.test.ts(18,11): error TS2322: Type '(command: string, argv: ExecFileOptions | ExecFileOptionsWithBufferEncoding | ExecFileOptionsWithStringEncoding | readonly string[] | null | undefined) => Promise<...>' is not assignable to type '{ (file: string): PromiseWithChild<{ stdout: string; stderr: string; }>; (file: string, args: readonly string[] | null | undefined): PromiseWithChild<{ stdout: string; stderr: string; }>; (file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<...>; (file: string, args: readonly string[] | ... 1...'.
Target signature provides too few arguments. Expected 2 or more, but got 1.
extensions/memory-wiki/src/obsidian.test.ts(21,39): error TS2488: Type 'ExecFileOptions' must have a 'Symbol.iterator' method that returns an iterator.
extensions/memory-wiki/src/obsidian.test.ts(21,39): error TS2488: Type 'ExecFileOptionsWithBufferEncoding' must have a 'Symbol.iterator' method that returns an iterator.
extensions/memory-wiki/src/obsidian.test.ts(21,39): error TS2488: Type 'ExecFileOptionsWithStringEncoding' must have a 'Symbol.iterator' method that returns an iterator.
extensions/memory-wiki/src/obsidian.test.ts(21,39): error TS2488: Type 'null' must have a 'Symbol.iterator' method that returns an iterator.
extensions/memory-wiki/src/obsidian.test.ts(21,39): error TS2488: Type 'undefined' must have a 'Symbol.iterator' method that returns an iterator.
extensions/telegram/src/bot-message-dispatch.test.ts(408,22): error TS2353: Object literal may only specify known properties, and 'blockStreaming' does not exist in type 'TelegramAccountConfig'.
extensions/telegram/src/bot-message-dispatch.test.ts(669,7): error TS2322: Type '{ blockStreaming?: undefined; } | { blockStreaming: boolean; }' is not assignable to type 'TelegramAccountConfig | undefined'.
Type '{ blockStreaming?: undefined; }' has no properties in common with type 'TelegramAccountConfig'.
extensions/telegram/src/bot.helpers.test.ts(58,15): error TS2353: Object literal may only specify known properties, and 'draftChunk' does not exist in type 'TelegramAccountConfig'.
extensions/telegram/src/draft-chunking.ts(27,17): error TS2339: Property 'draftChunk' does not exist on type 'TelegramAccountConfig'.
extensions/telegram/src/draft-chunking.ts(28,30): error TS2339: Property 'draftChunk' does not exist on type 'TelegramConfig'.
src/auto-reply/reply.block-streaming.test.ts(113,17): error TS2322: Type '{ allowFrom: string[]; streaming?: "block" | undefined; }' is not assignable to type 'TelegramConfig'.
Types of property 'streaming' are incompatible.
Type '"block" | undefined' is not assignable to type 'ChannelPreviewStreamingConfig | undefined'.
Type '"block"' has no properties in common with type 'ChannelPreviewStreamingConfig'.
src/channels/plugins/setup-wizard-helpers.test.ts(984,11): error TS2559: Type 'string' has no properties in common with type 'ChannelPreviewStreamingConfig'.
src/commands/doctor-legacy-config.migrations.test.ts(387,11): error TS2559: Type 'string' has no properties in common with type 'ChannelPreviewStreamingConfig'.
src/config/config-misc.test.ts(466,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(466,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(467,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(475,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(478,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(489,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(489,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(490,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(497,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(500,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(510,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(510,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(511,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(519,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(522,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(533,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(533,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(534,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(546,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(549,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(561,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(561,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(562,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(570,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(573,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(592,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(592,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(593,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(611,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(614,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(617,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(628,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(628,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(629,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(639,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(642,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(655,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(655,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(656,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(678,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(681,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(682,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(711,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(711,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(712,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(751,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(754,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(755,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(756,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(759,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(760,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(763,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(821,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(821,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(822,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(883,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(886,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(887,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(890,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(891,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(894,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(895,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(931,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(931,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(932,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(940,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(944,33): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(957,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(957,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(958,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(976,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(979,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(1004,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(1004,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(1005,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(1031,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(1034,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(1037,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config-misc.test.ts(1063,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(1063,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(1064,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(1071,28): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(1086,11): error TS2304: Cannot find name 'withTempHome'.
src/config/config-misc.test.ts(1086,31): error TS7006: Parameter 'home' implicitly has an 'any' type.
src/config/config-misc.test.ts(1087,13): error TS2304: Cannot find name 'writeOpenClawConfig'.
src/config/config-misc.test.ts(1091,26): error TS2304: Cannot find name 'readConfigFileSnapshot'.
src/config/config-misc.test.ts(1093,38): error TS7006: Parameter 'issue' implicitly has an 'any' type.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(176,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(186,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(206,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(217,19): error TS2304: Cannot find name 'migrateLegacyConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(243,19): error TS2304: Cannot find name 'migrateLegacyConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(299,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(316,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(333,36): error TS2304: Cannot find name 'OpenClawConfig'.
src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts(341,19): error TS2304: Cannot find name 'migrateLegacyConfig'.
src/plugin-sdk/test-helpers.ts(2,28): error TS2459: Module '"node:fs/promises"' declares 'RmOptions' locally, but it is not exported.
ELIFECYCLE Command failed with exit code 2.
ELIFECYCLE Command failed with exit code 2.