fix: wait for opencode to read msg file before removing it #199

Closed
shoko wants to merge 1 commits from fix/msg-file-race-condition into main
Showing only changes of commit e901426e5b - Show all commits

View File

@@ -382,6 +382,7 @@ cmd_start() {
local msg_file="$worktree_path/.kugetsu-msg.txt"
printf '%s' "$dev_message" > "$msg_file"
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 &
sleep 0.5
rm -f "$msg_file"
echo "Session started for '$issue_ref': $new_session_id"
@@ -449,6 +450,7 @@ cmd_continue() {
local msg_file="$worktree_path/.kugetsu-msg.txt"
printf '%s' "$message" > "$msg_file"
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 &
sleep 0.5
rm -f "$msg_file"
}