Skip to content

fix(read): handled bodyless HTTP 204 responses - #15674

Open
roboomp wants to merge 1 commit into
mainfrom
farm/c49a09ae/fix-read-http-204-no-content
Open

roboomp wants to merge 1 commit into
mainfrom
farm/c49a09ae/fix-read-http-204-no-content

Conversation

@roboomp

@roboomp roboomp commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Repro

read {"path":"https://httpbin.org/status/204"} reported Method: failed and Failed to fetch URL (HTTP 204). bun -e 'import { loadPage } from "./packages/coding-agent/src/web/scrapers/types.ts"; console.log(JSON.stringify(await loadPage("https://httpbin.org/status/204")))' returned ok: false for status 204 before the fix.

Cause

loadPage in packages/coding-agent/src/web/scrapers/types.ts treated a missing response body reader as an HTTP failure regardless of response.ok; renderUrl in packages/coding-agent/src/tools/fetch.ts then rendered a failed read.

Fix

  • Preserve response.ok when loadPage receives a bodyless response.
  • Render HTTP 204 as an empty no-content read with a status note, without attempting HTML extraction.
  • Cover bodyless 204 and 503 responses through live local endpoints; document the user-visible fix.

Verification

bun test packages/coding-agent/test/tools/fetch-http-status.test.ts packages/coding-agent/test/tools/fetch-raw-mode.test.ts packages/coding-agent/test/tools/fetch-binary-dispatch.test.ts packages/coding-agent/test/tools/fetch-url-selectors.test.ts — 29 passed. Direct fetchReadUrl smoke against https://httpbin.org/status/204 returned Method: no-content and Notes: HTTP 204 No Content; bun run check:ts passed. Skipped the PR pre-publish gate (bun run fix, bun check, bun run test) because bun run test failed on the branch and the identical grep-internal-URLs chunk fails on a clean origin/main source snapshot: two long-line assertions in packages/coding-agent/test/tools/grep-internal-urls.test.ts. The same-email Codex workspace assertion in packages/coding-agent/test/usage-cli.test.ts also fails identically on origin/main. No files in either failing path differ from origin/main. The branch push pre-publish gate completed. The local Rust build also could not write its shared cache (Operation not permitted), independently of these TypeScript changes.

Fixes #15667

Preserved successful HTTP status when the response has no reader and surfaced a no-content result without HTML fallback. Covered 204 health checks and bodyless 503 failures with live endpoints.

Fixes #15667
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T03:54:15.555760Z 9eebf2e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 9eebf2ebeb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const reader = response.body?.getReader();
if (!reader) {
return { content: "", contentType, finalUrl, ok: false, status: response.status };
return { content: "", contentType, finalUrl, ok: response.ok, status: response.status };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle every successful null-body status before rendering

For a GET returning HTTP 205 Reset Content, Fetch exposes response.body as null and response.ok as true, so this now reports a successful load; however, renderUrl only short-circuits status 204. A 205 response can therefore enter the empty-HTML pipeline, trigger .md/content-negotiation and reader-backend requests (including Jina), and eventually be mislabeled as raw-html instead of immediately returning an empty successful response. Either preserve null-body state for the renderer to handle or extend the no-content branch beyond only 204.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

read: HTTP 204 No Content is reported as Failed to fetch URL (HTTP 204)

1 participant