Skip to content

[Bug] Cannot read properties of undefined (reading 'summaryParts') when using Github Copilot with GPT-5.3 Codex #719

Closed

Description

@drmgc

Description

Brief description of the bug

Environment

  • OS: Fedora Linux 44
  • Node version: v24.18.0
  • Nanocoder version: 1.29.0
  • Provider: Github Copilot
  • Model: gpt-5.3-codex

Steps to Reproduce

  1. Have this agents.config.json
{
  "nanocoder": {
    "providers": [
      {
        "name": "GitHub Copilot",
        "models": [
          "gpt-5.3-codex"
        ],
        "baseUrl": "https://api.githubcopilot.com",
        "sdkProvider": "github-copilot"
      }
    ],
    "modeProviders": {
      "normal": {
        "provider": "GitHub Copilot",
        "model": "gpt-5.3-codex"
      },
      "plan": {
        "provider": "GitHub Copilot",
        "model": "gpt-5.3-codex"
      }
    }
  }
}
  1. Login using nanocoder copilot login
  2. Run nanocoder
  3. Enter any prompt

Expected Behavior

After some waiting I get the LLM's answer

Actual Behavior

After some waiting, I'm getting Cannot read properties of undefined (reading 'summaryParts') error

Logs/Screenshots

Image

Additional Context

The error happens both with brew version and npm version. Both in normal terminal, and in zellij

  • I have searched existing issues to ensure this is not a duplicate
    • There is an issue about GPT-5, but it is about GPT-5.5 (not codex), it is resolved, the fix is merged, but for me the problem is still ther
  • I can reproduce this issue consistently
  • This issue occurs with the latest version of nanocoder

Activity

  1. added
    bug
    on Jul 31, 2026
  2. drmgc commented on Jul 31, 2026

    @drmgc
    Author

    Here the same error with logs enabled:

    Chat request starting {
      model: 'gpt-5.3-codex',
      messageCount: 2,
      toolCount: 21,
      correlationId: '6bae69aaff435c62e0ceb6480d070e4c',
      provider: 'GitHub Copilot'
    }
    AI SDK request prepared { messageCount: 1, hasSystem: true, hasTools: true, toolCount: 21 }
    Chat request failed {
      model: 'gpt-5.3-codex',
      duration: '8190.87ms',
      error: "Cannot read properties of undefined (reading 'summaryParts')",
      errorName: 'TypeError',
      errorType: 'TypeError',
      errorProps: {
        message: "Cannot read properties of undefined (reading 'summaryParts')"
      },
      correlationId: '6bae69aaff435c62e0ceb6480d070e4c',
      provider: 'GitHub Copilot',
      memoryDelta: {
        heapUsed: '139.51 MB',
        heapTotal: '167.32 MB',
        external: '61.26 MB',
        rss: '326.97 MB'
      }
    }
    You:
    
    ┃
    ┃ find count of functions in this project
    ┃
    
    ~10 tokens
    
    
    Cannot read properties of undefined (reading 'summaryParts')
    

    Though in a log file there is no error logs

  3. A-S-Manoj commented on Aug 1, 2026

    @A-S-Manoj
    Contributor

    Thanks for the detailed repro and logs, @drmgc.

    I dug into this and confirmed the root cause is actually upstream in @ai-sdk/openai, not in nanocoder itself. GitHub Copilot's Responses-API proxy for gpt-5.3-codex emits reasoning-summary stream events (response.reasoning_summary_part.added/.done) without a matching preceding response.output_item.added event (or with a mismatched item_id). The SDK's streaming handler assumes that entry always exists and dereferences it with a non-null assertion in a few places, so it throws instead of degrading gracefully.

    I filed the upstream issue with the exact code paths and a suggested fix: vercel/ai#18270

    This explains why the #576 fix didn't help here — that one covered a different (GPT-5.5) trigger path, but the underlying assumption in the SDK is still not guarded for Copilot's event ordering in general. Until the upstream fix lands, this will likely keep resurfacing with other Copilot/reasoning-model combinations too.

    Will update here once there's movement on the AI SDK side.

  4. RealBhupesh commented on Aug 3, 2026

    @RealBhupesh
    Contributor

    I reviewed this against the current main branch before opening any duplicate fix. The repository already contains the defensive @ai-sdk/openai patch from commit d212c78, which initializes missing reasoning state for summary events, plus regression tests for both missing reasoning items and summary events without tracked state.

    That directly covers the reported summaryParts crash path. I’m not opening a duplicate PR here. Please retest against the latest main; if the error still reproduces, a fresh event trace would help distinguish a new Copilot event ordering from the case already guarded.

  5. drmgc commented on Aug 5, 2026

    @drmgc
    Author

    @RealBhupesh I've been testing on v1.28 (both from npm and brew). The said commit is included into tags v1.29.0, v1.28.1, and v1.28.0. So, I don't see any reason for trying the latest main here.

    Here are the only logs I get

    With NANOCODER_LOG_LEVEL=debug

    NANOCODER_LOG_LEVEL=debug NANOCODER_CORRELATION_ENABLED=true NANOCODER_LOG_DIR=/tmp/nanocoder-log nanocoder

    Chat request starting {
      model: 'gpt-5.3-codex',
      messageCount: 2,
      toolCount: 21,
      correlationId: '1963cbed12fc60da76acfaea64161f43',
      provider: 'GitHub Copilot'
    }
    AI SDK request prepared { messageCount: 1, hasSystem: true, hasTools: true, toolCount: 21 }
    Chat request failed {
      model: 'gpt-5.3-codex',
      duration: '4435.27ms',
      error: "Cannot read properties of undefined (reading 'summaryParts')",
      errorName: 'TypeError',
      errorType: 'TypeError',
      errorProps: {
        message: "Cannot read properties of undefined (reading 'summaryParts')"
      },
      correlationId: '1963cbed12fc60da76acfaea64161f43',
      provider: 'GitHub Copilot',
      memoryDelta: {
        heapUsed: '55.67 MB',
        heapTotal: '90.38 MB',
        external: '59.72 MB',
        rss: '286.32 MB'
      }
    }
    You:
    
    ┃
    ┃ find count of files in this project
    ┃
    
    ~9 tokens
    
    
    Cannot read properties of undefined (reading 'summaryParts')
    

    Logs from /tmp/nanocoder-log/nanocoder-2026-08-05.log

    {"level":"DEBUG","time":"2026-08-05T07:16:09.503Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:09.521Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Global message queue initialized"}
    {"level":"INFO","time":"2026-08-05T07:16:09.522Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Nanocoder application starting"}
    {"level":"INFO","time":"2026-08-05T07:16:09.522Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Development mode changed"}
    {"level":"DEBUG","time":"2026-08-05T07:16:09.606Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"INFO","time":"2026-08-05T07:16:09.639Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"AI client initialized"}
    {"level":"DEBUG","time":"2026-08-05T07:16:09.875Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"INFO","time":"2026-08-05T07:16:09.948Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"MCP servers initialized"}
    {"level":"INFO","time":"2026-08-05T07:16:09.949Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Application interface ready for user interaction"}
    {"level":"DEBUG","time":"2026-08-05T07:16:09.967Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:10.082Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:10.126Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:10.425Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"INFO","time":"2026-08-05T07:16:10.430Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Update information available"}
    {"level":"DEBUG","time":"2026-08-05T07:16:39.856Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:46.928Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"INFO","time":"2026-08-05T07:16:46.988Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Application interface ready for user interaction"}
    {"level":"DEBUG","time":"2026-08-05T07:16:46.991Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:47.009Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:47.012Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"DEBUG","time":"2026-08-05T07:16:51.316Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Directory trusted, proceeding with application initialization"}
    {"level":"INFO","time":"2026-08-05T07:16:51.323Z","pid":241729,"platform":"linux","arch":"x64","service":"nanocoder","version":"unknown","environment":"production","nodeVersion":"v22.23.2","msg":"Application interface ready for user interaction"}
    

    PS not sure if these are the event traces that you've been asking for. If they aren't, pls explain how do I get the right ones

  6. RealBhupesh commented on Aug 10, 2026

    @RealBhupesh
    Contributor

    You're right: retesting current main was not a useful next step here, and the logs you posted are the complete application-level logs NanoCoder currently exposes. There is no user-facing raw SSE trace switch, so you could not have produced the event trace I asked for without instrumenting the provider path.

    I found why releases containing the repository commit still crash: the workaround is a pnpm patch under patches/, but NanoCoder's published package includes dist and selected assets only. The patch and pnpm-workspace.yaml are absent from the npm tarball, so npm and Homebrew installations keep using the unpatched @ai-sdk/openai code.

    The upstream investigation has now captured the live Copilot sequence and confirmed that Copilot rotates opaque item IDs while keeping output_index stable (vercel/ai#18548). I opened #836 with a publish-compatible fix in NanoCoder's Copilot stream path, regression coverage for reasoning/text events and chunk boundaries, and no requirement for additional logs from you.

    Thanks for pushing back and for the detailed release information; it exposed the packaging gap.

  7. added 7 commits that reference this issue on Aug 10, 2026
    3ac2513
    44ae240
    f18f89b
    14fc0d3
    beeabb3
    c1b5dd5
    edecd45
  8. added a commit that references this issue on Aug 13, 2026
    9d808a0
  9. added a commit that references this issue on Aug 13, 2026
    0b1ebe4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions