Unexpected null values in session summary #4192

Open
opened 2026-02-16 17:42:59 -05:00 by yindo · 3 comments
Owner

Originally created by @bunchjesse on GitHub (Jan 4, 2026).

Originally assigned to: @thdxr on GitHub.

Description

I have this session:

{
  "info": {
    "id": "ses_476480924ffeZu4lqDMRXlA36b",
    "version": "1.0.223",
    "projectID": "8b59d096c13d03205dd938db45501cd1bc1270a8",
    "directory": "<redacted",
    "title": "Distinguishing debug build from Xcode install",
    "time": {
      "created": 1767542093531,
      "updated": 1767544026394
    },
    "summary": {
      "additions": null,
      "deletions": null,
      "files": 13
    }
  },
  "messages": [ ... ]
}

Notice the summary->additions and summary->deletions are both null. This causes the data returned from the OpenAPI-generated SDK to fail deserialization because the spec does not mark these as nullable.

"Session": {
  "type": "object",
  "properties": {
    ...
    "summary": {
      "type": "object",
      "properties": {
        "additions": {
          "type": "number"
        },
        "deletions": {
          "type": "number"
        }

Are these expected to be null? If not, perhaps there is a bug causing this. If so, could we update the OpenAPI spec to make these nullable?

Plugins

No response

OpenCode version

1.1.1

Steps to reproduce

Unknown how I got into this state

Screenshot and/or share link

No response

Operating System

macOS 26

Terminal

Terminal

Originally created by @bunchjesse on GitHub (Jan 4, 2026). Originally assigned to: @thdxr on GitHub. ### Description I have this session: ```json { "info": { "id": "ses_476480924ffeZu4lqDMRXlA36b", "version": "1.0.223", "projectID": "8b59d096c13d03205dd938db45501cd1bc1270a8", "directory": "<redacted", "title": "Distinguishing debug build from Xcode install", "time": { "created": 1767542093531, "updated": 1767544026394 }, "summary": { "additions": null, "deletions": null, "files": 13 } }, "messages": [ ... ] } ``` Notice the `summary->additions` and `summary->deletions` are both `null`. This causes the data returned from the OpenAPI-generated SDK to fail deserialization because the spec does not mark these as nullable. ```json "Session": { "type": "object", "properties": { ... "summary": { "type": "object", "properties": { "additions": { "type": "number" }, "deletions": { "type": "number" } ``` Are these expected to be `null`? If not, perhaps there is a bug causing this. If so, could we update the OpenAPI spec to make these nullable? ### Plugins _No response_ ### OpenCode version 1.1.1 ### Steps to reproduce Unknown how I got into this state ### Screenshot and/or share link _No response_ ### Operating System macOS 26 ### Terminal Terminal
yindo added the bug label 2026-02-16 17:42:59 -05:00
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

what sdk v are u using? v1 or v2

@rekram1-node commented on GitHub (Jan 4, 2026): what sdk v are u using? v1 or v2
Author
Owner

@bunchjesse commented on GitHub (Jan 4, 2026):

Neither. I'm using the Swift OpenAPI client generator to generate client code from the openapi.json endpoint. Swift enforces type safety when deserializing API responses so the fact that null comes in for non-nullable properties causes the entire response to fail deserialization.

@bunchjesse commented on GitHub (Jan 4, 2026): Neither. I'm using the Swift OpenAPI client generator to generate client code from the openapi.json endpoint. Swift enforces type safety when deserializing API responses so the fact that `null` comes in for non-nullable properties causes the entire response to fail deserialization.
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

ah gotcha

@rekram1-node commented on GitHub (Jan 4, 2026): ah gotcha
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4192