Repository navigation
refactor(plugins): tighten web fetch provider boundary - #59646
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d4960573d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR completes the web-fetch provider boundary work from #59465: moves the remaining Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: scripts/check-web-fetch-provider-boundaries.mjs
Line: 64
Comment:
**Boundary guard only checks 6 specific files**
The guard walks all of `src/` via `walkFiles` but immediately skips any file not in `focusedCoreFiles`, so it effectively only protects those 6 enumerated files. A new file like `src/agents/tools/web-fetch-helper.ts` could contain Firecrawl-specific fetch logic and would silently pass. By contrast, the sibling `check-web-search-provider-boundaries.mjs` does a comprehensive scan of all of `src/` using a baseline inventory — making the fetch guard notably weaker. If the intent is to protect the entire core boundary (not just the allowlist), the file-enumeration approach should be replaced with an allowlist-exclusion approach, similar to the web-search guard.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/plugins/contracts/suites.ts
Line: 157-160
Comment:
**`credentialPath` must appear in `inactiveSecretPaths` when defined — consider a comment**
The new assertion `expect(provider.inactiveSecretPaths).toContain(provider.credentialPath)` enforces an invariant that is non-obvious from the type description (`"Legacy or inactive credential paths that should warn but not activate this provider"`). The reason `credentialPath` must also be in the list is that `inactivePathsForProvider` in `runtime-web-tools.ts` uses `inactiveSecretPaths` directly when it is non-empty, so omitting `credentialPath` would cause the active credential path to be excluded from classification/detection. A brief inline comment on the assertion (or on the `inactiveSecretPaths` type field) explaining this coupling would prevent future implementors from accidentally omitting `credentialPath` from their list.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Merge branch 'main' into chore/web-fetch..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33d3aa47b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /providerId:\s*"firecrawl"/, | ||
| /provider:\s*"firecrawl"/, | ||
| /id:\s*"firecrawl"/, |
There was a problem hiding this comment.
Cover equality checks in web-fetch boundary guard
The new boundary lint only looks for object-literal/import spellings like providerId: "firecrawl" and provider: "firecrawl". A core regression written as a comparison (for example if (providerId === "firecrawl") or case "firecrawl":) is not matched, so lint:web-fetch-provider-boundaries can return success even when Firecrawl-specific fetch branching has re-entered src/**. Because this guard is now wired into check-additional as the enforcement point, these common comparison forms need to be detected as well (or handled via AST parsing).
Useful? React with 👍 / 👎.
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
* refactor(plugins): tighten web fetch provider boundary * fix(config): sync fetch secret parity and baseline * fix(ci): enforce web fetch boundary guard
Summary
#59465, Firecrawl fetch execution was mostly behind the plugin boundary, but one compare/helper seam still lived in core and there was no dedicated guardrail to stop vendor-specific fetch logic from drifting back into core.mainpicked up two follow-up failures from the new plugin-owned Firecrawl fetch config path.extensions/firecrawl/api.ts, removed the core helper/export, tightened the generic web-fetch provider contract suite, expanded doctor migration coverage, added a CI/test guard for Firecrawl-specific fetch logic in core, and fixed the config-baseline + exec-secret-ref parity fallout.web_fetchtool contract.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
#59465established the fetch-provider boundary, but one Firecrawl compare/helper path still lived in core and there was no dedicated fetch-boundary guard equivalent to the existing web-search guard.web_fetch-specific boundary lint/test existed, contract coverage did not assert provider-owned selection/config seams strongly enough, andmainfallout from the new plugin-owned Firecrawl fetch secret target was not folded into the follow-up branch yet.git blame, prior PR, issue, or refactor if known): direct follow-up after#59465landed.Regression Test Plan (if applicable)
test/web-fetch-provider-boundary.test.tssrc/plugins/contracts/web-fetch-provider.contract.test.tssrc/commands/doctor-legacy-config.migrations.test.tsextensions/firecrawl/src/firecrawl-tools.test.tssrc/secrets/exec-secret-ref-id-parity.test.tssrc/config/doc-baseline.integration.test.ts#59465cover the runtime behavior; this PR extends the boundary and migration/metadata coverage.User-visible / Behavior Changes
#59465behavior.openclaw doctormigration coverage is stronger for plugin-owned Firecrawl fetch config.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
plugins.entries.firecrawl.config.webFetch.*, legacytools.web.fetch.firecrawl.*Steps
mainafter#59465.Expected
Actual
Evidence
Human Verification (required)
pnpm test -- src/plugins/contracts/web-fetch-provider.contract.test.ts src/commands/doctor-legacy-config.migrations.test.ts extensions/firecrawl/src/firecrawl-tools.test.ts test/web-fetch-provider-boundary.test.tspnpm test -- src/secrets/exec-secret-ref-id-parity.test.ts src/config/doc-baseline.integration.test.tspnpm tsgopnpm run lint:web-fetch-provider-boundariespnpm buildpnpm testReview Conversations
Compatibility / Migration
Risks and Mitigations
Risk:
Risk: