Skip to content

Commit 5bfa792

Browse files
fix: remove copilot help check in existing session check
1 parent 0807094 commit 5bfa792

File tree

1 file changed

+13
-15
lines changed
  • registry/coder-labs/modules/copilot/scripts

1 file changed

+13
-15
lines changed

registry/coder-labs/modules/copilot/scripts/start.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,19 @@ build_copilot_args() {
7070

7171
check_existing_session() {
7272
if [ "$ARG_RESUME_SESSION" = "true" ]; then
73-
if copilot --help > /dev/null 2>&1; then
74-
local session_dir="$HOME/.copilot/history-session-state"
75-
if [ -d "$session_dir" ] && [ -n "$(ls "$session_dir"/session_*_*.json 2> /dev/null)" ]; then
76-
local latest_session_file
77-
latest_session_file=$(ls "$session_dir"/session_*_*.json 2> /dev/null | sort -t_ -k3 -n -r | head -n 1)
78-
79-
if [ -n "$latest_session_file" ]; then
80-
local session_id
81-
session_id=$(basename "$latest_session_file" | sed 's/session_\(.*\)_[0-9]*.json/\1/')
82-
83-
if [ -n "$session_id" ]; then
84-
echo "Found existing Copilot sessions. Will resume latest: $session_id" >&2
85-
echo "$session_id"
86-
return 0
87-
fi
73+
local session_dir="$HOME/.copilot/history-session-state"
74+
if [ -d "$session_dir" ] && [ -n "$(ls "$session_dir"/session_*_*.json 2> /dev/null)" ]; then
75+
local latest_session_file
76+
latest_session_file=$(ls "$session_dir"/session_*_*.json 2> /dev/null | sort -t_ -k3 -n -r | head -n 1)
77+
78+
if [ -n "$latest_session_file" ]; then
79+
local session_id
80+
session_id=$(basename "$latest_session_file" | sed 's/session_\(.*\)_[0-9]*.json/\1/')
81+
82+
if [ -n "$session_id" ]; then
83+
echo "Found existing Copilot sessions. Will resume latest: $session_id" >&2
84+
echo "$session_id"
85+
return 0
8886
fi
8987
fi
9088
fi

0 commit comments

Comments
 (0)