Skip to content

fix(secrets): avoid exec target gateway failures#96914

Closed
wuqxuan wants to merge 1 commit into
openclaw:mainfrom
wuqxuan:codex/reply-secretref-log-noise
Closed

fix(secrets): avoid exec target gateway failures#96914
wuqxuan wants to merge 1 commit into
openclaw:mainfrom
wuqxuan:codex/reply-secretref-log-noise

Conversation

@wuqxuan

@wuqxuan wuqxuan commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #96653.

secrets.resolve could return a generic UNAVAILABLE for reply-path command secret resolution when a broad target set included model-provider exec SecretRefs that were not materialized in the active runtime snapshot. That made the gateway log a noisy per-turn failure even though the CLI command-secret path can still degrade to local fallback for the unresolved exec target.

Why This Change Was Made

The gateway runtime resolver now returns the assignments it can prove from the active snapshot when the remaining unresolved command targets are exec-backed SecretRefs. Non-exec unresolved targets still fail as before, and the CLI-side fallback remains responsible for resolving or degrading the unresolved exec paths.

This keeps the owner boundary in the gateway runtime secret resolver instead of adding a CLI shortcut that would bypass already-materialized gateway snapshot values.

User Impact

Users with exec-backed model-provider credentials should no longer see misleading reply-path secrets.resolve failed / UNAVAILABLE gateway log noise for otherwise recoverable command-secret resolution. Already-resolved gateway snapshot credentials continue to be returned normally.

Evidence

  • node_modules/.bin/oxfmt --write --threads=1 src/secrets/runtime-command-secrets.ts src/secrets/runtime-command-secrets.test.ts
  • git diff --check
  • node scripts/run-vitest.mjs src/secrets/runtime-command-secrets.test.ts src/cli/command-secret-gateway.test.ts -- --reporter=verbose passed: 2 shards, 37 tests
  • .agents/skills/autoreview/scripts/autoreview --mode local --parallel-tests "node scripts/run-vitest.mjs src/secrets/runtime-command-secrets.test.ts src/cli/command-secret-gateway.test.ts -- --reporter=verbose" passed with no accepted/actionable findings

@wuqxuan
wuqxuan requested a review from a team as a code owner June 26, 2026 03:10
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: the same reply-path exec SecretRef log-flood bug is already covered by an open, clean, proof-positive replacement PR, while this PR lacks real behavior proof and changes gateway secrets.resolve success semantics for unresolved exec targets.

Canonical path: Close this PR and keep review focused on #96661, which addresses the same bug at the CLI preflight boundary with positive real behavior proof.

So I’m closing this here and keeping the remaining discussion on #96661.

Review details

Best possible solution:

Close this PR and keep review focused on #96661, which addresses the same bug at the CLI preflight boundary with positive real behavior proof.

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

Yes at source level: queued replies request agent-runtime targets that include model-provider credentials, and current main only skips the gateway RPC for 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?

No for this branch: the superseding CLI preflight approach is safer because it avoids the expected failing RPC before crossing the gateway protocol boundary, while this PR changes runtime secrets.resolve partial-success semantics.

Security review:

Security review cleared: No concrete security or supply-chain defect was found; the credential-routing behavior change is captured as compatibility/auth-provider merge risk.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • joshavant: History shows broad SecretRef coverage and read-only command SecretRef hardening commits in the command-secret and target-registry area. (role: SecretRef feature-history contributor; confidence: high; commits: 806803b7efe2, a2cb81199e22, da34f81ce237; files: src/cli/command-secret-gateway.ts, src/secrets/target-registry-data.ts, src/cli/command-secret-targets.ts)
  • Peter Steinberger: Recent history on src/cli/command-secret-gateway.ts includes several command-secret gateway and lower-reader refactors near this boundary. (role: recent command-secret contributor; confidence: medium; commits: 6a052ca4b827, 1a3f141215e2, 978a0a720e9b; files: src/cli/command-secret-gateway.ts)
  • Vincent Koc: File history shows gateway and runtime seam refactors that affect the same command-secret and runtime snapshot boundary. (role: adjacent gateway/runtime contributor; confidence: medium; commits: 0f7d9c957093, 74e7b8d47b18, 3e4de956c068; files: src/cli/command-secret-gateway.ts, src/secrets/runtime-command-secrets.ts)

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

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 26, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: reply-path secrets.resolve floods gateway log with UNAVAILABLE for model-provider exec SecretRefs (degrades correctly, ~1 line/turn)

1 participant