[BUG] cmd_start creates session but never forks PM agent to work on it #187

Closed
opened 2026-04-06 08:31:28 +02:00 by shoko · 0 comments
Owner

Summary

cmd_start (and the daemon's process_task) creates a worktree and session file, but never actually starts the opencode agent on that session. The queue item is marked 'notified' but no agent is ever forked.

Steps to reproduce

  1. kugetsu init
  2. kugetsu delegate "#158"
  3. Watch queue: task goes pending -> notified
  4. Session ses_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX exists with state idle
  5. No agent process is ever started for that session

Expected behavior

After creating the worktree + session, cmd_start or process_task should fork the PM agent via:

opencode run --continue --session "$new_session_id" "$message"

This is how the legacy cmd_delegate path works (line 197):

nohup sh -c "GITEA_TOKEN=*** opencode run '$message' --continue --session '$pm_session'" >> log_file 2>&1 &

Investigation

  • cmd_start (kugetsu-session.sh:202) creates worktree, detects new session ID, writes session file, then exits
  • process_task (kugetsu-queue-daemon.sh:99) calls cmd_start, then updates queue state to notified
  • Neither ever calls opencode run --continue on the newly created session
  • Result: session sits idle forever, PM agent never receives the delegation message

Severity

Critical -- delegation is completely broken. Every delegated task fails to reach the PM agent.

## Summary cmd_start (and the daemon's process_task) creates a worktree and session file, but never actually starts the opencode agent on that session. The queue item is marked 'notified' but no agent is ever forked. ## Steps to reproduce 1. kugetsu init 2. kugetsu delegate "https://git.fbrns.co/shoko/kugetsu/issues/158" 3. Watch queue: task goes pending -> notified 4. Session ses_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX exists with state idle 5. No agent process is ever started for that session ## Expected behavior After creating the worktree + session, cmd_start or process_task should fork the PM agent via: opencode run --continue --session "$new_session_id" "$message" This is how the legacy cmd_delegate path works (line 197): nohup sh -c "GITEA_TOKEN=*** opencode run '$message' --continue --session '$pm_session'" >> log_file 2>&1 & ## Investigation - cmd_start (kugetsu-session.sh:202) creates worktree, detects new session ID, writes session file, then exits - process_task (kugetsu-queue-daemon.sh:99) calls cmd_start, then updates queue state to notified - Neither ever calls opencode run --continue on the newly created session - Result: session sits idle forever, PM agent never receives the delegation message ## Severity Critical -- delegation is completely broken. Every delegated task fails to reach the PM agent.
shoko closed this issue 2026-04-06 10:13:44 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#187