Skip to content

Conversation

@code-yeongyu
Copy link
Owner

Summary

  • Session recovery가 중단된 reasoning(thinking) 메시지의 empty content 에러를 처리하지 못하는 버그 수정
  • OpenCode의 reasoning 타입과 step-start/step-finish 메타 파트를 인식하도록 개선

Problem

API 에러: messages.53: all messages must have non-empty content except for the optional final assistant message

원인: assistant가 thinking을 뱉다가 중단되면 reasoning 파트만 남고 실제 text 파트가 없어서 API가 거부

Changes

  • THINKING_TYPES set에 reasoning 타입 추가
  • hasNonEmptyOutput(): step-start/step-finish 메타 파트 무시
  • findEmptyContentMessage(): 전체 메시지 스캔하여 빈 content 찾기
  • 중단된 메시지를 "(interrupted)" 텍스트로 패치 시도 후 revert로 폴백

- Check for staged changes before commit
- Check if tag exists before creating
- Check if release exists before creating
- Add THINKING_TYPES set including 'reasoning' type (OpenCode's thinking)
- Add hasNonEmptyOutput() to detect messages with only thinking/meta parts
- Add findEmptyContentMessage() to scan all messages for empty content
- Handle step-start/step-finish meta parts in empty content detection
- Patch interrupted messages with '(interrupted)' text before falling back to revert
@code-yeongyu code-yeongyu merged commit 8f39575 into master Dec 5, 2025
1 check passed
@code-yeongyu code-yeongyu deleted the fix-session-recovery-empty-content branch December 21, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants