@@ -25,30 +25,29 @@ validate_copilot_installation() {
2525}
2626
2727build_copilot_args () {
28- local args=()
29- local combined_prompt=" "
28+ COPILOT_ARGS=()
3029
3130 # Combine system prompt with AI prompt if both exist
3231 if [ -n " $ARG_SYSTEM_PROMPT " ] && [ -n " $ARG_AI_PROMPT " ]; then
33- combined_prompt=" $ARG_SYSTEM_PROMPT
32+ local combined_prompt=" $ARG_SYSTEM_PROMPT
3433
3534Task: $ARG_AI_PROMPT "
36- args +=(--prompt " $combined_prompt " )
35+ COPILOT_ARGS +=(--prompt " $combined_prompt " )
3736 elif [ -n " $ARG_SYSTEM_PROMPT " ]; then
38- args +=(--prompt " $ARG_SYSTEM_PROMPT " )
37+ COPILOT_ARGS +=(--prompt " $ARG_SYSTEM_PROMPT " )
3938 elif [ -n " $ARG_AI_PROMPT " ]; then
40- args +=(--prompt " $ARG_AI_PROMPT " )
39+ COPILOT_ARGS +=(--prompt " $ARG_AI_PROMPT " )
4140 fi
4241
4342 if [ " $ARG_ALLOW_ALL_TOOLS " = " true" ]; then
44- args +=(--allow-all-tools)
43+ COPILOT_ARGS +=(--allow-all-tools)
4544 fi
4645
4746 if [ -n " $ARG_ALLOW_TOOLS " ]; then
4847 IFS=' ,' read -ra ALLOW_ARRAY <<< " $ARG_ALLOW_TOOLS"
4948 for tool in " ${ALLOW_ARRAY[@]} " ; do
5049 if [ -n " $tool " ]; then
51- args +=(--allow-tool " $tool " )
50+ COPILOT_ARGS +=(--allow-tool " $tool " )
5251 fi
5352 done
5453 fi
@@ -57,12 +56,10 @@ Task: $ARG_AI_PROMPT"
5756 IFS=' ,' read -ra DENY_ARRAY <<< " $ARG_DENY_TOOLS"
5857 for tool in " ${DENY_ARRAY[@]} " ; do
5958 if [ -n " $tool " ]; then
60- args +=(--deny-tool " $tool " )
59+ COPILOT_ARGS +=(--deny-tool " $tool " )
6160 fi
6261 done
6362 fi
64-
65- echo " ${args[@]} "
6663}
6764
6865configure_copilot_model () {
@@ -88,17 +85,11 @@ start_agentapi() {
8885 echo " Starting in directory: $ARG_WORKDIR "
8986 cd " $ARG_WORKDIR "
9087
91- local copilot_args_str
92- copilot_args_str=$( build_copilot_args)
93-
94- local copilot_args=()
95- if [ -n " $copilot_args_str " ]; then
96- read -ra copilot_args <<< " $copilot_args_str"
97- fi
88+ build_copilot_args
9889
99- if [ ${# copilot_args [@]} -gt 0 ]; then
100- echo " Copilot arguments: ${copilot_args [*]} "
101- agentapi server --type claude --term-width 120 --term-height 40 -- copilot " ${copilot_args [@]} "
90+ if [ ${# COPILOT_ARGS [@]} -gt 0 ]; then
91+ echo " Copilot arguments: ${COPILOT_ARGS [*]} "
92+ agentapi server --type claude --term-width 120 --term-height 40 -- copilot " ${COPILOT_ARGS [@]} "
10293 else
10394 echo " Starting Copilot CLI in interactive mode"
10495 agentapi server --type claude --term-width 120 --term-height 40 -- copilot
0 commit comments