[Phase 7] Daemon isolation - call kugetsu as subprocess #250

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

Problem

The queue-daemon currently sources kugetsu-session.sh and calls cmd_continue directly, making it impossible to test without spawning opencode agents.

Solution

Refactor daemon to call kugetsu continue as subprocess:

  1. In process_task(), change from:

    source "$SCRIPT_DIR/kugetsu-session.sh"
    cmd_continue "$issue_ref" "$message"
    

    To:

    kugetsu continue "$issue_ref" "$message" >> "$log_file" 2>&1
    exit_code=$?
    
  2. Check exit code to determine next action:

    • 0: success, update queue state to "notified"
    • 2: max agents, log and break loop for this interval
    • 1 or other: mark task error
  3. For testing: run daemon with KUGEETSU_DRY_RUN=1 to prevent opencode spawns

Status

BLOCKED - Depends on Phase 5 + Phase 6 (exit codes + dry-run env var)

Files

  • skills/kugetsu/scripts/kugetsu-queue-daemon.sh

Parent: #235
Blocked by: #240 (Phase 5), #241 (Phase 6)

## Problem The queue-daemon currently sources kugetsu-session.sh and calls cmd_continue directly, making it impossible to test without spawning opencode agents. ## Solution Refactor daemon to call `kugetsu continue` as subprocess: 1. In process_task(), change from: ```bash source "$SCRIPT_DIR/kugetsu-session.sh" cmd_continue "$issue_ref" "$message" ``` To: ```bash kugetsu continue "$issue_ref" "$message" >> "$log_file" 2>&1 exit_code=$? ``` 2. Check exit code to determine next action: - 0: success, update queue state to "notified" - 2: max agents, log and break loop for this interval - 1 or other: mark task error 3. For testing: run daemon with KUGEETSU_DRY_RUN=1 to prevent opencode spawns ## Status **BLOCKED** - Depends on Phase 5 + Phase 6 (exit codes + dry-run env var) ## Files - skills/kugetsu/scripts/kugetsu-queue-daemon.sh ## Related Issues Parent: #235 Blocked by: #240 (Phase 5), #241 (Phase 6)
shoko added the blocked label 2026-04-08 06:38:31 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#250