Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 2:26 PM ET / 18:26 UTC (Revision 14). ClawSweeper reviewWhat this changesAllows Tavily search and extraction to reach operator-configured private endpoints through a hostname-scoped network helper, with metadata protection, documentation, and regression coverage. Merge readiness⛔ Blocked before merge - 4 items remain The change remains useful: current main still blocks these private endpoints, and the related merged work does not replace it. Source review found no actionable defect, and the recorded transport proof supports the proposed behavior. Priority: P2 Review scores
Verification
How this fits togetherThe Tavily plugin turns agent search and extraction requests into authenticated HTTP requests. The shared network guard controls which configured destinations and redirects those requests may reach. flowchart TD
A[Agent search or extraction] --> C[Tavily client]
B[Operator endpoint configuration] --> C
C --> D{Hosted or custom host}
D --> E[Existing hosted guard]
D --> F[Hostname-scoped private endpoint guard]
E --> G[Direct or proxy transport]
F --> G
G --> H[Parsed search or extraction results]
Decision needed
Why: The recorded product acceptance explicitly leaves these owner approvals outstanding, and SDK policy requires them for this trust expansion. Before merge
Agent review detailsSecurityNone. PR surfaceSource +92, Tests +579, Docs 0, Other +3. Total +674 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared hostname-scoped transport with metadata and redirect safeguards, subject to SDK/security-owner acceptance of its documented upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: configure Tavily with a private baseUrl and invoke search or extraction; current main selects the guard that rejects it. This read-only review did not execute that path. Is this the best way to solve the issue? Yes, subject to owner acceptance: the helper composes existing network policies and shares HTTP handling, while the existing self-hosted helper would grant broader access. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae36af547ee9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
06b6135 to
a961c28
Compare
a961c28 to
d086ea5
Compare
d086ea5 to
db0e8b5
Compare
db0e8b5 to
7e5804f
Compare
7e5804f to
c7a22d7
Compare
Maintainer acceptanceAt @sallyom’s direction, we accept the documented trust-boundary change in This acceptance includes hostname-wide scope across ports/schemes and delegation of target DNS enforcement to an operator-configured environment proxy. Recognized metadata destinations remain locally blocked; proxy-resolved addresses are the proxy’s responsibility. Different-host redirects remain rejected, and the default hosted Tavily path is unchanged. CI run 34558848630 is green on this head; the latest review reports no blocking code findings. This records the maintainer decision, not a substitute for any separately required SDK/SecOps owner approval or permission to bypass merge gates. @openclaw/openclaw-secops — please review the accepted hostname-wide private-endpoint and proxy-DNS contract above and record the security-owner disposition required by src/plugin-sdk/AGENTS.md; coordinate SDK-owner acceptance as applicable. This request does not authorize a gate bypass. |
8fee4b1 to
9c04c2d
Compare
A Tavily baseUrl on a private or internal host was unusable: requests went through the trusted-endpoint guard, which keeps the private-network checks on, so hosts ending in .internal, .local or .localhost and private, loopback or link-local addresses were refused before the request left the process. No plugin setting reaches the policy. Treat baseUrl as operator authority and trust the host named in it by exact name. The configured host is honored as typed, including loopback and private addresses. Cloud-metadata destinations are always refused: the new guard helper routes 169.254.169.254 and other link-local literals, fd00:ec2::254, 100.100.100.200, their mapped and embedded forms and metadata.google.internal to the strict guard, which rejects them before any DNS lookup or request in direct and env-proxy mode alike. A configured name whose DNS answer is loopback, unspecified, link-local or cloud-metadata is refused, because that answer was not the operator's choice. Off-host redirects are refused. With an env proxy the proxy resolves the name, as for every trusted call. The default api.tavily.com endpoint keeps the trusted-endpoint mode unchanged. The helper combines the existing fake-IP hostname allowlist with the existing exact-host allowedHostnames policy for the request URL's host; isCloudMetadataHostnameOrIp in ssrf.ts reuses the guard's metadata hostname and the net-policy metadata and link-local IP classifiers. postTrustedWebToolsJson's request shape, error handling and response parsing move into a shared helper; postPinnedTrustedHostWebToolsJson is the one new plugin-sdk export, recorded in the SDK surface ledger and used by the Tavily client when the resolved base URL's host is not api.tavily.com. Co-authored-by: sallyom <[email protected]>
9c04c2d to
d036090
Compare
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
What Problem This Solves
Fixes an issue where operators who set the Tavily plugin's
baseUrl(plugins.entries.tavily.config.webSearch.baseUrlorTAVILY_BASE_URL) to a Tavily-compatible endpoint on a private or internal host would find everytavily_searchandtavily_extractcall refused before it left the process. The documented override exists for self-hosted gateways, policy proxies and test doubles, and those endpoints are normally addressed by private names such as*.internal,*.localor an RFC 1918 address, or by a loopback address on the same machine. Routing through an env proxy does not change the outcome, and no plugin setting affects it.Why This Change Was Made
The client posts through the trusted-endpoint guard mode, whose policy pins the hostname but keeps the private-network checks on. This change treats
baseUrlas operator authority and trusts the host named in it by exact name, under this contract:localhost-style names.169.254.169.254and other link-local literals,fd00:ec2::254,100.100.100.200, their mapped and embedded encodings, andmetadata.google.internal. AbaseUrlnaming one of these is routed to the strict guard, which refuses it before any DNS lookup or request in direct and env-proxy mode alike.api.tavily.comendpoint keeps the trusted-endpoint mode unchanged.The guard gains an internal helper that combines the existing fake-IP hostname allowlist with the existing exact-host
allowedHostnamespolicy for the request URL's host, after checking the host against a newisCloudMetadataHostnameOrIpclassifier insrc/infra/net/ssrf.tsthat reuses the guard's metadata hostname and thenet-policymetadata and link-local IP classifiers.postTrustedWebToolsJson's request shape, error handling and response parsing move into a shared helper, andpostPinnedTrustedHostWebToolsJsonis the one newplugin-sdk/provider-web-searchexport, used by the Tavily client when the resolved base URL's host is notapi.tavily.com. The plugin SDK surface ledger records the export. The Tavily docs state the contract under "Custom base URL".Alternative considered: an explicit
webSearch.selfHostedopt-in flag. Not chosen because an operator who setsbaseUrlhas already named the host, and anyone able to writebaseUrlcan write the flag, so it adds a setting without adding a control.User Impact
Operators can point the Tavily plugin at a Tavily-compatible endpoint on a private, internal or loopback host and use
tavily_searchandtavily_extractagainst it, directly or through an env proxy. Users of the default endpoint see no change. Cloud-metadata destinations remain unreachable, and a configured name whose DNS answer is loopback, link-local or metadata remains refused.Evidence
September 18, 2026 rebase
Current head:
d0360908091ed8ec8e444ebb9646bde815a188f9, rebased onto mainae36af547ee90ce128cb37f6bc0dfe411b36cc54. Resolved only SDK budget conflicts, preserving main’s additions and this PR’s +1 helper (4486 exports; 2650 function exports). Range-diff, source comparisons, andgit diff --checkpassed; reviewed Tavily code/tests and contributor credit are unchanged. Earlier CI/review results below are historical, not a green result for this new head. Maintainer acceptance and existing review requests are unchanged.September 12, 2026 refresh
548a8002bd7caa1afb8eff232e4bc7321f25a06d, rebased onto maine16fc3c97374d3c0768ee6afb2e283a35c2d485c.readProviderEnvValuemigration remains intact.git range-diff, changed-file comparisons, andgit diff --checkconfirm the accepted Tavily routing, metadata/DNS/redirect policy, and tests are preserved. Original contributor authorship and existing coauthor credit are retained.checks-node-compact-large-14:src/agents/runtime-plan/resolve-auth.test.ts:159exceeded its explicit 1000ms timeout. The shard otherwise reported 3,132 passed and 4 skipped tests. This is not yet attributed to a flake, main, or the PR. The single failed-jobs-only rerun, attempt 2, passed on the unchanged head at 18:12 UTC on September 12, 2026, with no test, timeout, or source changes. The previously failing test passed in 232ms, its shard passed, and the requiredopenclaw/ci-gateis green. The successful retry does not establish the cause of attempt 1’s timeout. Historical test/runtime evidence below retains its original provenance.Focused tests, all passing on the rebased branch:
extensions/tavily/src/tavily-client.test.ts: the defaultbaseUrl(also with a trailing slash, surrounding whitespace, or an uppercase host) callspostTrustedWebToolsJsonwith the existing arguments;https://tavily.gateway.internal(search) andhttp://10.0.0.5:8080/tavily/(extract) callpostPinnedTrustedHostWebToolsJsonwith the same parameter shape; in each case the other helper is not called.src/agents/tools/web-guarded-fetch.test.ts: the pinned helper passesallowRfc2544BenchmarkRange,allowIpv6UniqueLocalRange,hostnameAllowlist: [host]andallowedHostnames: [host], and nothing else;https://169.254.169.254/search,https://metadata.google.internal/searchand a non-http(s)URL reach the strict guard with no policy.src/agents/tools/web-guarded-fetch.pinned-endpoint.test.ts(real guard, injectedfetchImplandlookupFn): trusted mode reachesapi.tavily.comand rejects it before any request when it resolves to127.0.0.1; trusted mode rejectsproxy.example.internal,tavily.corp.local,tavily.localhost,10.0.0.5and[::1]before any request; the pinned guard reaches the configured host for each of those names and[fd00::1]when DNS answers a private address, and honors127.0.0.1,[::1],localhostandtavily.localhostwhen they resolve to loopback;169.254.169.254,[::ffff:169.254.169.254],[fd00:ec2::254],100.100.100.200andmetadata.google.internalare rejected with no lookup and no request, both directly and withhttp_proxy/https_proxyset;tavily.gateway.internalresolving to127.0.0.1,::1,0.0.0.0,169.254.169.254,fd00:ec2::254or100.100.100.200is rejected after one lookup and before any request, while10.0.0.5,192.168.1.20andfd00::1reach the fetch; a redirect from the configured host to any other host, private orapi.tavily.com, is rejected after one request, and a same-host redirect is followed; withhttps_proxyset, the configured name is reached with no local DNS lookup, and a redirect toproxy.example.internalis rejected; the request timeout still aborts.src/agents/tools/web-search-provider-common.test.ts: against a loopback server,postTrustedWebToolsJsonis rejected with no request received;postPinnedTrustedHostWebToolsJsonhonors the operator-configured loopback endpoint and delivers thePOSTwithAccept,Authorization: Bearer,Content-Typeand the extra header, returning the parsed JSON; a 401 produces the same redacted, size-bounded error as the trusted path.Results:
pnpm test:extension tavily56 passed; the threesrc/agents/toolsguard files 67 passed;pnpm test:contracts:plugins1128 passed;oxfmtandoxlintclean on the changed files;pnpm check:changedlanes pass, including typecheck, plugin boundaries and the plugin SDK surface budget (thelintlane did not complete on the local machine because module resolution escaped the checkout into an unrelated install; CI runs it).Local run: a Tavily-shaped stub (
POST /search,POST /extract) on127.0.0.1:18080, a logging HTTP proxy stub on127.0.0.1:18090that records everyCONNECTand absolute-URI request, tunnelsCONNECTto the stub's port and answers 403 to any other tunnel, and the real plugin client (runTavilySearch,runTavilyExtractfromextensions/tavily/src/tavily-client.ts) driven from source. The driver records every localdns.lookupcall. The private name is redacted.(a) The operator-configured loopback endpoint is honored: both calls succeed and the stub receives exactly two requests. (b) and (c) A metadata
baseUrlis refused before any lookup or connection, with or without an env proxy; the proxy log stays empty. (d) A private name is delivered through the proxy: oneCONNECTper call, the name arrives at the proxy unresolved, and the stub receives exactly two requests. (e1) and (e2) The default endpoint in trusted mode and a private name in pinned mode behave identically under the proxy: oneCONNECTper call carrying the hostname as written, zero local DNS lookups, and the same failure when the proxy refuses the tunnel. The pinned helper does not weaken proxy mode beyond exempting the one configured host from the pre-DNS hostname rule.