Skip to content

Commit dc60cc7

Browse files
committed
Add task prompt support
1 parent 7432ac8 commit dc60cc7

File tree

1 file changed

+11
-2
lines changed
  • registry/harsh9485/modules/sourcegraph_amp/scripts

1 file changed

+11
-2
lines changed

registry/harsh9485/modules/sourcegraph_amp/scripts/start.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@ fi
2525
cd "$dir"
2626
echo "Add AMP API key"
2727
export AMP_API_KEY=$SOURCEGRAPH_AMP_API_KEY
28-
# Launch AgentAPI server with AMP
29-
agentapi server --term-width=67 --term-height=1190 -- amp
28+
29+
if [ -n "$SOURCEGRAPH_AMP_TASK_PROMPT" ]; then
30+
printf "Running the task prompt: %s\n" "$SOURCEGRAPH_AMP_TASK_PROMPT"
31+
PROMPT="Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $SOURCEGRAPH_AMP_TASK_PROMPT"
32+
33+
# Pipe the prompt into amp, which will be run inside agentapi
34+
agentapi server --term-width=67 --term-height=1190 -- bash -c "echo \"$PROMPT\" | amp"
35+
else
36+
printf "No task prompt given.\n"
37+
agentapi server --term-width=67 --term-height=1190 -- amp
38+
fi

0 commit comments

Comments
 (0)