fix: require env resolution for web provider refs#96400
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 11:52 AM ET / 15:52 UTC. Summary PR surface: Source +4, Tests +37. Total +41 across 2 files. Reproducibility: yes. Source inspection on current main shows env shorthand is parsed as a SecretRef and then still counted as a nonempty literal credential before env resolution; I did not run tests in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the shared-helper fix after maintainers accept the stricter env-ref credential semantics; keep the rule centralized and preserve literal and non-env SecretRef behavior. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows env shorthand is parsed as a SecretRef and then still counted as a nonempty literal credential before env resolution; I did not run tests in this read-only review. Is this the best way to solve the issue? Yes. The shared helper is the right fix boundary because both web_search and web_fetch call it; caller-level fixes would duplicate credential semantics and risk drift. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ef53c20497e1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +37. Total +41 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
Review history (1 earlier review cycle)
|
450a9f0 to
04b3432
Compare
|
Merged via squash.
|
* fix: require env resolution for web provider refs * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <[email protected]>
* fix: require env resolution for web provider refs * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <[email protected]>
What Problem This Solves
Fixes an issue where web provider credential detection treated env secret references such as
${CUSTOM_API_KEY}or$CUSTOM_API_KEYas literal configured credentials when the referenced environment variable was missing.AI-assisted: yes. I reviewed the touched credential detection path and ran the focused validation below.
Why This Change Was Made
Recognized env secret refs now prove credential availability only through the env resolver, while non-env secret refs and normal literal strings keep their existing behavior. The same rule applies to primary and fallback credential sources.
User Impact
Web search/fetch provider setup no longer reports a provider as credentialed just because a missing env reference string is present in config. Operators get more accurate provider availability and fallback behavior.
Evidence
node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts packages/web-content-core/src/provider-runtime-shared.test.tsnode_modules\.bin\oxfmt.cmd --check packages/web-content-core/src/provider-runtime-shared.ts packages/web-content-core/src/provider-runtime-shared.test.tsgit diff --checkFollow-up Evidence After Review
The review asked for real provider/config behavior proof and compatibility notes. I ran the shared web provider credential path directly with a configured web search provider using
apiKey: "${CUSTOM_API_KEY}".Live provider/config output from this branch:
Compatibility/auth-provider note: non-env SecretRefs (
file/exec) and provider auth entries are still treated as configured credentials. Literal config strings are still accepted as before. This change only prevents env-style refs (${CUSTOM_API_KEY},$CUSTOM_API_KEY, and legacy env markers) from being counted as a credential when env resolution actually misses.Focused validation:
git diff --checkproduced no output.