fix: validate sessions in cmd_status + use isolated test environment #153

Closed
shoko wants to merge 0 commits from fix/issue-148-test-suite-index-corruption into main
Owner

Summary

Fixes issue #148 - Test suite overwrites index.json with fake session IDs.

Changes

  1. cmd_status now validates sessions against opencode

    • Reports error: base session X not found in opencode if base session missing
    • Reports error: pm_agent session X not found in opencode if pm_agent missing
    • Prevents system from appearing to work when sessions are actually broken
  2. Test suite uses isolated environment

    • All tests now use KUGETSU_DIR=/tmp/test-kugetsu-$$ instead of ~/.kugetsu
    • Prevents test suite from corrupting real user data
    • Cleanup removes test directory entirely

Impact

  • kugetsu status will now detect and report when sessions registered in index.json do not actually exist in opencode
  • Test suite no longer affects real ~/.kugetsu directory

Fixes #148

## Summary Fixes issue #148 - Test suite overwrites index.json with fake session IDs. ### Changes 1. **cmd_status now validates sessions against opencode** - Reports `error: base session X not found in opencode` if base session missing - Reports `error: pm_agent session X not found in opencode` if pm_agent missing - Prevents system from appearing to work when sessions are actually broken 2. **Test suite uses isolated environment** - All tests now use `KUGETSU_DIR=/tmp/test-kugetsu-$$` instead of `~/.kugetsu` - Prevents test suite from corrupting real user data - Cleanup removes test directory entirely ### Impact - `kugetsu status` will now detect and report when sessions registered in index.json do not actually exist in opencode - Test suite no longer affects real `~/.kugetsu` directory Fixes #148
shoko added 1 commit 2026-04-05 14:11:14 +02:00
1. cmd_status now validates session IDs against opencode session list
   - Reports 'error: base session X not found in opencode' if missing
   - Reports 'error: pm_agent session X not found in opencode' if missing

2. Test suite now uses isolated KUGETSU_DIR=/tmp/test-kugetsu-$$
   - All tests use separate test directory instead of ~/.kugetsu
   - Prevents test suite from corrupting real user data
   - Cleanup removes test directory entirely

Fixes #148
shoko added 1 commit 2026-04-05 14:24:12 +02:00
shoko closed this pull request 2026-04-05 14:25:16 +02:00
shoko deleted branch fix/issue-148-test-suite-index-corruption 2026-04-05 14:25:16 +02:00

Pull request closed

Sign in to join this conversation.