[Phase 4] Add --timeout flag to cmd_destroy #247

Open
opened 2026-04-08 06:34:36 +02:00 by shoko · 0 comments
Owner

Problem

Timeout handling for sessions is currently done inside the queue-daemon. We need a CLI way to destroy timed-out sessions.

Solution

Add --timeout flag to kugetsu destroy:

  • kugetsu destroy --timeout --force - destroy ALL currently timed-out sessions
  • No issue_ref required when using --timeout

Implementation:

  1. Create internal _get_timeout_tasks() function
  2. When --timeout is set, find all queue items with state==notified where notified_at + TASK_TIMEOUT_HOURS < now
  3. For each timed-out item:
    • Kill pid if exists
    • Stop opencode session if exists
    • Remove worktree
    • Delete session file
    • Update queue item to "error"
  4. --force skips confirmation (always yes for automated --timeout)

Status

BLOCKED - Depends on Phase 1 (help restructure needed to document --timeout flag)

Files

  • skills/kugetsu/scripts/kugetsu-session.sh

Parent: #235
Blocked by: #236 (Phase 1)

## Problem Timeout handling for sessions is currently done inside the queue-daemon. We need a CLI way to destroy timed-out sessions. ## Solution Add --timeout flag to `kugetsu destroy`: - `kugetsu destroy --timeout --force` - destroy ALL currently timed-out sessions - No issue_ref required when using --timeout Implementation: 1. Create internal _get_timeout_tasks() function 2. When --timeout is set, find all queue items with state==notified where notified_at + TASK_TIMEOUT_HOURS < now 3. For each timed-out item: - Kill pid if exists - Stop opencode session if exists - Remove worktree - Delete session file - Update queue item to "error" 4. --force skips confirmation (always yes for automated --timeout) ## Status **BLOCKED** - Depends on Phase 1 (help restructure needed to document --timeout flag) ## Files - skills/kugetsu/scripts/kugetsu-session.sh ## Related Issues Parent: #235 Blocked by: #236 (Phase 1)
shoko added the blocked label 2026-04-08 06:38:29 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#247