fix(cli): resolve plugin web search SecretRefs for infer web search#82699
fix(cli): resolve plugin web search SecretRefs for infer web search#82699leno23 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5230d268a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { effectiveConfig } = await resolveCommandConfigWithSecrets({ | ||
| config: cfg, | ||
| commandName: params.commandName, | ||
| targetIds: getAgentRuntimeCommandSecretTargetIds(), |
There was a problem hiding this comment.
Limit web command secret resolution to web targets
resolveCapabilityCommandConfig now resolves getAgentRuntimeCommandSecretTargetIds(), which includes unrelated surfaces like models.providers.*.apiKey. For infer web search / infer web fetch, that means an unresolved or unavailable model SecretRef can abort the web command before execution, even when web provider credentials are valid. This is a regression from the prior behavior where these commands only depended on web configuration, and it can break web workflows in configs that intentionally leave model secrets unresolved.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source-reproducible. Current main reads raw config for CLI web search/fetch while the docs require selected-provider SecretRef resolution; the remaining PR blockers are also source-reproducible from the new target helper. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the PR open and narrow command secret resolution to command-specific web search/fetch credential ids, remove the broad plugin prefix, add non-web and cross-family SecretRef regression coverage, and require redacted real CLI proof. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main reads raw config for CLI web search/fetch while the docs require selected-provider SecretRef resolution; the remaining PR blockers are also source-reproducible from the new target helper. Is this the best way to solve the issue? No. Command-time secret resolution is the right fix direction, but this implementation must use narrower command-specific target sets and prove the actual CLI path after the change. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 91f45d9c8a10. |
|
@clawsweeper re-review — added live repro script + updated Real behavior proof section with copied terminal output. |
|
@clawsweeper re-review — narrowed secret resolution to |
|
Status: CI green, |
77b6be0 to
55e9f49
Compare
Materialize agent-runtime plugin credentials through the shared command secret resolution path before local web search/fetch runs, matching gateway runtime behavior for plugins.entries.*.config.webSearch.apiKey refs. Fixes openclaw#82621 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use getCapabilityWebCommandSecretTargetIds instead of the full agent runtime target set so infer web search/fetch do not resolve unrelated model, memory, or channel credentials. Co-authored-by: Cursor <cursoragent@cursor.com>
55e9f49 to
febfe1d
Compare
|
Thanks for jumping on this, @leno23. Your PR correctly identified the central failure mode from #82621: We landed the fix in #82798 as a broader version of that approach. It resolves command SecretRefs before local provider-backed infer commands run, keeps selected-provider web search/fetch resolution scoped, and extends the repair to the other local provider-backed infer surfaces that had the same root cause. Given that #82798 is merged, this PR is now superseded by the landed fix. |
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes #82621. Replacement for #82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
|
Thanks @leno23. I landed the replacement fix in #82819 as commit 9e67f53. I could not update this PR branch directly because maintainer edits were disabled, so I recreated the fix locally, kept your co-author credit on the squash commit, added the missing tests/proof, and merged that replacement PR. For future PRs, enabling "Allow edits by maintainers" lets us push small fixups directly to your branch. |
|
Thanks @leno23. I could not update this fork branch directly because maintainer edits are disabled, so I recreated the fix in maintainer PR #83020 and preserved contributor commit credit. Landed as #83020 / 9616aa6 with the scoped SecretRef behavior, regression coverage, protocol refresh, and changelog credit. For future PRs, enabling "Allow edits by maintainers" lets us apply small fixups directly to the original branch. |
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials. - Carry command provider overrides through gateway and local secret resolution. - Mark the selected web provider targets active and unrelated plugin refs inactive. - Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior. - Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement. Fixes openclaw#82621. Replacement for openclaw#82699. Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
Summary
Fixes #82621 —
openclaw infer web search(and web fetch) read raw config and left pluginwebSearch.apiKeyas unresolved SecretRef objects.Routes
runWebSearch/runWebFetchthroughresolveCommandConfigWithSecrets+getAgentRuntimeCommandSecretTargetIds()so CLI commands materialize secrets before invoking web search runtime.Real behavior proof
infer web searchmust resolveplugins.entries.tavily.config.webSearch.apiKeySecretRefs before callingrunWebSearch.fix/cli-web-search-secret-refs;TAVILY_API_KEYset in shell (no live Tavily HTTP call).TAVILY_API_KEY=resolved-live-proof pnpm exec tsx scripts/repro/cli-web-search-secret-refs-live-proof.mjsresolveCommandConfigWithSecretsreturns a string API key from env; raw config still holds the SecretRef object.openclaw infer web search --provider tavilyHTTP request against Tavily with a running gateway.Test plan
TAVILY_API_KEY=resolved-live-proof pnpm exec tsx scripts/repro/cli-web-search-secret-refs-live-proof.mjsnode scripts/run-vitest.mjs src/cli/capability-cli.test.ts -t "resolves plugin web search"node scripts/run-vitest.mjs src/cli/command-secret-resolution.coverage.test.tsRoot Cause
runWebSearchCommandusedgetRuntimeConfig()directly, bypassing command-time secret resolution used elsewhere.runWebSearch.webSearch.apiKeyas a SecretRef surface.Regression Test Plan
src/cli/capability-cli.test.ts— mocks assertresolveCommandConfigWithSecretswithcommandName: "infer web search"src/cli/command-secret-resolution.coverage.test.ts— allowlist entry for capability-cliFixes #82621