Skip to content

Commit 8dec903

Browse files
committed
Adapt all suggestions
1 parent da3c310 commit 8dec903

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

registry/coder/modules/aider/README.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,22 @@ Run [Aider](https://aider.chat) AI pair programming in your workspace. This modu
1212

1313
```tf
1414
module "aider" {
15-
source = "registry.coder.com/coder/aider/coder"
16-
version = "1.0.0"
17-
agent_id = coder_agent.example.id
18-
ai_api_key = var.api_key
19-
install_aider = true
20-
ai_provider = "google"
21-
ai_model = "gemini"
22-
install_agentapi = true
15+
source = "registry.coder.com/coder/aider/coder"
16+
version = "1.0.0"
17+
agent_id = coder_agent.example.id
18+
ai_api_key = var.api_key
19+
ai_provider = "google"
20+
ai_model = "gemini"
2321
}
2422
```
2523

2624
## Prerequisites
2725

28-
- Include the [Coder Login](https://registry.coder.com/modules/coder-login/coder) module in your template
2926
- pipx is automatically installed if not already available
3027

3128
## Usage Example
3229

3330
```tf
34-
data "coder_parameter" "ai_prompt" {
35-
name = "AI Prompt"
36-
description = "Write an initial prompt for Aider to work on."
37-
type = "string"
38-
default = ""
39-
mutable = true
40-
41-
}
42-
4331
variable "gemini_api_key" {
4432
type = string
4533
description = "Gemini API key"
@@ -55,7 +43,6 @@ module "aider" {
5543
ai_provider = "google"
5644
ai_model = "gemini"
5745
install_agentapi = true
58-
task_prompt = data.coder_parameter.ai_prompt.value
5946
system_prompt = "..."
6047
}
6148
```
@@ -105,7 +92,7 @@ For a complete and up-to-date list of supported aliases and models, please refer
10592
- If AgentAPI fails to start, verify that your container has network access and executable permissions for the scripts
10693

10794
> [!IMPORTANT]
108-
> For using **Coder Tasks** with Aider, make sure to pass the `AI Prompt` parameter and set `ai_api_key`.
95+
> To use **Coder Tasks** with Aider, make sure to set `ai_api_key`.
10996
> This ensures task reporting and status updates work seamlessly.
11097
11198
## References

registry/coder/modules/aider/main.tf

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ variable "system_prompt" {
7676
EOT
7777
}
7878

79-
variable "task_prompt" {
80-
type = string
81-
description = "Task prompt to use with Aider"
82-
default = ""
83-
}
84-
8579
variable "aider_prompt" {
8680
type = bool
8781
description = "This prompt will be sent to Aider and should run only once, and AgentAPI will be disabled."
@@ -119,7 +113,6 @@ variable "ai_provider" {
119113
variable "ai_model" {
120114
type = string
121115
description = "AI model to use with Aider. Can use Aider's built-in aliases like '4o' (gpt-4o), 'sonnet' (claude-3-7-sonnet), 'opus' (claude-3-opus), etc."
122-
default = "gemini"
123116
}
124117

125118
variable "ai_api_key" {
@@ -144,7 +137,22 @@ variable "install_agentapi" {
144137
variable "agentapi_version" {
145138
type = string
146139
description = "The version of AgentAPI to install."
147-
default = "v0.3.0"
140+
default = "v0.6.3"
141+
}
142+
143+
data "coder_parameter" "ai_prompt" {
144+
name = "AI Prompt"
145+
description = "Write an initial prompt for Aider to work on."
146+
type = "string"
147+
default = ""
148+
mutable = true
149+
150+
}
151+
152+
resource "coder_env" "ai_prompt" {
153+
agent_id = var.agent_id
154+
name = "ARG_TASK_PROMPT"
155+
value = data.coder_parameter.ai_prompt.value
148156
}
149157

150158
variable "base_aider_config" {
@@ -265,7 +273,6 @@ module "agentapi" {
265273
ARG_AI_MODULE='${var.ai_model}' \
266274
ARG_AI_PROVIDER='${var.ai_provider}' \
267275
ARG_ENV_API_NAME_HOLDER='${local.env_var_name}' \
268-
ARG_TASK_PROMPT='${base64encode(var.task_prompt)}' \
269276
AIDER_PROMPT='${var.aider_prompt}' \
270277
/tmp/start.sh
271278
EOT

0 commit comments

Comments
 (0)