Repository navigation
refactor(web-fetch): exercise URL normalization through the public tool - #144887
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: needs maintainer review before merge. Reviewed September 11, 2026, 7:49 AM ET / 11:49 UTC. ClawSweeper reviewWhat this changesMoves URL-normalization coverage through the public web_fetch tool and removes its private test hook, support adapter, and cleanup registration. Merge readiness✅ Ready for maintainer review This remains a useful, focused cleanup that is absent from current main. No blocking correctness or security defect was found, and the maintainer-protected PR should remain open. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s web_fetch tool accepts agent-supplied URLs, normalizes them, and retrieves content through network safety checks. These tests check the URL returned to the agent and the URL passed to the transport. flowchart LR
A[Agent URL argument] --> B[Public web fetch tool]
B --> C[URL normalization]
C --> D[Network safety checks]
D --> E[HTTP transport]
E --> F[Content and URL result]
G[URL test cases] --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -6, Tests -7, Other 0. Total -13 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep URL normalization private and enforce its contract through public tool results and guarded-fetch arguments. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR restructures existing coverage rather than fixing a reported runtime failure; the removed private-hook dependency is directly visible in the pinned diff. Is this the best way to solve the issue? Yes. The existing public-tool suite covers the retained normalization contract without a replacement production seam, and the obsolete adapter and registration are removed together. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7764767a88b3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready source review at Exact-head hosted CI passed on attempt 1 (110 successful jobs, 17 skipped). Independent review was clean through P2, and the completed ClawSweeper review has no findings or before-merge actions. This changes test access and coverage organization, not URL, network-policy, or cache behavior. |
|
Merged via squash.
|
Preserve the reviewed harness while incorporating the landed benchmark prerequisite. Punchcard-Session: coral-orchard-orchard-d4 * commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits) fix(perf): isolate benchmark subprocess transport (#144159) refactor(auth): await Copilot cache persistence (#144810) refactor(web-fetch): exercise URL normalization through the public tool (#144887) fix(ollama): preserve hosted subdomain model context (#144891) fix(doctor): explain Codex plugin health failures (#144813) fix(channels): honor pinned accounts in Mattermost model menus (#144880) fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729) fix(logging): preserve OpenClaw package references in diagnostics (#144808) fix: retain plugin detail tab selections while inspection loads (#144647) fix: keep discovered models when sign-in tokens renew (#144861) fix(update): preserve local package overrides (#89985) fix(update): resolve compatibility bridges within the runtime graph (#144831) chore(i18n): refresh native locales (#144856) fix: preserve child signal termination during CLI respawn (#144838) fix(text): hide encoded MiniMax tool envelopes (#126307) fix(subagents): deliver child replies that match the empty placeholder (#130647) fix(cli): reject blank message channel selectors (#144802) fix(telegram): preserve mixed text order and pending stop (#144839) fix(memory): restore FTS fallback for same-name view collisions (#144783) chore(release): close out 2026.9.4 on main (#144708) ...
What Problem This Solves
URL normalization tests reached a private global test hook instead of exercising the public web_fetch tool. Two URL forms also had overlapping direct and public coverage.
Why This Change Was Made
Move the retained expectations into the existing public tool suite, covering 14 unique URL forms through returned URLs and transport arguments. Remove the private conditional global, its test-support adapter, and the matching shared-runner cleanup entry. The sanitizer and its production call site remain unchanged. Production shrinks by 6 lines and tests/support by 7 lines. Shrink the matching assertion-safety baseline from 3 to 2 after removing the private global cast.
User Impact
No URL normalization, network policy, cache, or terminal presentation behavior changes. The tests use existing local fixtures; this is not a live external-service claim.
Evidence
The same five complete suites passed before and after: 57 baseline cases and 55 candidate cases. The two-case reduction merges overlapping URL forms; all 14 unique forms and the 41 unaffected cases remain covered. Existing terminal presentation, enabled-cache, and shared-runner cleanup coverage passed in both runs.
Independent review found no P0–P2 issues in the change and reviewed the exact assertion-baseline correction. The full default build passed all 16 phases against the same runtime/test source as the paired tests; the subsequent baseline-only correction leaves those source hashes unchanged.
The final six-file changed check passed all 32 selected checks, including production, core-test and root-test typechecks, all three dead-export scans, lint and runtime import-cycle checks. The initial gate rejection and exact 3-to-2 baseline correction are retained in local evidence.
Commands run: