Context
A string-form Fetch request produces circular request metadata. It was captured while implementing #19430 and independently triaged for promotion in the #19435 review. The URL-base fix is already approved; this ticket keeps the metadata repair separate.
The Problem
At 14907a2bf3, Fetch.request(url, config) assigns config.url = config. The returned response.request is that object, so response.request.url === response.request and JSON serialization throws. Object-form input for the same endpoint returns a string URL and serializes normally. A real Fetch instance with only native fetch stubbed confirmed identical dispatch and retained unrelated config keys in both forms. Native dispatch succeeds; the observed failure is metadata serialization.
The Architectural Reality
Design authority: Fetch.request supports Object|String URL forms in its owning JSDoc and exposes the supplied request config through response.request. The current object-form path retains config.url as a string; the string-form branch contradicts that shape.
Prescription checked: src/data/connection/Fetch.mjs#request owns both input normalization and the returned metadata. No worker, Store, Pipeline or URL-base selector is needed.
The Fix
Retain the original string URL in the supplied request config. Pin string/object-form metadata equivalence through the real Fetch API and its returned response; preserve native dispatch and the scoped URL resolver.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
Fetch.request string input and response.request.url |
Owning JSDoc and existing object-form path |
The request URL remains the original string; request metadata serializes for ordinary serializable config |
Preserve unrelated supplied config fields, object-form input and native response fields; do not rewrite metadata to the resolved/redirected response URL |
Method JSDoc |
Real connection tests with native fetch stub |
Acceptance Criteria
Out of Scope
Caller-supplied circular objects; header/body support; Stream/Xhr metadata; bare-relative URL expansion; document-base selection.
Related
#19430 · #19435
Live latest-open sweep: latest 20 open Engine issues read immediately before creation; no equivalent. A2A all-state latest30 contains the observation/review triage, no competing claim. MC symptom sweep3 results found no prior decision. Own-assignment sweep3 open; only19430 touches connections, and its ledger is URL dispatch rather than metadata.
Decision Record impact: none. Structure map: N/A, localized Body connection repair with no new production file.
Origin Session ID: 01a110db-3db8-7c30-933e-883d691417d2
Retrieval Hint: "Fetch string-form response.request.url self-reference metadata JSON serialization"
unowned-rationale: queued after the approved workspace URL fix; no implementation is part of this capture/polish turn.
Context
A string-form Fetch request produces circular request metadata. It was captured while implementing
#19430and independently triaged for promotion in the #19435 review. The URL-base fix is already approved; this ticket keeps the metadata repair separate.The Problem
At
14907a2bf3,Fetch.request(url, config)assignsconfig.url = config. The returnedresponse.requestis that object, soresponse.request.url === response.requestand JSON serialization throws. Object-form input for the same endpoint returns a string URL and serializes normally. A real Fetch instance with only native fetch stubbed confirmed identical dispatch and retained unrelated config keys in both forms. Native dispatch succeeds; the observed failure is metadata serialization.The Architectural Reality
Design authority:
Fetch.requestsupportsObject|StringURL forms in its owning JSDoc and exposes the supplied request config throughresponse.request. The current object-form path retainsconfig.urlas a string; the string-form branch contradicts that shape.Prescription checked:
src/data/connection/Fetch.mjs#requestowns both input normalization and the returned metadata. No worker, Store, Pipeline or URL-base selector is needed.The Fix
Retain the original string URL in the supplied request config. Pin string/object-form metadata equivalence through the real Fetch API and its returned response; preserve native dispatch and the scoped URL resolver.
Contract Ledger
Fetch.requeststring input andresponse.request.urlAcceptance Criteria
#19430's resolver behavior.Out of Scope
Caller-supplied circular objects; header/body support; Stream/Xhr metadata; bare-relative URL expansion; document-base selection.
Related
#19430 · #19435
Live latest-open sweep: latest 20 open Engine issues read immediately before creation; no equivalent. A2A all-state latest30 contains the observation/review triage, no competing claim. MC symptom sweep3 results found no prior decision. Own-assignment sweep3 open; only19430 touches connections, and its ledger is URL dispatch rather than metadata.
Decision Record impact: none. Structure map: N/A, localized Body connection repair with no new production file.
Origin Session ID: 01a110db-3db8-7c30-933e-883d691417d2 Retrieval Hint: "Fetch string-form response.request.url self-reference metadata JSON serialization"
unowned-rationale: queued after the approved workspace URL fix; no implementation is part of this capture/polish turn.