Repository navigation
Description
What
Upstream defines Session.Metadata as a record of string keys to JSON values, with a description:
"Host-supplied session annotations, durable and opaque to core. Keys are arbitrary; values must be
JSON-serializable. Children and forks inherit the parent's current metadata unless the creator
supplies its own." The pinned OpenAPI document projects it as a bare {"type": "object"}: the
description and the JSON value type are lost. This is the same class of loss as the stream payload
links that Restore patch 001 repairs (#56).
The generated surface carries it as IReadOnlyDictionary<string, JsonElement> (nullable on
SessionInfo, wrapped in Optional<T> on the requests) on SessionInfo, SessionCreateRequest, SessionUpdateRequest and
the session.metadata.updated event data, with the placeholder summary "Gets the metadata value.".
The maintainer decided on 2026-10-15 not to add a restore patch. Add description curation for these
generated members using upstream's text verbatim, watch packages/schema/src/session-metadata.ts
in spec/source-watch.json, and include an upstream report in #212's batch. Remove the curation
when upstream's OpenAPI document carries the description.
Why it waits for 1.1
The generated type is already a string-keyed dictionary of JSON values, which is what the upstream
record decodes, so the decision is expected to change documentation rather than the public shape.
Evidence
external/opencode/packages/schema/src/session-metadata.ts:3-10in the pinned submodule
(v2.2.5):Schema.Record(Schema.String, Schema.Json)with identifierSession.Metadata.spec/openapi.json:24567-24569:"Session.Metadata": { "type": "object" }.src/OpenCode.Sdk/Sessions/Models/SessionInfo.cs:91-96: the generated property and its summary.- Retire Restore patch 001 once upstream
openapi.jsonlinks the SSE payloads again #56 and File the parked upstream reports on OpenAPI projection fidelity #212 track the other OpenAPI projection-fidelity findings.
Done when
- The decision is recorded here, as it is in the maintainer's 2026-10-15 comment.
- Description curation carries upstream's text verbatim on all four generated members, and the
source-watch entry detects changes to the upstream record or its description. - An upstream report is filed and linked here and beside File the parked upstream reports on OpenAPI projection fidelity #212's reports. The curation is removed
when upstream's OpenAPI document carries the description.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsOpen Questions
Activity
Blind-Striker commentedon Oct 15, 2026
Decision (maintainer, 2026-10-15): no restore patch. Three things instead:
Session.Metadata's generated members (SessionInfo.Metadata, the create and update requests, and thesession.metadata.updateddata). It carries upstream's own text verbatim.spec/source-watch.jsonentry forpackages/schema/src/session-metadata.ts, so a refresh flags any upstream change to the record or its description.openapi.jsoncarries the description, the row is removed.Why not a restore patch. The text would be the same. What a patch adds is drift detection through its preimage hashes, and the source-watch entry gives that more cheaply. Restore patches stay reserved for losses that break the generated shape (ADR-0020), and here the shape is already right.
The row and the entry are planned for the same documentation PR.