Queue daemon crashes with unbound GITEA_TOKEN variable #160

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

Bug

When the queue daemon runs cmd_continue, it fails with GITEA_TOKEN: unbound variable because the subshell does not inherit the variable from the parent shell.

Root Cause

cmd_continue uses:

nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 &

The subshell cannot expand ${GITEA_TOKEN:-} because the variable is not set in the daemon's environment.

Fix

Source ~/.kugetsu/env/pm-agent.env at daemon startup so GITEA_TOKEN is available. The daemon currently only sources default.env which doesn't contain the token.

## Bug When the queue daemon runs `cmd_continue`, it fails with `GITEA_TOKEN: unbound variable` because the subshell does not inherit the variable from the parent shell. ## Root Cause `cmd_continue` uses: nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --continue --session '$pm_session' >> '$log_file' 2>&1" > /dev/null 2>&1 & The subshell cannot expand `${GITEA_TOKEN:-}` because the variable is not set in the daemon's environment. ## Fix Source `~/.kugetsu/env/pm-agent.env` at daemon startup so `GITEA_TOKEN` is available. The daemon currently only sources `default.env` which doesn't contain the token.
shoko closed this issue 2026-04-06 01:42:05 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#160