diff --git a/registry/coder/modules/agentapi/scripts/main.sh b/registry/coder/modules/agentapi/scripts/main.sh index 8087173b..12a7e433 100644 --- a/registry/coder/modules/agentapi/scripts/main.sh +++ b/registry/coder/modules/agentapi/scripts/main.sh @@ -112,7 +112,7 @@ export AGENTAPI_CHAT_BASE_PATH="${AGENTAPI_CHAT_BASE_PATH:-}" export AGENTAPI_ALLOWED_HOSTS="*" # Call agentapi-start.sh to write agent-command.sh -"$module_path/scripts/agentapi-start.sh" +"$module_path/scripts/agentapi-start.sh" &> "$module_path/agentapi-start.log" # Build agentapi server command arguments ARGS=( @@ -128,7 +128,7 @@ if [ -n "${AGENTAPI_INITIAL_PROMPT}" ]; then ARGS+=("--initial-prompt" "${AGENTAPI_INITIAL_PROMPT}") fi -# Start agentapi server with the agent-command.sh script -nohup agentapi "${ARGS[@]}" -- "$module_path/agent-command.sh" &> "$module_path/agentapi-start.log" & +# Start agentapi server with the agent-command.sh script (append logs to same file) +nohup agentapi "${ARGS[@]}" -- "$module_path/agent-command.sh" &>> "$module_path/agentapi-start.log" & "$module_path/scripts/agentapi-wait-for-start.sh" "${AGENTAPI_PORT}"