Repository navigation
fix(agents): align plugin tool auth with provider runtime - #103852
Conversation
…h gating (openclaw#103828) The plugin-tool availability gate (hasAuthForProvider) consulted only the auth profile store, so tools like image analysis rejected providers whose API key arrives via the process environment (including keys injected through OPENCLAW_SERVICE_MANAGED_ENV_KEYS) or config apiKey SecretRefs - paths chat routing resolves fine via resolveApiKeyForProvider. Route the gate through the shared hasProviderAuthForTool helper the media model selection already uses, which layers runtime env, custom-provider SecretRefs, managed secrets, and the profile store.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 2:00 PM ET / 18:00 UTC. Summary PR surface: Source +10, Tests +23. Total +33 across 2 files. Reproducibility: yes. from source with high confidence: current main’s plugin-tool callback counts only auth-profile IDs, while the reported configured environment credential is recognized by the existing shared helper but not that callback. A live NVIDIA gateway reproduction was not independently run. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the shared canonical auth predicate, add or retain focused plugin-tool-boundary coverage, rebase onto current main, and prove the affected tool in a real gateway setup using only a redacted service-managed environment credential. Do we have a high-confidence way to reproduce the issue? Yes, from source with high confidence: current main’s plugin-tool callback counts only auth-profile IDs, while the reported configured environment credential is recognized by the existing shared helper but not that callback. A live NVIDIA gateway reproduction was not independently run. Is this the best way to solve the issue? Yes in direction: reusing the existing multi-source auth helper is the narrowest maintainable fix and avoids a second provider-auth policy. The proof should additionally observe the plugin-tool boundary and live setup rather than only invoke the helper directly. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b597a8d364f2. Label changesLabel justifications:
Evidence reviewedPR surface: Source +10, Tests +23. Total +33 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
This pull request has been automatically marked as stale due to inactivity. |
Use prepared runtime/config auth plus the authoritative per-run profile store for plugin tool availability and credential resolution. Preserve profile precedence and no-store behavior while avoiding repeated metadata and store discovery. Closes openclaw#103828. Co-authored-by: Shubhankar Tripathy <[email protected]>
Keep direct env lookup for callers without a prepared runtime auth lookup while allowing prepared plugin-tool composition to skip redundant metadata discovery.
|
Merged via squash.
|
…03852) * fix(agents): count env/config credentials in plugin tool provider-auth gating (openclaw#103828) The plugin-tool availability gate (hasAuthForProvider) consulted only the auth profile store, so tools like image analysis rejected providers whose API key arrives via the process environment (including keys injected through OPENCLAW_SERVICE_MANAGED_ENV_KEYS) or config apiKey SecretRefs - paths chat routing resolves fine via resolveApiKeyForProvider. Route the gate through the shared hasProviderAuthForTool helper the media model selection already uses, which layers runtime env, custom-provider SecretRefs, managed secrets, and the profile store. * fix(agents): preserve unprepared auth fallback Keep direct env lookup for callers without a prepared runtime auth lookup while allowing prepared plugin-tool composition to skip redundant metadata discovery. --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #103828
What Problem This Solves
Fixes an issue where provider-auth-gated plugin tools could be hidden even though the current agent run could resolve a valid environment, configured SecretRef, managed-secret, or custom-provider credential. The old gate counted only ordered auth profiles, so provider execution and tool availability disagreed.
Why This Change Was Made
The maintainer rewrite aligns both halves of the contract. When the run supplies its authoritative auth store, plugin-tool availability uses a prepared config/workspace-aware runtime lookup plus that store. Execution keeps the existing ordered-profile precedence and falls back to canonical runtime/config credential resolution only when no ordered profile yields a key.
No-store callers remain ungated and never discover persistent auth state. Provider metadata is prepared once for availability rather than rediscovered per manifest signal. This preserves tenant/billing identity when both a profile and environment key exist.
User Impact
Plugin tools can now use the same supported auth sources as provider execution, including process-environment credentials injected by service management and configured provider SecretRefs. Explicit profile order remains authoritative, missing credentials still hide the tool, and no new config or migration is required.
Evidence
8d7db671530d0e201007e85ee0597eec1badfff2x_searchpassed 1/1 in 3.3s with content and citations using an environment-only credential loaded through the approved secret path; the value was never printed or persisted.XAI_API_KEY, so a credential-bearing remote Gateway turn was not possible without widening secret scope. The changed plugin composition/execution boundary is covered with environment-only production tests, and the same xAI tool executed a real provider request locally through the approved secret path.90446298919. The only rerun was an unrelated local Gateway-connect timeout inlarge-3.Contributor credit is preserved with
Co-authored-by: Shubhankar Tripathy <[email protected]>on the prepared commit.