fix(kugetsu): use --format json for session existence check (#38) #39

Merged
shoko merged 1 commits from fix/issue-38-session-checking into main 2026-03-31 06:58:39 +02:00
Owner

Summary

Use opencode session list --format json with grep instead of table output to make check_opencode_session_exists() more reliable.

This fixes issue #38 where forked sessions may not appear in the table format output, causing false 'session expired' reports.

Changes

  • skills/kugetsu/scripts/kugetsu:306 - Changed from:
    opencode session list 2>/dev/null | grep -q "^$session_id"
    
    to:
    opencode session list --format json 2>/dev/null | grep -q "\"$session_id\""
    

Testing

  • All 38 existing tests pass
  • Manual verification needed: run kugetsu init and verify session checking works correctly

Notes

  • Keeps issue open for manual verification before merge
## Summary Use `opencode session list --format json` with grep instead of table output to make `check_opencode_session_exists()` more reliable. This fixes issue #38 where forked sessions may not appear in the table format output, causing false 'session expired' reports. ## Changes - `skills/kugetsu/scripts/kugetsu:306` - Changed from: ```bash opencode session list 2>/dev/null | grep -q "^$session_id" ``` to: ```bash opencode session list --format json 2>/dev/null | grep -q "\"$session_id\"" ``` ## Testing - All 38 existing tests pass - Manual verification needed: run `kugetsu init` and verify session checking works correctly ## Notes - Keeps issue open for manual verification before merge
shoko added 1 commit 2026-03-31 06:57:13 +02:00
Use opencode session list --format json with grep instead of table
output to make check_opencode_session_exists() more reliable.

This fixes issue #38 where forked sessions may not appear in the
table format output, causing false 'session expired' reports.
han approved these changes 2026-03-31 06:58:20 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit ed58cc9a96 into main 2026-03-31 06:58:39 +02:00
Sign in to join this conversation.