Compare commits
2 Commits
4ec76b1248
...
fix/issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a130a79bd7 | ||
|
|
9d0bcef465 |
@@ -83,6 +83,10 @@ EOF
|
|||||||
if [ -n "$existing_base" ] && [ "$existing_base" != "null" ]; then
|
if [ -n "$existing_base" ] && [ "$existing_base" != "null" ]; then
|
||||||
if [ "$force" = true ]; then
|
if [ "$force" = true ]; then
|
||||||
echo "Warning: Reinitializing sessions (force mode)" >&2
|
echo "Warning: Reinitializing sessions (force mode)" >&2
|
||||||
|
echo "Destroying all sessions, worktrees, and logs..." >&2
|
||||||
|
cmd_destroy --base -y 2>/dev/null || true
|
||||||
|
cmd_destroy --pm-agent -y 2>/dev/null || true
|
||||||
|
rm -f "$LOGS_DIR"/*.log 2>/dev/null || true
|
||||||
else
|
else
|
||||||
echo "Error: Base session already exists: $existing_base" >&2
|
echo "Error: Base session already exists: $existing_base" >&2
|
||||||
echo "Use --force to reinitialize" >&2
|
echo "Use --force to reinitialize" >&2
|
||||||
@@ -221,7 +225,10 @@ cmd_delegate() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --session '$new_session'" >> "$log_file" 2>&1 &
|
local msg_file="$LOGS_DIR/msg-$new_session.txt"
|
||||||
|
printf '%s' "$message" > "$msg_file"
|
||||||
|
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session'" >> "$log_file" 2>&1 &
|
||||||
|
rm -f "$msg_file"
|
||||||
echo "Delegated to new session (logged to $(basename "$log_file"))"
|
echo "Delegated to new session (logged to $(basename "$log_file"))"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +376,10 @@ cmd_start() {
|
|||||||
load_agent_env "dev"
|
load_agent_env "dev"
|
||||||
|
|
||||||
cd "$worktree_path"
|
cd "$worktree_path"
|
||||||
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$dev_message' --session '$new_session_id'" >> "$LOGS_DIR/dev-$new_session_id.log" 2>&1 &
|
local msg_file="$LOGS_DIR/msg-$new_session_id.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-$new_session_id.log" 2>&1 &
|
||||||
|
rm -f "$msg_file"
|
||||||
|
|
||||||
echo "Session started for '$issue_ref': $new_session_id"
|
echo "Session started for '$issue_ref': $new_session_id"
|
||||||
echo "Worktree: $worktree_path"
|
echo "Worktree: $worktree_path"
|
||||||
@@ -419,12 +429,12 @@ cmd_continue() {
|
|||||||
local issue_ref=$(python3 -c "import json; print(json.load(open('$session_path')).get('issue_ref', ''))" 2>/dev/null || echo "")
|
local issue_ref=$(python3 -c "import json; print(json.load(open('$session_path')).get('issue_ref', ''))" 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$worktree_path" ] || [ ! -d "$worktree_path" ]; then
|
if [ -z "$worktree_path" ] || [ ! -d "$worktree_path" ]; then
|
||||||
echo "Error: Worktree is missing for '$session_name'" >&2
|
echo "Warning: Worktree is missing for '$session_name'. Recovering..." >&2
|
||||||
echo "Removing stale session file..." >&2
|
|
||||||
rm -f "$session_path"
|
rm -f "$session_path"
|
||||||
remove_issue_from_index "$session_name"
|
remove_issue_from_index "$session_name"
|
||||||
echo "Use 'kugetsu start $session_name' to create a new session." >&2
|
echo "Calling cmd_start to create new session and worktree..." >&2
|
||||||
exit 1
|
cmd_start "$session_name" "$message"
|
||||||
|
return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$message" ]; then
|
if [ -z "$message" ]; then
|
||||||
@@ -432,7 +442,10 @@ cmd_continue() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$worktree_path"
|
cd "$worktree_path"
|
||||||
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '$message' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$opencode_session_id.log" 2>&1 &
|
local msg_file="$LOGS_DIR/msg-$opencode_session_id.txt"
|
||||||
|
printf '%s' "$message" > "$msg_file"
|
||||||
|
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$opencode_session_id.log" 2>&1 &
|
||||||
|
rm -f "$msg_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_list() {
|
cmd_list() {
|
||||||
|
|||||||
Reference in New Issue
Block a user