Skip to content

Commit 2e40967

Browse files
committed
Update main.tf file
1 parent 4428d8c commit 2e40967

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

registry/coder/modules/aider/main.tf

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ variable "task_prompt" {
8181
description = "Task prompt to use with Aider"
8282
default = ""
8383
}
84-
resource "coder_env" "task_prompt" {
85-
agent_id = var.agent_id
86-
name = "AIDER_TASK_PROMPT"
87-
value = var.task_prompt
88-
}
8984

9085
variable "aider_prompt" {
9186
type = bool
@@ -161,7 +156,7 @@ variable "agentapi_version" {
161156
variable "base_aider_config" {
162157
type = string
163158
description = <<-EOT
164-
The base Aider configuration in YAML format will be stored in the .aider.conf.yml file.
159+
Base Aider configuration in ynl format. Will be Store in .aider.conf.yml file.
165160
166161
options include:
167162
read:
@@ -187,7 +182,7 @@ variable "base_aider_config" {
187182
188183
Reference : https://aider.chat/docs/config/aider_conf.html
189184
EOT
190-
default = ""
185+
default = null
191186
}
192187

193188

@@ -216,12 +211,12 @@ locals {
216211
type: builtin
217212
EOT
218213

219-
formatted_base = " ${replace(trimspace(local.coder_mcp), "\n", "\n ")}"
214+
formatted_base = "\n ${replace(trimspace(local.coder_mcp), "\n", "\n ")}"
220215
additional_extensions = var.experiment_additional_extensions != null ? "\n ${replace(trimspace(var.experiment_additional_extensions), "\n", "\n ")}" : ""
221-
222-
combined_extensions = <<-EOT
216+
base_aider_config = var.base_aider_config != null ? "${replace(trimspace(var.base_aider_config), "\n", "\n ")}" : ""
217+
combined_extensions = <<-EOT
223218
extensions:
224-
${local.formatted_base}${local.additional_extensions}
219+
${local.base_aider_config}${local.formatted_base}${local.additional_extensions}
225220
EOT
226221

227222
# Map providers to their environment variable names
@@ -272,6 +267,7 @@ module "agentapi" {
272267
echo -n '${base64encode(local.start_script)}' | base64 -d > /tmp/start.sh
273268
chmod +x /tmp/start.sh
274269
AIDER_START_DIRECTORY='${var.folder}' \
270+
ARG_API_KEY='${var.ai_api_key}' \
275271
ARG_AI_MODULE='${var.ai_model}' \
276272
ARG_AI_PROVIDER='${var.ai_provider}' \
277273
ARG_ENV_API_NAME_HOLDER='${local.env_var_name}' \

registry/coder/modules/aider/scripts/start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ else
1919
fi
2020

2121

22-
if [ "${AIDER_PROMPT}" == "true" && -n "${ARG_TASK_PROMPT:-}" ]; then
23-
printf "Adier start only with this prompt : $AIDER_PROMPT"
24-
mkdir -p $HOME/.aider-module/aider_output.txt
22+
if [[ "${AIDER_PROMPT}" == "true" && -n "${ARG_TASK_PROMPT:-}" ]]; then
23+
printf "Aider start only with this prompt : $ARG_TASK_PROMPT"
24+
mkdir -p $HOME/.aider-module/
2525
echo aider --model $ARG_AI_MODULE --yes-always --message "$ARG_TASK_PROMPT" > $HOME/.aider-module/aider_output.txt
2626

2727
elif [ -n "${ARG_TASK_PROMPT:-}" ]; then

0 commit comments

Comments
 (0)