fix(kugetsu-index): call kugetsu_add_notification from bash instead of os.system() #169

Merged
shoko merged 1 commits from fix/issue-167-notification-bash into main 2026-04-06 02:35:37 +02:00
Owner

Summary

Fix notifications for completed/error states by calling kugetsu_add_notification from bash instead of via Python os.system().

Problem

Issue #167: update_queue_item_state() in kugetsu-index.sh was calling kugetsu_add_notification via os.system():

This failed silently because os.system() spawns a NEW subprocess that cannot access bash functions defined in the parent shell. kugetsu_add_notification is a bash function, not an executable.

Impact

  • task_completed notification never fires
  • task_error notification never fires
  • task_queued works fine (called directly from bash)

Fix

  1. Extract issue_ref in bash before Python block
  2. Remove os.system() calls from Python
  3. Call kugetsu_add_notification directly from bash after Python updates JSON

This works because kugetsu-index.sh sources kugetsu-log.sh which defines kugetsu_add_notification, so it's available in the same shell context.

Fixes #167

## Summary Fix notifications for completed/error states by calling kugetsu_add_notification from bash instead of via Python os.system(). ## Problem Issue #167: update_queue_item_state() in kugetsu-index.sh was calling kugetsu_add_notification via os.system(): This failed silently because os.system() spawns a NEW subprocess that cannot access bash functions defined in the parent shell. kugetsu_add_notification is a bash function, not an executable. ## Impact - task_completed notification never fires - task_error notification never fires - task_queued works fine (called directly from bash) ## Fix 1. Extract issue_ref in bash before Python block 2. Remove os.system() calls from Python 3. Call kugetsu_add_notification directly from bash after Python updates JSON This works because kugetsu-index.sh sources kugetsu-log.sh which defines kugetsu_add_notification, so it's available in the same shell context. Fixes #167
shoko added 1 commit 2026-04-06 02:33:55 +02:00
os.system() spawns a new subprocess that cannot access bash functions.
Now calling kugetsu_add_notification directly from bash after Python updates JSON.

Fixes #167
han approved these changes 2026-04-06 02:35:21 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 9667c3e800 into main 2026-04-06 02:35:37 +02:00
Sign in to join this conversation.