Skip to content

fix(session-recovery): handle empty content from interrupted reasoning#6

Merged
code-yeongyu merged 2 commits into
masterfrom
fix-session-recovery-empty-content
Dec 5, 2025
Merged

fix(session-recovery): handle empty content from interrupted reasoning#6
code-yeongyu merged 2 commits into
masterfrom
fix-session-recovery-empty-content

Conversation

@code-yeongyu

Copy link
Copy Markdown
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
codewithkenzo referenced this pull request in codewithkenzo/oh-my-opencode Jan 9, 2026
#6)

* fix(publish): make git operations idempotent

- Check for staged changes before commit
- Check if tag exists before creating
- Check if release exists before creating

* fix(session-recovery): handle empty content from interrupted reasoning

- 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
luobosibing2 pushed a commit to luobosibing2/oh-my-opencode that referenced this pull request Feb 23, 2026
Security fix (Issue code-yeongyu#6):
- Silent auto-updates are now disabled by default
- Users must explicitly opt-in during installation
- Configuration stored in ~/.claude/.sisyphus-config.json
- Both shell hook and TypeScript check config before updating

Uninstall fix (Issue code-yeongyu#11):
- Remove all agents (including momus, metis, prometheus, etc.)
- Remove all commands (including plan, review, ralph-loop, etc.)
- Remove all skills (ultrawork, git-master, frontend-ui-ux)
- Remove all hooks (keyword-detector, stop-continuation, silent-auto-update)
- Remove all state files (.sisyphus-version.json, .sisyphus-config.json, etc.)
- Auto-remove hook configurations from settings.json using jq
- Create backup of settings.json before modification

Closes code-yeongyu#6
Closes code-yeongyu#11

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
luobosibing2 pushed a commit to luobosibing2/oh-my-opencode that referenced this pull request Feb 23, 2026
…uninstall-issues

Merging security and uninstall fixes. Closes code-yeongyu#6 and code-yeongyu#11.
luobosibing2 pushed a commit to luobosibing2/oh-my-opencode that referenced this pull request Feb 23, 2026
…-yeongyu#309)

Critical fixes:
- Bug #1: SubagentStop hook defaulted all agents to 'failed' because SDK
  doesn't provide `success` field. Now defaults to 'completed' when undefined.
- Bug code-yeongyu#4: Token stats lost across TokenTracker instances. Constructor now
  restores session stats from global state for the same session ID.
- Bug code-yeongyu#5: Ultrawork session isolation bypassed when both session IDs were
  undefined (undefined === undefined). Now rejects all falsy session IDs.

High priority fixes:
- Bug code-yeongyu#6: Cancel skill force-clear missed 12+ state files (boulder,
  hud-state, subagent-tracking, checkpoints, etc). Added comprehensive list.
- Bug code-yeongyu#7: HUD semverCompare() returned NaN on pre-release versions like
  "3.9.5-beta". Fixed to use parseInt and handle pre-release ordering.
- Bug code-yeongyu#8: Silent JSON parse failures in critical state readers. Added
  error logging to ralph and ultrawork state readers.
- Bug code-yeongyu#9: Stale task detection had no default behavior when onStaleSession
  callback was not configured. Now auto-cleans after 2x threshold.
- Bug code-yeongyu#10: Hardcoded 3-architect assumption in validation. Extracted to
  REQUIRED_ARCHITECTS constant.

Medium priority fixes:
- Bug code-yeongyu#11: Auto-invoke history used non-atomic writes. Now uses
  atomicWriteJson to prevent corruption from concurrent sessions.
- Bug code-yeongyu#12: Ecomode docs said "all tasks" use Haiku, contradicting the
  escalation paths. Clarified to "most tasks" with upgrade criteria.
- Bug code-yeongyu#13: Added safeUnlinkSync/safeRmSync utilities to prevent ENOENT
  crashes during cleanup operations.
- Bug code-yeongyu#14: State files containing user prompts written with 0644
  permissions. Now writes with 0600 (owner-only read/write).
- Bug code-yeongyu#15: Model names recorded inconsistently (e.g., 'claude-3-5-haiku'
  vs 'claude-haiku-4'). Now normalizes at recording time via exported
  normalizeModelName().

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
code-yeongyu pushed a commit that referenced this pull request Feb 24, 2026
…hardening

Fixes from multi-model council audit (7 members, 19 findings, 9 selected):

- Use parseModelString() for cross-provider Anthropic thinking config (#3)
- Update stale AGENTS.md athena directory listing (#4)
- Replace prompt in appendMissingCouncilPrompt instead of appending (#5)
- Extract duplicated session cleanup logic in agent-switch hook (#6)
- Surface skipped council members when >=2 valid members exist (#9)
- Expand fallback handoff regex with negation guards (#11)
- Remove dead council-member agent from agentSources and tests (#12)
- Make runtime council member duplicate check case-insensitive (#14)
- Fix false-positive schema tests by adding required name field (#18)
code-yeongyu pushed a commit that referenced this pull request Apr 15, 2026
…hardening

Fixes from multi-model council audit (7 members, 19 findings, 9 selected):

- Use parseModelString() for cross-provider Anthropic thinking config (#3)
- Update stale AGENTS.md athena directory listing (#4)
- Replace prompt in appendMissingCouncilPrompt instead of appending (#5)
- Extract duplicated session cleanup logic in agent-switch hook (#6)
- Surface skipped council members when >=2 valid members exist (#9)
- Expand fallback handoff regex with negation guards (#11)
- Remove dead council-member agent from agentSources and tests (#12)
- Make runtime council member duplicate check case-insensitive (#14)
- Fix false-positive schema tests by adding required name field (#18)
hexstyle pushed a commit to hexstyle/oh-my-openagent that referenced this pull request Apr 15, 2026
…hardening

Fixes from multi-model council audit (7 members, 19 findings, 9 selected):

- Use parseModelString() for cross-provider Anthropic thinking config (code-yeongyu#3)
- Update stale AGENTS.md athena directory listing (code-yeongyu#4)
- Replace prompt in appendMissingCouncilPrompt instead of appending (code-yeongyu#5)
- Extract duplicated session cleanup logic in agent-switch hook (code-yeongyu#6)
- Surface skipped council members when >=2 valid members exist (code-yeongyu#9)
- Expand fallback handoff regex with negation guards (code-yeongyu#11)
- Remove dead council-member agent from agentSources and tests (code-yeongyu#12)
- Make runtime council member duplicate check case-insensitive (code-yeongyu#14)
- Fix false-positive schema tests by adding required name field (code-yeongyu#18)
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.

1 participant