Skip to content

Tavily plugin throws UnresolvedSecretInputError before falling back to process.env #95109

Description

@kzzalews

Summary

tavily_search and tavily_extract fail at runtime with unresolved SecretRef "env:default:TAVILY_API_KEY" even when TAVILY_API_KEY is set in the gateway process environment.

The configured SecretRef points at an env-backed credential that the active runtime snapshot can't inline-resolve, but the plugin's resolveTavilyApiKey already has a process.env.TAVILY_API_KEY fallback. The throw from normalizeConfiguredSecret (strict mode) fires before that fallback is reached.

Reproduction

export TAVILY_API_KEY=***
openclaw config set plugins.entries.tavily.config.webSearch.apiKey \
  --ref-provider default --ref-source env --ref-id TAVILY_API_KEY
openclaw infer web search --provider tavily --query ping --limit 1 --json

Expected: tavily provider receives the key (or returns an auth error if the key is invalid).

Actual: SecretRef-resolution error; provider never reached.

The same call works fine when the configured apiKey is a plain string (no SecretRef). It also works for the brave and firecrawl web-search providers, which use the companion readConfiguredSecretString helper that catches the same strict-mode throw.

Root cause

extensions/tavily/src/config.tsnormalizeConfiguredSecret calls normalizeResolvedSecretInputString with the default mode: "strict", which throws UnresolvedSecretInputError when the snapshot cannot inline-resolve. The throw escapes the helper before the || normalizeSecretInput(process.env.TAVILY_API_KEY) fallback in resolveTavilyApiKey can rescue the key.

The companion readConfiguredSecretString in extensions/web-search-provider-common/src/web-search-provider-common.ts (used by brave, firecrawl, exa) wraps the same call in a function-local error path that returns undefined. That mismatch is why other web-search plugins work and tavily does not.

Related

Environment

Local reproduction

Local patch and SHA-baselined application in kzzalews/mikrus-gitops (prestart.sh step 7/7, commit ab70875) and documented in kzzalews/openclaw (commit e520657).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions