Commit Graph

15 Commits

Author SHA1 Message Date
shokollm
c51a886aa6 fix(kugetsu): capture forked session ID from opencode output
The --fork flag outputs the new session ID. Parse that instead of
relying on session list which may return wrong session when multiple
exist. Added fallback to session list parsing.
2026-03-29 20:16:51 +00:00
shokollm
7f3952ff9d test(kugetsu): add v2.0 test suite for issue-driven session management 2026-03-29 20:01:16 +00:00
shokollm
f2ab637d1f fix(kugetsu): update install script with new commands 2026-03-29 20:00:17 +00:00
shokollm
e014d7bfb9 fix(kugetsu): fix bash substitution error in cmd_start
The function call inside ${} syntax was invalid. Changed to use
command substitution $(...) instead.
2026-03-29 19:53:42 +00:00
shokollm
7146e3bd92 feat(kugetsu): implement issue-driven session management
- Add kugetsu init to create base session via TUI
- Add kugetsu start/continue for issue-based task handling
- Add kugetsu list/prune/destroy for session lifecycle
- Implement directory files + index.json storage pattern
- Use issue ref format: instance/user/repo#number
- Fork from base session enables headless operation

Solves: opencode headless CLI limitation discovered in issue #14
2026-03-29 19:51:51 +00:00
shokollm
e397a64d27 feat(kugetsu): add --debug flag for real-time output capture
- Add --debug flag to start/resume for verbose opencode output
- Use stdbuf -oL to unbuffer stdout for real-time display
- Capture debug logs to ~/.kugetsu/sessions/<id>/debug.log
- Add --debug to stop/destroy for viewing logs before actions
- Position-agnostic flag parsing (--debug can appear anywhere in args)
2026-03-29 16:23:10 +00:00
shokollm
dd9a444920 feat: add destroy command and session_id validation
- 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
2026-03-29 14:34:56 +00:00
shokollm
b992949314 fix: resolve test failures - all 12 tests pass
- 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'
2026-03-29 14:10:45 +00:00
shokollm
5a9c3a87a9 test: add kugetsu test suite 2026-03-29 11:12:19 +00:00
shokollm
7edb54cd3f feat: add kugetsu session manager skill
- 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.
2026-03-29 10:50:14 +00:00
shokollm
7eb83454ba fix: exec opencode.real directly to avoid re-invoking wrapper 2026-03-27 13:43:13 +00:00
shokollm
94f08c1b8d fix: use realpath -m instead of cd to get absolute path for worktree base 2026-03-27 13:37:51 +00:00
shokollm
2010275dda fix: use absolute path for worktree to prevent nested worktrees 2026-03-27 13:24:25 +00:00
shokollm
b1dc002b09 refactor: remove duplicate script from SKILL.md, use reference instead 2026-03-27 13:05:09 +00:00
shokollm
63b89eed6d feat: add opencode-worktree skill for isolated sessions
- Adds skills/opencode-worktree/ with SKILL.md and opencode-worktree.sh
- Creates unique git worktree per session (e.g. session-20260327-a1b2c3-refactor-auth)
- Cleans up stale worktrees on every launch
- Branch always based on main
- User can source directly or copy to PATH
2026-03-27 12:59:41 +00:00