fix(tavily): use inspect mode for SecretRef resolution to allow env fallback (fixes #95109)#95112
fix(tavily): use inspect mode for SecretRef resolution to allow env fallback (fixes #95109)#95112liuhao1024 wants to merge 2 commits into
Conversation
…allback normalizeConfiguredSecret used normalizeResolvedSecretInputString which hardcodes mode: "strict" — throwing UnresolvedSecretInputError before the process.env.TAVILY_API_KEY fallback in resolveTavilyApiKey could run. Switch to resolveSecretInputString with mode: "inspect" so unresolved SecretRefs return configured_unavailable instead of throwing, allowing the || chain to fall through to the env var fallback.
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 7:32 PM ET / 23:32 UTC. Summary PR surface: Source -3. Total -3 across 1 file. Reproducibility: yes. Source inspection on current main and v2026.6.8 shows an unresolved Tavily API-key SecretRef reaches strict Review metrics: 1 noteworthy metric.
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 findings
Review detailsBest possible solution: Keep the plugin-local fix, but preserve the unavailable ref details and only allow env fallback for the intended env-backed Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main and v2026.6.8 shows an unresolved Tavily API-key SecretRef reaches strict Is this the best way to solve the issue? No. Inspect mode is the right direction, but this implementation is too broad because it discards Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f9f94e7dcd23. Label changesLabel justifications:
Evidence reviewedPR surface: Source -3. Total -3 across 1 file. View PR surface stats
Security concerns:
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
|
|
Closing as clawsweeper identified this as a superseded/duplicate of prior attempts. Cleaning up stale PRs. |
Summary
tavily_searchandtavily_extractthrowUnresolvedSecretInputErrorwhenapiKeyis configured as a SecretRef (e.g.env:default:TAVILY_API_KEY) even when the env var is set. The strict-mode resolution innormalizeConfiguredSecretthrows before theprocess.env.TAVILY_API_KEYfallback inresolveTavilyApiKeycan execute.Fix: use
resolveSecretInputStringwithmode: "inspect"so unresolved SecretRefs returnconfigured_unavailableinstead of throwing, allowing the||chain to fall through to the env var fallback.Fixes #95109
Changes
extensions/tavily/src/config.ts: replacednormalizeResolvedSecretInputString(strict mode, throws) withresolveSecretInputString({ mode: "inspect" })(returnsconfigured_unavailableon unresolved refs)Real behavior proof
UnresolvedSecretInputErroron SecretRef apiKey config instead of falling back toprocess.env.TAVILY_API_KEYpnpm build, ran tavily extension tests, verified source uses inspect modenormalizeConfiguredSecretnow returnsundefinedon unresolved SecretRefs (instead of throwing), allowingresolveTavilyApiKeyto fall through toprocess.env.TAVILY_API_KEYreadConfiguredSecretString(same strict-mode issue exists there but is out of scope for this fix)Note
readConfiguredSecretStringinsrc/agents/tools/web-search-provider-common.ts:76has the same strict-mode throw pattern and is used by brave, firecrawl, exa, and other providers. A follow-up fix should apply the same inspect-mode pattern there.