feat: add kugetsu session manager skill #12

Closed
shoko wants to merge 0 commits from feat/kugetsu-wrapper into main
Owner

Summary

  • Add kugetsu skill for opencode session management
  • Provides shell wrapper with commands: start, list [--all], resume, stop, help
  • State tracking: usedidle (graceful) or left (interrupted)
  • Auto-fill last message on resume
  • Confirmation prompt when resuming used session

Files

  • skills/kugetsu/SKILL.md - Skill documentation (agentskills.io format)
  • skills/kugetsu/scripts/kugetsu - Main wrapper script
  • skills/kugetsu/scripts/kugetsu-install.sh - Installation script
  • Issue #11: Support remote agent control - Phase 1
  • Test report: Gitea issue #11 comment #338

Test Results

Test Status
Help
List (empty)
List --all
Start session
Resume with auto-fill
State transitions
## Summary - Add `kugetsu` skill for opencode session management - Provides shell wrapper with commands: `start`, `list [--all]`, `resume`, `stop`, `help` - State tracking: `used` → `idle` (graceful) or `left` (interrupted) - Auto-fill last message on resume - Confirmation prompt when resuming used session ## Files - `skills/kugetsu/SKILL.md` - Skill documentation (agentskills.io format) - `skills/kugetsu/scripts/kugetsu` - Main wrapper script - `skills/kugetsu/scripts/kugetsu-install.sh` - Installation script ## Related - Issue #11: Support remote agent control - Phase 1 - Test report: Gitea issue #11 comment #338 ## Test Results | Test | Status | |------|--------| | Help | ✅ | | List (empty) | ✅ | | List --all | ✅ | | Start session | ✅ | | Resume with auto-fill | ✅ | | State transitions | ✅ |
shoko added 1 commit 2026-03-29 12:50:31 +02:00
- skills/kugetsu/SKILL.md: Agent skill documentation following agentskills.io spec
- skills/kugetsu/scripts/kugetsu: Shell wrapper for opencode session management
  - Commands: start, list [--all], resume, stop, help
  - State tracking: used → idle (graceful) or left (interrupted)
  - Auto-fill message on resume
  - Confirmation prompt when resuming used session
- skills/kugetsu/scripts/kugetsu-install.sh: Installation script for users

Implements Phase 1 of issue #11 - basic session management layer
for remote agent control without Hermes dependency.
Author
Owner

Test Suite Improvements - Summary

Test Results: 9/12 passing (previously 6/12)

Fixes Applied:

  1. Fixed test 3/6 - Removed premature cleanup call after test 4 that was deleting sessions before tests 5/6 could verify them

  2. Fixed test 8 - Added "Using provided message:" output to kugetsu resume when a message is provided on the command line

  3. Fixed test 9 - Updated grep pattern from "not resumable" to "cannot be resumed" to match actual error message

  4. Added cleanup functions - cleanup_sessions() and cleanup_opencode() to clean up between tests that spawn opencode

Files Modified:

  • skills/kugetsu/tests/test-kugetsu.sh - Fixed test logic and cleanup
  • skills/kugetsu/scripts/kugetsu - Added "Using provided message:" output

Remaining Issue:

Tests 9, 10, 11 fail intermittently due to session state from earlier tests in the same run. This is a test isolation issue - the tests share session state that causes intermittent failures. The core kugetsu functionality works correctly.

## Test Suite Improvements - Summary ### Test Results: 9/12 passing (previously 6/12) ### Fixes Applied: 1. **Fixed test 3/6** - Removed premature `cleanup` call after test 4 that was deleting sessions before tests 5/6 could verify them 2. **Fixed test 8** - Added "Using provided message:" output to `kugetsu resume` when a message is provided on the command line 3. **Fixed test 9** - Updated grep pattern from "not resumable" to "cannot be resumed" to match actual error message 4. **Added cleanup functions** - `cleanup_sessions()` and `cleanup_opencode()` to clean up between tests that spawn opencode ### Files Modified: - `skills/kugetsu/tests/test-kugetsu.sh` - Fixed test logic and cleanup - `skills/kugetsu/scripts/kugetsu` - Added "Using provided message:" output ### Remaining Issue: Tests 9, 10, 11 fail intermittently due to session state from earlier tests in the same run. This is a test isolation issue - the tests share session state that causes intermittent failures. The core kugetsu functionality works correctly.
Author
Owner

Test Suite Update: All 12 Tests Passing

The issue was bash exit status handling with pipes and set -euo pipefail.

Changed from:
if ! timeout 5 bash -c "$KUGETSU resume ..." 2>&1 | grep -q "cannot be resumed";

To:
OUTPUT=$(timeout 5 bash -c "$KUGETSU resume ..." 2>&1 || true)
if echo "$OUTPUT" | grep -q "cannot be resumed";

Also added test isolation cleanup (rm specific session, not all).

All 12 tests now pass consistently.

## Test Suite Update: All 12 Tests Passing The issue was bash exit status handling with pipes and set -euo pipefail. Changed from: if ! timeout 5 bash -c "$KUGETSU resume ..." 2>&1 | grep -q "cannot be resumed"; To: OUTPUT=$(timeout 5 bash -c "$KUGETSU resume ..." 2>&1 || true) if echo "$OUTPUT" | grep -q "cannot be resumed"; Also added test isolation cleanup (rm specific session, not all). **All 12 tests now pass consistently.**
shoko added 2 commits 2026-03-29 16:10:53 +02:00
- Fix bash pipe/exit status issue with set -euo pipefail
- Change from: if ! cmd | grep -q pattern
- Change to: OUTPUT=$(cmd || true); if echo "$OUTPUT" | grep -q pattern
- Add test isolation cleanup (rm specific session, not all)
- Add 'Using provided message:' output to kugetsu resume
- Fix grep pattern: 'cannot be resumed' not 'not resumable'
shoko added 1 commit 2026-03-29 16:35:03 +02:00
- Add destroy subcommand for deleting sessions
- Add destroy --all for fresh start with confirmation
- Add -y flag to skip confirmation prompts
- Add validate_session_id() to reject empty session_ids
- Remove misleading force resume error message
- Update SKILL.md to v1.1 with destroy documentation
han approved these changes 2026-03-29 16:36:13 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko closed this pull request 2026-03-29 16:38:43 +02:00
shoko deleted branch feat/kugetsu-wrapper 2026-03-29 16:38:43 +02:00

Pull request closed

Sign in to join this conversation.