From ae456d3373e9e6851eb662940f3aaa5d7071b167 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Tue, 11 Aug 2026 21:06:51 -0400 Subject: [PATCH] chore(core): drop obsolete StreamSse hunk from effect patch The hunk pinned the SSE transport wrapper's OpenAPI identifier to ${identifier}Stream. Upstream accepted the underlying bug (effect-smol issue #2496, filed from opencode PR #34171) and fixed it more generally in effect-smol #2512 - Schema.fromJsonString now names its encoded wrapper ${identifier}JsonString - shipped since 4.0.0-beta.93. The vendored beta.101 already contains that fix, so the hunk's only remaining effect was renaming the canonical wrapper components. Adopt the upstream names: V2EventStream -> V2EventJsonString and SessionLogItemStream -> SessionLogItemJsonString. No TypeScript code references either name; the only committed occurrence is the codemode OpenAPI fixture, renamed in step. The payload components (V2Event, SessionLogItem) are unaffected. Leaves the patch carrying only the Deferred cleanup guard, which is pending upstream - the file deletes entirely at the next effect bump. --- .../test/fixtures/opencode-v2-openapi.json | 8 +-- patches/effect@4.0.0-beta.101.patch | 57 ------------------- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/packages/codemode/test/fixtures/opencode-v2-openapi.json b/packages/codemode/test/fixtures/opencode-v2-openapi.json index ea10c57cf1a9..6c25f690e7b2 100644 --- a/packages/codemode/test/fixtures/opencode-v2-openapi.json +++ b/packages/codemode/test/fixtures/opencode-v2-openapi.json @@ -2944,7 +2944,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/SessionLogItemStream" + "$ref": "#/components/schemas/SessionLogItemJsonString" } }, "required": ["id", "event", "data"], @@ -7211,7 +7211,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/V2EventStream" + "$ref": "#/components/schemas/V2EventJsonString" } }, "required": ["id", "event", "data"], @@ -14991,7 +14991,7 @@ } ] }, - "SessionLogItemStream": { + "SessionLogItemJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/SessionLogItem" @@ -23236,7 +23236,7 @@ } ] }, - "V2EventStream": { + "V2EventJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/V2Event" diff --git a/patches/effect@4.0.0-beta.101.patch b/patches/effect@4.0.0-beta.101.patch index e25350acc8f6..b2df04e43542 100644 --- a/patches/effect@4.0.0-beta.101.patch +++ b/patches/effect@4.0.0-beta.101.patch @@ -16,34 +16,6 @@ index dd5334d6e42b0881f411fca56688e639cd49c176..ea200a80d6186f07a29d0d231ff1f038 }); }); export { -diff --git a/dist/unstable/httpapi/HttpApiSchema.js b/dist/unstable/httpapi/HttpApiSchema.js -index e0fd59143c398fcb13680c74e571ef53f5b4bdc0..5df252aabaf8f9f16dff5b93dcce022745fa52ca 100644 ---- a/dist/unstable/httpapi/HttpApiSchema.js -+++ b/dist/unstable/httpapi/HttpApiSchema.js -@@ -151,7 +151,7 @@ export const StreamSse = options => { - const events = options.events ?? (options.data === undefined ? undefined : Schema.Struct({ - id: Schema.UndefinedOr(Schema.String), - event: Schema.String, -- data: Schema.fromJsonString(options.data) -+ data: sseDataJsonSchema(options.data) - })); - if (events === undefined) { - throw new Error("StreamSse requires either an events schema or a data schema"); -@@ -166,6 +166,14 @@ export const StreamSse = options => { - error: options.error ?? Schema.Never - }); - }; -+const sseDataJsonSchema = data => { -+ const identifier = SchemaAST.resolveIdentifier(data.ast); -+ return identifier === undefined ? Schema.fromJsonString(data) : Schema.fromJsonString(data).annotate({ -+ // The SSE transport field is a JSON string. Give that wrapper its own -+ // OpenAPI identifier so it does not claim the decoded data schema's name. -+ identifier: `${identifier}Stream` -+ }); -+}; - /** - * Creates a streaming `Uint8Array` success response schema. - * diff --git a/src/Deferred.ts b/src/Deferred.ts index f6d37948bfbe690a7998b06c562e434e1b8ae084..da91e4dc0fd32e534fbc72f7beb0514e67e4ce74 100644 --- a/src/Deferred.ts @@ -63,32 +35,3 @@ index f6d37948bfbe690a7998b06c562e434e1b8ae084..da91e4dc0fd32e534fbc72f7beb0514e }) }) -diff --git a/src/unstable/httpapi/HttpApiSchema.ts b/src/unstable/httpapi/HttpApiSchema.ts -index 3899f4fabbbc5f72ab5e6c759db332ee6c3c5633..7e742f76abe64c93b37534c0e1070b0012a4f74f 100644 ---- a/src/unstable/httpapi/HttpApiSchema.ts -+++ b/src/unstable/httpapi/HttpApiSchema.ts -@@ -430,7 +430,7 @@ export const StreamSse: { - const events = options.events ?? (options.data === undefined ? undefined : Schema.Struct({ - id: Schema.UndefinedOr(Schema.String), - event: Schema.String, -- data: Schema.fromJsonString(options.data) -+ data: sseDataJsonSchema(options.data) - })) - if (events === undefined) { - throw new Error("StreamSse requires either an events schema or a data schema") -@@ -446,6 +446,15 @@ export const StreamSse: { - }) - } - -+const sseDataJsonSchema = (data: Schema.Constraint) => { -+ const identifier = SchemaAST.resolveIdentifier(data.ast) -+ return identifier === undefined ? Schema.fromJsonString(data) : Schema.fromJsonString(data).annotate({ -+ // The SSE transport field is a JSON string. Give that wrapper its own -+ // OpenAPI identifier so it does not claim the decoded data schema's name. -+ identifier: `${identifier}Stream` -+ }) -+} -+ - /** - * Creates a streaming `Uint8Array` success response schema. - *