Skip to content

fix(fresh/ai): chat stream proxy drops durable State-Protocol query parameters #1457

Description

@rickylabs

Reproduction

createNetScriptChatStreamProxy() resolves the upstream URL from target + streamPath, then constructs the upstream Request without copying new URL(request.url).search.

A durable chat subscriber calls the Fresh proxy with State-Protocol parameters such as:

/api/chat-stream?id=session-1&offset=42&live=sse&handle=h1

The upstream request reaches the durable-stream service without offset, live, or handle, so resume/live polling semantics are lost. The id parameter is application routing metadata and should remain removable, but protocol query parameters must survive.

Expected

The helper forwards the incoming query by default, or exposes a documented query-mapping hook, with tests for offset, live, handle, and cursor.

Consumer evidence

rickylabs/eis-chat PR #169 retains a thin streamPath adapter that appends all query parameters except id. Remove it once the published helper owns the behavior.

Follow-up to closed #251; related to #238.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions