Skip to content

Commit 8c2069b

Browse files
committed
fix(doctor): skip cleanup hints for active gateway and downgrade exec SecretRef errors to warnings
- Fix false cleanup hints: renderGatewayServiceCleanupHints() now takes detected services as input and generates per-service hints instead of hardcoded main gateway hints - Fix SecretRef exit code 1: assertSecretInputResolved() now downgrades exec: SecretRef resolution failures to warnings during doctor execution - Doctor sets OPENCLAW_ALLOW_EXEC_SECRETREF_FAILURES=true to enable lenient handling for unresolvable keychain/exec refs when gateway isn't running Fixes #52510
1 parent 6245b4f commit 8c2069b

6 files changed

Lines changed: 333 additions & 291 deletions

File tree

docs/.generated/plugin-sdk-api-baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,11 +4680,11 @@
46804680
}
46814681
},
46824682
{
4683-
"declaration": "export function normalizeResolvedSecretInputString(params: { value: unknown; refValue?: unknown; defaults?: SecretDefaults | undefined; path: string; }): string | undefined;",
4683+
"declaration": "export function normalizeResolvedSecretInputString(params: { value: unknown; refValue?: unknown; defaults?: SecretDefaults | undefined; path: string; allowExecFailuresInDoctor?: boolean | undefined; }): string | undefined;",
46844684
"exportName": "normalizeResolvedSecretInputString",
46854685
"kind": "function",
46864686
"source": {
4687-
"line": 144,
4687+
"line": 159,
46884688
"path": "src/config/types.secrets.ts"
46894689
}
46904690
},

docs/.generated/plugin-sdk-api-baseline.jsonl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@
515515
{"declaration":"export function buildSecretInputArraySchema(): ZodArray<ZodUnion<readonly [ZodString, ZodDiscriminatedUnion<[ZodObject<{ source: ZodLiteral<\"env\">; provider: ZodString; id: ZodString; }, $strip>, ZodObject<...>, ZodObject<...>], \"source\">]>>;","entrypoint":"secret-input","exportName":"buildSecretInputArraySchema","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":23,"sourcePath":"src/plugin-sdk/secret-input.ts"}
516516
{"declaration":"export function buildSecretInputSchema(): ZodUnion<readonly [ZodString, ZodDiscriminatedUnion<[ZodObject<{ source: ZodLiteral<\"env\">; provider: ZodString; id: ZodString; }, $strip>, ZodObject<...>, ZodObject<...>], \"source\">]>;","entrypoint":"secret-input","exportName":"buildSecretInputSchema","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":11,"sourcePath":"src/plugin-sdk/secret-input-schema.ts"}
517517
{"declaration":"export function hasConfiguredSecretInput(value: unknown, defaults?: SecretDefaults | undefined): boolean;","entrypoint":"secret-input","exportName":"hasConfiguredSecretInput","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":106,"sourcePath":"src/config/types.secrets.ts"}
518-
{"declaration":"export function normalizeResolvedSecretInputString(params: { value: unknown; refValue?: unknown; defaults?: SecretDefaults | undefined; path: string; }): string | undefined;","entrypoint":"secret-input","exportName":"normalizeResolvedSecretInputString","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":144,"sourcePath":"src/config/types.secrets.ts"}
518+
{"declaration":"export function normalizeResolvedSecretInputString(params: { value: unknown; refValue?: unknown; defaults?: SecretDefaults | undefined; path: string; allowExecFailuresInDoctor?: boolean | undefined; }): string | undefined;","entrypoint":"secret-input","exportName":"normalizeResolvedSecretInputString","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":159,"sourcePath":"src/config/types.secrets.ts"}
519519
{"declaration":"export function normalizeSecretInputString(value: unknown): string | undefined;","entrypoint":"secret-input","exportName":"normalizeSecretInputString","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"function","recordType":"export","sourceLine":113,"sourcePath":"src/config/types.secrets.ts"}
520520
{"declaration":"export type SecretInput = SecretInput;","entrypoint":"secret-input","exportName":"SecretInput","importSpecifier":"openclaw/plugin-sdk/secret-input","kind":"type","recordType":"export","sourceLine":16,"sourcePath":"src/config/types.secrets.ts"}
521521
{"category":"utilities","entrypoint":"testing","importSpecifier":"openclaw/plugin-sdk/testing","recordType":"module","sourceLine":1,"sourcePath":"src/plugin-sdk/testing.ts"}

src/commands/doctor-gateway-services.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ export async function maybeScanExtraGatewayServices(
436436
}
437437
}
438438

439-
const cleanupHints = renderGatewayServiceCleanupHints();
439+
// Only show cleanup hints for services that were actually detected as extras,
440+
// excluding legacy services that were already processed above
441+
const nonLegacyExtraServices = extraServices.filter((svc) => !svc.legacy);
442+
const cleanupHints = renderGatewayServiceCleanupHints(nonLegacyExtraServices);
440443
if (cleanupHints.length > 0) {
441444
note(cleanupHints.map((hint) => `- ${hint}`).join("\n"), "Cleanup hints");
442445
}

0 commit comments

Comments
 (0)