fix(kugetsu): remove broken session existence check (#38) #40

Merged
shoko merged 1 commits from fix/issue-38-remove-broken-session-check into main 2026-03-31 07:27:38 +02:00
Owner

Summary

Remove the fundamentally broken check_opencode_session_exists() function usage. The function relied on opencode session list which does NOT include forked sessions regardless of output format (table or JSON). This caused false 'session expired' reports.

Changes

  • cmd_status(): Remove session check - now returns 'ok' if session is registered in kugetsu index
  • cmd_delegate(): Remove session check - let opencode run fail naturally if session is dead
  • cmd_continue(): Remove warning - proceed regardless of opencode session list state
  • cmd_doctor(): Simplify - just show registered sessions without checking opencode
  • test-kugetsu-v2.sh: Update test 25 to reflect new behavior

Root Cause

opencode run --fork --session creates sessions that are fully functional but do NOT appear in opencode session list. This is a fundamental limitation - the existence check was always going to fail for forked sessions.

Testing

  • Tests updated and should pass (except timing issues)
  • Manual verification: Run kugetsu init and verify kugetsu status returns ok

Issue #38: #38

## Summary Remove the fundamentally broken `check_opencode_session_exists()` function usage. The function relied on `opencode session list` which does NOT include forked sessions regardless of output format (table or JSON). This caused false 'session expired' reports. ## Changes - **cmd_status()**: Remove session check - now returns 'ok' if session is registered in kugetsu index - **cmd_delegate()**: Remove session check - let `opencode run` fail naturally if session is dead - **cmd_continue()**: Remove warning - proceed regardless of opencode session list state - **cmd_doctor()**: Simplify - just show registered sessions without checking opencode - **test-kugetsu-v2.sh**: Update test 25 to reflect new behavior ## Root Cause `opencode run --fork --session` creates sessions that are fully functional but do NOT appear in `opencode session list`. This is a fundamental limitation - the existence check was always going to fail for forked sessions. ## Testing - Tests updated and should pass (except timing issues) - Manual verification: Run `kugetsu init` and verify `kugetsu status` returns `ok` Issue #38: https://git.fbrns.co/shoko/kugetsu/issues/38
shoko added 1 commit 2026-03-31 07:24:40 +02:00
The check_opencode_session_exists() function was fundamentally broken
because 'opencode session list' does not include forked sessions,
regardless of output format (table or JSON). This caused false
'session expired' reports even when sessions were fully functional.

Changes:
- Remove session check from cmd_status() - now returns 'ok' if session registered
- Remove session check from cmd_delegate() - let opencode run fail naturally
- Remove warning from cmd_continue() - proceed regardless
- Simplify cmd_doctor() - just show registered sessions
- Update test to reflect new behavior

Issue #38: #38
han approved these changes 2026-03-31 07:26:54 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit f3bd2dca28 into main 2026-03-31 07:27:38 +02:00
Sign in to join this conversation.