-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Description
Description
A TypeError: undefined is not an object (evaluating 'toSummarize.at(-1).info') occurs during session summarization when attempting to create issue content.
Steps to Reproduce
- Trigger session summarization in scenarios where there are 0 or 1 messages after the last summary message.
- The error occurs at line 1826 in
packages/opencode/src/session/index.tswhen accessingtoSummarize.at(-1).info.time.created.
Expected Behavior
Session summarization should handle cases with no messages to summarize gracefully without throwing an error.
Actual Behavior
The application throws a TypeError because toSummarize is an empty array, and at(-1) returns undefined.
Root Cause
The summarize function assumes toSummarize (a slice of messages) is non-empty, but it can be empty when msgs.length - start is 0 or 1, leading to an empty slice.
Environment
- Platform: Linux
- Opencode version: 0.7.3
Additional Context
This error prevents proper session compaction and interrupts user workflows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels