Skip to content

fix(gateway): skip secrets.resolve when target SecretRefs use exec providers#96661

Closed
SunnyShu0925 wants to merge 3 commits into
openclaw:mainfrom
SunnyShu0925:fix/secrets-resolve-exec-skip-96653
Closed

fix(gateway): skip secrets.resolve when target SecretRefs use exec providers#96661
SunnyShu0925 wants to merge 3 commits into
openclaw:mainfrom
SunnyShu0925:fix/secrets-resolve-exec-skip-96653

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

reply-path secrets.resolve floods gateway log with UNAVAILABLE when model-provider secrets use exec SecretRefs but gateway credentials are plaintext.

  • Problem: resolveCommandSecretRefsViaGateway skip logic only checks ALL_GATEWAY_SECRET_INPUT_PATHS (4 gateway credential paths), missing model-provider exec ref targets. Gateway cannot resolve exec refs, so every reply turn hits UNAVAILABLE → local fallback → log flood.
  • Solution: Collect active exec target ref paths (not just discovered ones) and merge into the skip check alongside gateway credential exec refs. The target-exec collection is gated behind resolutionPolicy.allowExecSecretRefs and filtered to active command targets only, so inactive exec refs do not bypass gateway snapshot resolution for unrelated active targets.
  • What changed: src/cli/command-secret-gateway.ts (new collectActiveExecTargetRefPaths helper with activeConfiguredRefPaths filter, classifyConfiguredTargetRefs now returns activeConfiguredRefPaths, skip condition extended, gated behind resolutionPolicy.allowExecSecretRefs) and src/cli/command-secret-gateway.test.ts (3 new/updated tests including mixed-target regression test).
  • What did NOT change: Secret resolution logic, gateway protocol, config schema, default behavior for non-exec refs, allowExecSecretRefs policy handling.
  • ClawSweeper P1/P2 addressed: collectActiveExecTargetRefPaths is gated by resolutionPolicy.allowExecSecretRefs and filtered to active command refs only — no-local-exec callers still attempt gateway, inactive exec refs do not poison skip decisions.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Motivation

When a user configures model-provider secrets with source: "exec" (e.g. models.providers.openai.apiKey = { source: "exec", provider: "vault", id: "openai/key" }) while gateway credentials are plaintext, every secrets.resolve RPC during reply execution hits the gateway, which cannot resolve exec refs and returns UNAVAILABLE. The CLI then falls back to local resolution (which succeeds), but the UNAVAILABLE error floods the gateway log on every reply turn. This is pure noise: the skip logic already existed for the case where gateway credentials themselves use exec refs, but was scoped too narrowly and did not filter inactive exec refs.

Real behavior proof

Behavior addressed: Gateway log flooded with secrets.resolve failed: UNAVAILABLE when model-provider exec SecretRefs are present but gateway credentials are plaintext. Additionally, inactive exec refs in mixed target sets must not trigger the skip.

Real environment tested: Linux x64, Node v22.11.0, branch fix/secrets-resolve-exec-skip-96653

Exact steps or command run after this patch:

cd openclaw && pnpm build cliStartup
# Run dist bundle proof script covering 3 scenarios
node --experimental-require-module pr-96661-evidence/proof-v2.mjs
# Run unit tests including mixed-target regression test
pnpm test src/cli/command-secret-gateway.test.ts -- --run

Evidence after fix:

Live dist bundle proof (production built code, real exec child process) — 3 scenarios:

========================================================================
  LIVE PROOF — PR #96661 (P1 fix: filter inactive exec refs)
========================================================================
Node: v22.11.0
Dist: dist/command-secret-gateway-C2q_A88T.js

[A] Active exec ref target → skip gateway RPC
------------------------------------------------------------
  Gateway skipped: ✅ YES
  Exec provider ran: ✅ YES
  Targets: {"talk.providers.acme-speech.apiKey":"resolved_local"}
  Diagnostic: talk reply: skipped gateway secrets.resolve because
    SecretRefs use exec providers at talk.providers.acme-speech.apiKey;
    rerun with --allow-exec to execute configured exec providers.

[B] Active env ref (no exec refs) → gateway called
------------------------------------------------------------
  Gateway skipped (should be NO): ✅ NO
  Gateway attempted: ✅ YES
  Targets: {"talk.providers.acme-speech.apiKey":"unresolved"}

[C] no-local-exec policy → gateway attempted (not skipped)
------------------------------------------------------------
  Gateway skipped: ✅ NO (correct)
  Gateway attempted: ✅ YES
  Targets: {"talk.providers.acme-speech.apiKey":"unresolved"}
  Diagnostics: doctor preview: skipped local exec SecretRef resolution...;
    doctor preview: gateway secrets.resolve unavailable...;
    attempted local command-secret resolution.

========================================================================
  SUMMARY
========================================================================
✅ ALL SCENARIOS PASS

  [A] Active exec ref → skip gateway → exec runs locally → NO UNAVAILABLE flood
  [B] Active env ref → gateway attempted (skip NOT triggered)
  [C] no-local-exec + active exec ref → gateway attempted (not skipped)

Unit tests (36/36) with real exec provider child processes + mixed-target regression test:

$ pnpm test src/cli/command-secret-gateway.test.ts -- --run

 RUN  v4.1.8

 ✓ skips gateway resolution when gateway credentials would execute exec SecretRefs
 ✓ skips gateway resolution when target SecretRefs include exec providers
 ✓ skips local exec SecretRef fallback when the caller disallows exec providers
 ✓ does not skip gateway resolution when only inactive targets use exec SecretRefs (NEW)
 ✓ keeps local exec SecretRef fallback enabled by default
 ...
 Test Files  1 passed (1)
      Tests  36 passed (36)

Key tests and what they prove:

Test What it proves
skips gateway resolution when gateway credentials would execute exec SecretRefs Gateway-credential exec ref path still works (regression)
skips gateway resolution when target SecretRefs include exec providers Target exec ref skip works; gateway creds are plaintext, callGateway not called
skips local exec SecretRef fallback when the caller disallows exec providers ClawSweeper P1 gate: with allowLocalExecSecretRefs: false, gateway is attempted (not skipped); exec ref stays unresolved
does not skip gateway resolution when only inactive targets use exec SecretRefs NEW — ClawSweeper P1 refinement: inactive exec ref does not trigger gateway skip; active env ref still goes through gateway
keeps local exec SecretRef fallback enabled by default Existing gateway UNAVAILABLE path still works (regression)

Observed result after fix:

  • Gateway secrets.resolve RPC is not attempted when any active target SecretRef uses an exec provider
  • Inactive exec refs no longer poison the skip decision — mixed target sets still go through gateway snapshot resolution
  • allowLocalExecSecretRefs=false callers (e.g. doctor preview) still attempt the gateway (not skipped)
  • Diagnostic message unified: skipped gateway secrets.resolve because SecretRefs use exec providers at ...
  • Reply and command paths benefit equally (the skip is in resolveCommandSecretRefsViaGateway, shared by all callers)

What was not tested:

  • Non-talk provider targets (e.g. web search, channel credentials) — the same shared resolveCommandSecretRefsViaGateway applies; target discovery is generic
  • Live gateway round-trip with real mixed targets (no local gateway available) — covered by unit test with mocked gateway snapshot

Root Cause (if applicable)

Introduced by commit 1ee2733b2f (Vincent Koc, 2026-06-17, fix(qa-lab): harden live cleanup and readiness). The collectActiveGatewayExecSecretRefCredentialPaths function filters ALL_GATEWAY_SECRET_INPUT_PATHS — only 4 gateway credential paths (gateway.auth.token/password, gateway.remote.token/password). Model-provider secrets (models.providers.*.apiKey, etc.) are never checked. The target ref paths were already known at the decision point, but this information was discarded before the skip check.

Additionally, ClawSweeper review identified: collectActiveExecTargetRefPaths collected all discovered exec refs including inactive ones, which could bypass gateway snapshot resolution for unrelated active targets in mixed target sets.

Regression Test Plan (if applicable)

Target test: src/cli/command-secret-gateway.test.ts

  • Existing test "skips gateway resolution when gateway credentials would execute exec SecretRefs" — verifies gateway-credential exec ref path still works
  • New test "skips gateway resolution when target SecretRefs include exec providers" — verifies active target exec ref triggers skip
  • New test "does not skip gateway resolution when only inactive targets use exec SecretRefs" — verifies inactive exec ref does not trigger skip

User-visible / Behavior Changes

None. The fix changes when the skip triggers (earlier in more cases for active exec refs, not at all for inactive exec refs) but the resolution outcome is identical — local resolution was already the fallback after UNAVAILABLE. Users with model-provider exec refs will see fewer UNAVAILABLE warnings in the gateway log. Users with only inactive exec refs see no behavior change.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No — same local resolution code path
  • New/changed network calls? No — fewer gateway RPCs
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Human Verification (required)

  • Verified scenarios: Source-code trace of skip condition logic, 3-scenario live dist bundle proof, unit test scenario walkthrough
  • Edge cases checked: Gateway creds exec + target exec (merged diagnostic), gateway creds plaintext + target exec (new fix path), gateway creds exec + target plaintext (existing behavior preserved), active env ref + inactive exec ref (P1 fix — gateway called), no-local-exec policy (P1 gate — not skipped)
  • What you did NOT verify: Non-talk provider targets (shared resolver covers all; activeConfiguredRefPaths is computed from classifyConfiguredTargetRefs which is target-agnostic); live gateway with real mixed exec targets

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes — existing users with active exec refs get fewer log lines; users with inactive exec refs see no change
  • Config/env changes? No
  • Migration needed? No

Best-fix Verdict

  • Best fix: Yes. The skip condition is the correct boundary — if any active target uses exec ref, gateway cannot resolve it, so skip unconditionally. Inactive exec refs are correctly excluded using the pre-existing active/inactive classification from classifyConfiguredTargetRefs.
  • Refactor needed: No. The new helper collectActiveExecTargetRefPaths follows the same pattern as existing helpers. classifyConfiguredTargetRefs returns an additional field (activeConfiguredRefPaths) that is a natural byproduct of its existing computation.
  • Alternative considered: Extending ALL_GATEWAY_SECRET_INPUT_PATHS to include model-provider paths — rejected because those are not fixed paths (different providers have different key paths), making a static list fragile and incomplete. Collecting all discovered exec refs unconditionally — rejected because inactive exec refs in mixed target sets would bypass gateway snapshot resolution for active non-exec targets.

AI Assistance

Risks and Mitigations

None. The fix only expands when the gateway RPC skip triggers. The local fallback path is the same code that already executed after every UNAVAILABLE error. The active/inactive filter reuses the pre-existing classification from classifyConfiguredTargetRefs. Three merge-risk labels are addressed:

  • 🚨 auth-provider — inactive exec refs do not affect active model-provider credential resolution
  • 🚨 compatibility — users with only inactive exec refs see no behavior change
  • 🚨 security-boundary — only active exec refs enter local resolution path; inactive exec refs do not change security boundaries

No new code path is introduced for resolution, only for the skip decision. All existing tests continue to pass (36/36, including new mixed-target regression test).


Related to #96653

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Jun 25, 2026
@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 2:17 PM ET / 18:17 UTC.

Summary
The PR extends command-secret gateway preflight so active exec-backed target SecretRefs skip the gateway secrets.resolve RPC, while preserving gateway attempts for inactive targets and no-local-exec callers, with focused regression tests.

PR surface: Source +50, Tests +158. Total +208 across 2 files.

Reproducibility: yes. at source level: queued replies use resolveCommandSecretRefsViaGateway, the target set includes model-provider credential refs, and current main only pre-skips gateway credential exec refs. I did not run a live gateway reply turn in this read-only review.

Review metrics: 1 noteworthy metric.

  • Secret execution routing: 1 pre-gateway skip broadened, 0 config/schema changes. This matters because the PR changes when existing exec SecretRefs resolve locally rather than through the gateway snapshot path without adding a migration or config knob.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/cli/command-secret-gateway.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96653
Summary: This PR is the open candidate fix for the linked reply-path exec SecretRef gateway log-flood issue; other same-issue PRs found in live search are closed unmerged alternates.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Refresh onto current main and rerun the focused command-secret gateway tests before landing.

Risk before merge

  • [P1] Merging intentionally changes the command-secret preflight boundary: active exec-backed targets bypass the gateway secrets.resolve RPC and resolve locally earlier, which maintainers should explicitly accept for existing exec SecretRef setups.
  • [P1] The affected surface is provider credential SecretRef resolution, so the final merge should preserve the active-target filter, inactive-target safeguard, and no-local-exec gate exactly.
  • [P1] The branch head is based behind current main, so maintainers should refresh and recheck the focused resolver tests before landing.

Maintainer options:

  1. Accept and land the guarded local skip (recommended)
    Refresh the branch and land the current shape if maintainers agree that active exec-backed command targets should avoid the gateway RPC and use the existing local resolver path.
  2. Hold for more upgrade proof
    Ask for refreshed proof covering active exec targets, inactive exec targets, and no-local-exec callers on the current base before deciding.
  3. Pause for a gateway-owned contract
    Pause or close this PR if maintainers want the gateway runtime to represent partial snapshot resolution instead of changing CLI preflight behavior.

Next step before merge

  • [P2] The next action is maintainer acceptance of the auth/security-boundary behavior plus branch refresh, not an automated repair on the PR branch.

Maintainer decision needed

  • Question: Should command-secret resolution skip the gateway RPC for active exec-backed target SecretRefs and resolve them locally when local exec is allowed?
  • Rationale: The patch appears correct for the reported log-flood bug, but the remaining choice is maintainer intent around an auth/security-sensitive execution boundary rather than a mechanical contributor repair.
  • Likely owner: steipete — The PR is assigned to steipete and recent history ties this person to the command-secret and gateway secrets surfaces under review.
  • Options:
    • Accept the guarded skip (recommended): Land the PR after base refresh, keeping the active-target, inactive-target, and no-local-exec safeguards as the intended command-secret behavior.
    • Keep gateway-first semantics: Reject or close this PR and tolerate the current expected UNAVAILABLE noise until a gateway-owned resolver contract is designed.
    • Require runtime-side redesign: Supersede this PR with a broader gateway/runtime-command-secret change if maintainers want partial snapshot success instead of a CLI preflight skip.

Security
Cleared: No concrete supply-chain or new permission issue was found; the secrets/local-exec routing change is captured as merge risk for maintainer acceptance.

Review details

Best possible solution:

Land this PR or an equivalent maintainer-sponsored patch after accepting active exec target refs as local-resolution triggers, preserving the active-target filter, no-local-exec gate, inactive-target safeguard, and regression tests.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: queued replies use resolveCommandSecretRefsViaGateway, the target set includes model-provider credential refs, and current main only pre-skips gateway credential exec refs. I did not run a live gateway reply turn in this read-only review.

Is this the best way to solve the issue?

Yes, if maintainers accept the boundary: the PR fixes the narrow log-flood path in the shared command-secret resolver and preserves active-target, inactive-target, and no-local-exec safeguards. A gateway-owned partial-resolution design is the main alternative if maintainers prefer gateway-first semantics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a6768d9de567.

Label changes

Label justifications:

  • P2: This fixes a normal-priority SecretRef/gateway log-noise bug with auth-provider impact but no reported failed replies, data loss, crash loop, or unusable runtime.
  • merge-risk: 🚨 compatibility: The diff changes command-secret resolution order for existing active exec-backed target configurations.
  • merge-risk: 🚨 auth-provider: The affected surface is model/provider credential SecretRef resolution during command and reply execution.
  • merge-risk: 🚨 security-boundary: The PR changes when configured exec secret providers run locally instead of making a gateway secrets.resolve request first.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from a built dist bundle with a real exec child process plus targeted unit-test output for active exec, env, inactive exec, and no-local-exec scenarios.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from a built dist bundle with a real exec child process plus targeted unit-test output for active exec, env, inactive exec, and no-local-exec scenarios.
Evidence reviewed

PR surface:

Source +50, Tests +158. Total +208 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 52 2 +50
Tests 1 164 6 +158
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 216 8 +208

What I checked:

  • Current main still only pre-skips gateway credential exec refs: On current main, resolveCommandSecretRefsViaGateway collects exec refs only from ALL_GATEWAY_SECRET_INPUT_PATHS; model-provider target SecretRefs still proceed to callGatewaySecretsResolve. (src/cli/command-secret-gateway.ts:938, a6768d9de567)
  • Reply path includes agent-runtime model-provider targets: Queued replies call resolveCommandSecretRefsViaGateway with getAgentRuntimeCommandSecretTargetIds(), and that target set includes models.providers.*.apiKey. (src/auto-reply/reply/agent-runner-utils.ts:77, a6768d9de567)
  • Gateway handler returns the noisy generic unavailable error: The gateway secrets.resolve handler logs internal failure detail and responds with generic UNAVAILABLE / secrets.resolve failed, matching the linked issue's reported log shape. (src/gateway/server-methods/secrets.ts:169, a6768d9de567)
  • PR head filters target-exec skip to active refs and local-exec-allowed policy: At the PR head, classifyConfiguredTargetRefs records active configured paths, collectActiveExecTargetRefPaths keeps only allowed active exec refs, and the skip branch runs only when local exec is allowed. (src/cli/command-secret-gateway.ts:530, bdb22d92e98d)
  • PR tests cover the important safeguards: The PR adds tests for active target exec refs skipping the gateway, no-local-exec policy still attempting gateway, and inactive exec refs not poisoning unrelated active target gateway resolution. (src/cli/command-secret-gateway.test.ts:755, bdb22d92e98d)
  • Canonical related issue remains open: The linked issue is still open and describes the exact per-reply secrets.resolve UNAVAILABLE flood for active model-provider exec SecretRefs that this PR targets.

Likely related people:

  • steipete: Recent history shows repeated command-secret/gateway SecretRef work, and the live PR is assigned to steipete for the remaining review decision. (role: recent command-secret and gateway secrets contributor; assigned reviewer; confidence: high; commits: 9e67f53b913a, d66fe50a10e0, e3a248585e66; files: src/cli/command-secret-gateway.ts, src/cli/command-secret-targets.ts, src/gateway/server-methods/secrets.ts)
  • joshavant: History ties broad SecretRef target coverage and doctor/channel SecretRef preview behavior to the same command-secret resolution and no-local-exec boundary this PR touches. (role: SecretRef feature-history contributor; confidence: medium; commits: 806803b7efe2, d9124c970085, 37169697d767; files: src/cli/command-secret-gateway.ts, src/cli/command-secret-targets.ts, src/commands/doctor/shared/preview-warnings.ts)
  • vincentkoc: The user-visible symptom is on queued reply execution, and recent history shows multiple reply-runtime changes around agent-runner-utils.ts. (role: recent reply-runtime contributor; confidence: medium; commits: 190ca52882bf, efd3172662ce, 2b75806197ab; files: src/auto-reply/reply/agent-runner-utils.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-06-25T08:53:56.992Z sha d82e2f0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-07T13:02:59.764Z sha bdb22d9 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 25, 2026
@SunnyShu0925
SunnyShu0925 force-pushed the fix/secrets-resolve-exec-skip-96653 branch from bc505e8 to d2d3e87 Compare June 25, 2026 03:58
@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 25, 2026
… gate behind policy

resolveCommandSecretRefsViaGateway now skips the gateway RPC when target
SecretRefs use exec providers — not just when gateway credentials themselves
are exec refs. Gateway cannot resolve exec refs, so the round-trip always
produced UNAVAILABLE → local fallback → log flood on every reply turn.

Three safeguards applied:
1. Collect active (not just discovered) exec target ref paths, so inactive
   exec refs in a mixed target set do not bypass gateway snapshot resolution
   for unrelated active targets.
2. Gate the target-exec skip behind resolutionPolicy.allowExecSecretRefs, so
   no-local-exec callers (e.g. doctor preview) still attempt the gateway.
3. Diagnostic message unified to cover both gateway-credential and target-ref
   exec paths.

Related to openclaw#96653

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@SunnyShu0925
SunnyShu0925 force-pushed the fix/secrets-resolve-exec-skip-96653 branch from 8680e67 to fa813b5 Compare June 25, 2026 06:37
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 25, 2026
@steipete steipete self-assigned this Jul 1, 2026
@steipete

Copy link
Copy Markdown
Contributor

Landed the corrected current-main replacement as #105160 / 00cab8d42b8bd6da2c868180d429b39368edf31c; #96653 is now closed as fixed.

The final implementation preserves @SunnyShu0925's contribution while fixing the mixed-target regression in the original bypass: Gateway snapshot assignments remain authoritative and local fallback resolves only missing paths. The fork branch's stale ancestry could not be updated safely without carrying unrelated mainline history, so I rebuilt the reviewed patch as exactly one commit atop current main and landed that replacement.

Thank you, @SunnyShu0925.

@steipete steipete closed this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants