[BUG] PM agent goes idle on decision points + queue state tracking broken #150

Closed
opened 2026-04-05 12:00:19 +02:00 by shoko · 0 comments
Owner

Summary: Three related bugs where the queue/agent system appears to work but tasks never complete properly.


Bug 1: Agent hits decision point and goes idle instead of asking for guidance

When a delegated agent encounters a blocker (e.g., dependency on another issue), it:

  1. Writes analysis internally ("recommend doing #116 first")
  2. Stops without messaging the user
  3. Session ends without resolution

Observed in: Issues #119 and #121 — both depended on #116 (Modularize Shell Script). Agents found the dependency, analyzed options, and stopped — never notifying the user.

Expected behavior: Agent should either:

  • Message the user for guidance before stopping
  • Fall back to a default action (e.g., proceed anyway, or close with explanation)

Bug 2: Queue state does not update after agent finishes

When a delegated task completes:

  • Session ends (no longer appears in opencode session list)
  • No PR created (or PR created but daemon doesnt detect it)
  • Queue still shows notified: N, completed: 0

Observed in: After delegating #116, #117, #118, #119, #121, #144:

  • Sessions completed (confirmed via opencode session list)
  • Some PRs created (#120)
  • Queue daemon reported "Failed to start task after 3 attempts" then reset to pending
  • Queue stats stayed at notified: 3, completed: 0

Root cause: Daemon is not detecting agent completion. Tasks stay in "notified" state forever.


Bug 3: queue clear does not clear queue/items/

Running kugetsu queue clear:

  • Clears ~/.kugetsu/queue.json (root file)
  • Does NOT clear ~/.kugetsu/queue/items/*.json (individual queue item files)

Result: After clearing queue, daemon still has old items in memory/state and continues processing them.

Fix: kugetsu queue clear should also delete all files in ~/.kugetsu/queue/items/.


Related: Bug #148 (test suite overwrites index.json) — same symptom: system appears ok but is broken.

Severity: High — queue system appears to work but tasks never properly complete.

**Summary:** Three related bugs where the queue/agent system appears to work but tasks never complete properly. --- **Bug 1: Agent hits decision point and goes idle instead of asking for guidance** When a delegated agent encounters a blocker (e.g., dependency on another issue), it: 1. Writes analysis internally ("recommend doing #116 first") 2. Stops without messaging the user 3. Session ends without resolution **Observed in:** Issues #119 and #121 — both depended on #116 (Modularize Shell Script). Agents found the dependency, analyzed options, and stopped — never notifying the user. **Expected behavior:** Agent should either: - Message the user for guidance before stopping - Fall back to a default action (e.g., proceed anyway, or close with explanation) --- **Bug 2: Queue state does not update after agent finishes** When a delegated task completes: - Session ends (no longer appears in `opencode session list`) - No PR created (or PR created but daemon doesnt detect it) - Queue still shows `notified: N, completed: 0` **Observed in:** After delegating #116, #117, #118, #119, #121, #144: - Sessions completed (confirmed via opencode session list) - Some PRs created (#120) - Queue daemon reported "Failed to start task after 3 attempts" then reset to pending - Queue stats stayed at `notified: 3, completed: 0` **Root cause:** Daemon is not detecting agent completion. Tasks stay in "notified" state forever. --- **Bug 3: queue clear does not clear queue/items/** Running `kugetsu queue clear`: - Clears `~/.kugetsu/queue.json` (root file) - Does NOT clear `~/.kugetsu/queue/items/*.json` (individual queue item files) **Result:** After clearing queue, daemon still has old items in memory/state and continues processing them. **Fix:** `kugetsu queue clear` should also delete all files in `~/.kugetsu/queue/items/`. --- **Related:** Bug #148 (test suite overwrites index.json) — same symptom: system appears ok but is broken. **Severity:** High — queue system appears to work but tasks never properly complete.
shoko added the high label 2026-04-05 12:00:19 +02:00
shoko closed this issue 2026-04-05 15:11:54 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#150