bug: main kugetsu script has duplicate buggy update_queue_item_state #170

Closed
opened 2026-04-06 02:40:24 +02:00 by shoko · 0 comments
Owner

Problem

The main kugetsu script (kugetsu) sources kugetsu-index.sh which defines the FIXED update_queue_item_state(). However, kugetsu LATER defines its OWN update_queue_item_state() function which OVERWRITES the fixed one.

This happens because kugetsu sources modules in order, then later in the same file defines its own version of the function.

Impact

  • Queue daemon WORKS - it only sources kugetsu-index.sh, kugetsu-worktree.sh, kugetsu-log.sh - NOT kugetsu itself
  • Main kugetsu command FAILS for notifications from check_task_timeouts() because it uses its own buggy version

When check_task_timeouts() in kugetsu calls update_queue_item_state to set error state, the os.system() call silently fails.

Root Cause

Duplicate function definitions. The version at line 364 in kugetsu uses os.system() to call kugetsu_add_notification, which doesn't work because os.system() spawns a subprocess that cannot access bash functions.

Fix

Remove the update_queue_item_state definition from kugetsu. The fixed version in kugetsu-index.sh should be used since kugetsu sources kugetsu-index.sh.

Severity

High - Notifications broken for timeout errors in main kugetsu command

## Problem The main kugetsu script (kugetsu) sources kugetsu-index.sh which defines the FIXED update_queue_item_state(). However, kugetsu LATER defines its OWN update_queue_item_state() function which OVERWRITES the fixed one. This happens because kugetsu sources modules in order, then later in the same file defines its own version of the function. ## Impact - Queue daemon WORKS - it only sources kugetsu-index.sh, kugetsu-worktree.sh, kugetsu-log.sh - NOT kugetsu itself - Main kugetsu command FAILS for notifications from check_task_timeouts() because it uses its own buggy version When check_task_timeouts() in kugetsu calls update_queue_item_state to set error state, the os.system() call silently fails. ## Root Cause Duplicate function definitions. The version at line 364 in kugetsu uses os.system() to call kugetsu_add_notification, which doesn't work because os.system() spawns a subprocess that cannot access bash functions. ## Fix Remove the update_queue_item_state definition from kugetsu. The fixed version in kugetsu-index.sh should be used since kugetsu sources kugetsu-index.sh. ## Severity High - Notifications broken for timeout errors in main kugetsu command
shoko closed this issue 2026-04-06 02:42:25 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#170