Description
In GET /doc (OpenCode 1.15.7) the event-union schemas contain the entire EventSessionNext* schema family twice.
GlobalEvent.payload is an anyOf of 136 members, but only 110 are distinct - 26 duplicates. Every duplicate is an EventSessionNext* schema (EventSessionNextPrompted, EventSessionNextTextDelta, EventSessionNextToolCalled, ...): the same 26-schema block is $ref'd a second time later in the list.
The per-instance Event schema has the identical defect: 103 members, 77 distinct, the same 26 EventSessionNext* duplicates.
anyOf does not require its members to be unique, so this is not strictly invalid OpenAPI - a value matching a duplicate matches its twin identically, so the extra members are pure noise. But:
- It inflates the spec.
- Codegen that maps each
anyOf member to a named type/variant without deduplicating emits that type twice. Where duplicate symbols are an error (eg a Rust enum getting two EventSessionNextPrompted variants) the generated client fails to compile unless the generator or a post-processing step dedups.
This looks like a generation bug - the streaming EventSessionNext* event group appears to be registered into the union twice.
Related
#28825 - sync events on /global/event mismatch the spec; same GlobalEvent schema, different defect.
#20666 - SyncEvent OpenAPI schema has required infinite recursion; same area.
Plugins
No response
OpenCode version
1.15.7
Steps to reproduce
opencode serve
- Fetch
GET /doc.
jq '.components.schemas.GlobalEvent.properties.payload.anyOf | [length, ([.[]."$ref"] | unique | length)]' -> [136, 110].
- The 26-entry gap is the
EventSessionNext* family, each schema listed twice. Same holds for .components.schemas.Event.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
In
GET /doc(OpenCode 1.15.7) the event-union schemas contain the entireEventSessionNext*schema family twice.GlobalEvent.payloadis ananyOfof 136 members, but only 110 are distinct - 26 duplicates. Every duplicate is anEventSessionNext*schema (EventSessionNextPrompted,EventSessionNextTextDelta,EventSessionNextToolCalled, ...): the same 26-schema block is$ref'd a second time later in the list.The per-instance
Eventschema has the identical defect: 103 members, 77 distinct, the same 26EventSessionNext*duplicates.anyOfdoes not require its members to be unique, so this is not strictly invalid OpenAPI - a value matching a duplicate matches its twin identically, so the extra members are pure noise. But:anyOfmember to a named type/variant without deduplicating emits that type twice. Where duplicate symbols are an error (eg a Rust enum getting twoEventSessionNextPromptedvariants) the generated client fails to compile unless the generator or a post-processing step dedups.This looks like a generation bug - the streaming
EventSessionNext*event group appears to be registered into the union twice.Related
#28825 -
syncevents on/global/eventmismatch the spec; sameGlobalEventschema, different defect.#20666 -
SyncEventOpenAPI schema has required infinite recursion; same area.Plugins
No response
OpenCode version
1.15.7
Steps to reproduce
opencode serveGET /doc.jq '.components.schemas.GlobalEvent.properties.payload.anyOf | [length, ([.[]."$ref"] | unique | length)]'->[136, 110].EventSessionNext*family, each schema listed twice. Same holds for.components.schemas.Event.Screenshot and/or share link
No response
Operating System
No response
Terminal
No response