Skip to content

fix: log fetch timeout aborts - #73692

Merged
kevinlin-openai merged 2 commits into
openclaw:mainfrom
kevinslin:dev/kevinlin/fetch-timeout-logging
Apr 28, 2026
Merged

kevinlin-openai merged 2 commits into
openclaw:mainfrom
kevinslin:dev/kevinlin/fetch-timeout-logging

Conversation

@kevinslin

Copy link
Copy Markdown
Contributor

Context

  • Log when buildTimeoutAbortSignal aborts due to its own timeout.
  • Include operation and sanitized URL metadata for fetchWithTimeout and fetchWithSsrFGuard.
  • Add regression coverage for timeout-vs-parent abort logging.

Testing

  • pnpm exec vitest run --config test/vitest/vitest.config.ts src/utils/fetch-timeout.test.ts
  • pnpm exec vitest run --config test/vitest/vitest.agents-tools.config.ts src/utils/fetch-timeout.test.ts (No test files found; test is outside that config include.)

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Apr 28, 2026
@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds structured logging to buildTimeoutAbortSignal so that timeout-triggered aborts emit a warning with timeoutMs, elapsedMs, operation, and a sanitized URL (credentials, query string, and hash stripped). It also wires the new operation and url metadata through fetchWithTimeout and fetchWithSsrFGuard, and adds regression tests covering the timeout-fires vs. parent-aborts-first distinction.

Confidence Score: 5/5

Safe to merge — no correctness, security, or behavioral regressions found.

The abort-guard check (controller.signal.aborted) correctly prevents double-logging when a parent signal fires before the timer. URL sanitization logic is sound and well-tested. The extra Math.max(1, Math.floor(...)) normalization in buildTimeoutAbortSignal is consistent with the existing Math.max(1, timeoutMs) in fetchWithTimeout. setTimeout varargs forwarding is used correctly. Tests cover both key paths. No P0/P1 findings.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: log fetch timeout aborts" | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

Keep open. This PR is maintainer-authored and protected by the maintainer label, and current main still does not contain the proposed timeout-abort logging, sanitized URL metadata wiring, or regression test.

Best possible solution:

Keep this PR open for maintainer review. If maintainers accept the logging and redaction approach, land it after the targeted fetch-timeout regression test and the appropriate changed gate pass; otherwise request focused changes around timeout metadata or URL sanitization.

What I checked:

  • Protected maintainer item: Provided GitHub context shows this PR is open, unmerged, authored by kevinslin with author association MEMBER, and labeled maintainer. The cleanup policy requires maintainer-authored or protected-label items to stay open for explicit maintainer handling.
  • Maintainer label semantics: The repository labeler applies the maintainer label when the PR author is an active member of the maintainer team, so the label is a deliberate trust/ownership signal rather than ordinary triage noise. (.github/workflows/labeler.yml:141, cd2e13be8ad6)
  • Current timeout helper lacks PR behavior: On current main, buildTimeoutAbortSignal still accepts only timeoutMs and signal, and its timer directly calls setTimeout(controller.abort.bind(controller), timeoutMs) with no subsystem logger, operation metadata, URL metadata, elapsed timing, or timeout-vs-parent-abort logging distinction. (src/utils/fetch-timeout.ts:14, cd2e13be8ad6)
  • SSRF-guard fetch does not pass metadata on main: fetchWithSsrFGuard still passes only timeoutMs and signal into buildTimeoutAbortSignal; it does not pass the PR's proposed operation: "fetchWithSsrFGuard" or url: params.url metadata. (src/infra/net/fetch-guard.ts:318, cd2e13be8ad6)
  • Regression test absent from main: There is no src/utils/fetch-timeout.test.ts or similarly named fetch-timeout regression test in the current checkout, so the PR's timeout-vs-parent-abort logging coverage has not landed on main. (cd2e13be8ad6)
  • PR security scope: The provided PR file list is limited to src/utils/fetch-timeout.ts, src/infra/net/fetch-guard.ts, and a colocated unit test. It does not touch workflows, dependency sources, lockfiles, install/build/release scripts, publishing metadata, artifact execution, or secret storage. The security-sensitive point is logging URL metadata; the review comment flagged relative URL query/hash redaction, and the later PR commit d915fa28b767cc72d7f523286df7504d2c9b8b6b is titled fix: redact relative timeout urls. (d915fa28b767)

Remaining risk / open question:

  • Protected maintainer-owned work should not be auto-closed by cleanup; it needs explicit maintainer review.
  • Before landing, maintainers should re-check the timeout log URL sanitization behavior for absolute, relative, malformed, and control-character-containing inputs.

Codex review notes: model gpt-5.5, reasoning high; reviewed against cd2e13be8ad6.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33e8c2ab9f

ℹ️ 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".

Comment thread src/utils/fetch-timeout.ts Resolved
@kevinslin
kevinslin force-pushed the dev/kevinlin/fetch-timeout-logging branch 3 times, most recently from 9971874 to d915fa2 Compare April 28, 2026 18:08
@kevinslin
kevinslin force-pushed the dev/kevinlin/fetch-timeout-logging branch from d915fa2 to 480c7cc Compare April 28, 2026 18:28
@kevinlin-openai
kevinlin-openai merged commit f351961 into openclaw:main Apr 28, 2026
56 of 65 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix: log fetch timeout aborts

* fix: redact relative timeout urls
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix: log fetch timeout aborts

* fix: redact relative timeout urls
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix: log fetch timeout aborts

* fix: redact relative timeout urls
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
* fix: log fetch timeout aborts

* fix: redact relative timeout urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants