Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6f2b128
Aider module support agentAPI
Harsh9485 Aug 21, 2025
3679fc0
Fix some small issues
Harsh9485 Aug 22, 2025
d95e715
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Aug 22, 2025
ef16196
Fix typos
Harsh9485 Aug 23, 2025
0ae492c
Merge branch 'aider-tasks-agentapi-support' of github.com:Harsh9485/r…
Harsh9485 Aug 23, 2025
9d74616
Add aider mock script
Harsh9485 Aug 23, 2025
8696a00
Fix README file style
Harsh9485 Aug 23, 2025
585723b
Fix main.test file
Harsh9485 Aug 23, 2025
9fd083d
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Aug 23, 2025
e9d3470
Fix README file
Harsh9485 Aug 23, 2025
2719a26
Merge branch 'aider-tasks-agentapi-support' of github.com:Harsh9485/r…
Harsh9485 Aug 23, 2025
b0826cc
Update start script
Harsh9485 Aug 23, 2025
1a8971a
Add MCP server configuration
Harsh9485 Aug 24, 2025
4428d8c
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Aug 24, 2025
2e40967
Update main.tf file
Harsh9485 Aug 24, 2025
2f1edb1
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Aug 27, 2025
478b4b6
Fix some typos
Harsh9485 Aug 28, 2025
78b9ebd
Fix Code style issues
Harsh9485 Aug 28, 2025
da3c310
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Aug 28, 2025
8dec903
Adapt all suggestions
Harsh9485 Sep 3, 2025
b464a71
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Sep 3, 2025
d2730cb
Adjust test suite according to update
Harsh9485 Sep 3, 2025
2cea9e8
Merge branch 'aider-tasks-agentapi-support' of github.com:Harsh9485/r…
Harsh9485 Sep 3, 2025
4ad30f7
Adapt Suggestions
Harsh9485 Sep 4, 2025
8985231
Fix Typos
Harsh9485 Sep 4, 2025
aafc932
prototype module
Harsh9485 Sep 5, 2025
fef659e
revert changes
Harsh9485 Sep 10, 2025
79e2fdd
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Sep 10, 2025
79ae316
Refactor Aider module
Harsh9485 Sep 11, 2025
ddef094
Merge branch 'main' into aider-tasks-agentapi-support
Harsh9485 Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some small issues
  • Loading branch information
Harsh9485 committed Aug 22, 2025
commit 3679fc0e043294b4675ebf09145df1e255223c7c
22 changes: 12 additions & 10 deletions registry/coder/modules/aider/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const setup = async (props?: SetupProps): Promise<{ id: string }> => {
moduleVariables: {
install_sourcegraph_amp: props?.skipAmpMock ? "true" : "false",
install_agentapi: props?.skipAgentAPIMock ? "true" : "false",
sourcegraph_amp_model: "test-model",
aider_model: "test-model",
...props?.moduleVariables,
},
registerCleanup,
Expand All @@ -66,7 +66,7 @@ const setup = async (props?: SetupProps): Promise<{ id: string }> => {
return { id };
};

setDefaultTimeout(60 * 1000);
setDefaultTimeout(60 * 5000);

describe("Aider", async () => {
beforeAll(async () => {
Expand Down Expand Up @@ -112,8 +112,8 @@ describe("Aider", async () => {
test("pre-post-install-scripts", async () => {
const { id } = await setup({
moduleVariables: {
pre_install_script: "#!/bin/bash\necho 'pre-install-script'",
post_install_script: "#!/bin/bash\necho 'post-install-script'",
experiment_pre_install_script: "#!/bin/bash\necho 'pre-install-script'",
experiment_post_install_script: "#!/bin/bash\necho 'post-install-script'",
},
});
await execModuleScript(id);
Expand All @@ -130,23 +130,25 @@ describe("Aider", async () => {
});

test("system-prompt", async () => {
const prompt = "this is a system prompt for AMP";
const { id } = await setup();
await execModuleScript(id, {
SOURCEGRAPH_AMP_SYSTEM_PROMPT: prompt,
const system_prompt = "this is a system prompt for AMP";
const { id } = await setup({
moduleVariables: {
system_prompt,
},
});
await execModuleScript(id)
const resp = await readFileContainer(
id,
"/home/coder/.aider-module/SYSTEM_PROMPT.md",
);
expect(resp).toContain(prompt);
expect(resp).toContain(system_prompt);
});

test("task-prompt", async () => {
const prompt = "this is a task prompt for AMP";
const { id } = await setup();
await execModuleScript(id, {
SOURCEGRAPH_AMP_TASK_PROMPT: prompt,
AIDER_TASK_PROMPT: prompt,
});
const resp = await readFileContainer(
id,
Expand Down
19 changes: 19 additions & 0 deletions registry/coder/modules/aider/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ variable "task_prompt" {
description = "Task prompt to use with Aider"
default = ""
}
resource "coder_env" "task_prompt" {
agent_id = var.agent_id
name = "AIDER_TASK_PROMPT"
value = var.task_prompt
}

variable "aider_prompt" {
type = bool
description = "This prompt will be sent to Aider and should run only once, and AgentAPI will be disabled."
default = false
}

variable "experiment_pre_install_script" {
type = string
Expand Down Expand Up @@ -129,6 +140,12 @@ variable "ai_api_key" {
sensitive = true
}

resource "coder_env" "ai_api_key" {
agent_id = var.agent_id
name = "ARG_API_KEY"
value = var.ai_api_key
}

variable "custom_env_var_name" {
type = string
description = "Custom environment variable name when using custom provider"
Expand Down Expand Up @@ -232,11 +249,13 @@ module "agentapi" {

echo -n '${base64encode(local.start_script)}' | base64 -d > /tmp/start.sh
chmod +x /tmp/start.sh
AIDER_START_DIRECTORY='${var.folder}' \
ARG_API_KEY='${var.ai_api_key}' \
ARG_AI_MODULE='${var.ai_model}' \
ARG_AI_PROVIDER='${var.ai_provider}' \
ARG_ENV_API_NAME_HOLDER='${local.env_var_name}' \
AIDER_TASK_PROMPT='${var.task_prompt}' \
AIDER_PROMPT='${var.aider_prompt}' \
/tmp/start.sh
EOT

Expand Down
24 changes: 14 additions & 10 deletions registry/coder/modules/aider/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ echo "Workspace: $AIDER_START_DIRECTORY"
echo "--------------------------------"

function install_aider() {
echo "Installing pipx via apt-get..."

sudo apt-get update -y
sudo apt-get install -y pipx
pipx ensurepath
echo "checking pipx installed..."
if ! command_exists pipx; then
echo "pipx not found"
echo "Installing pipx via apt-get..."
sudo apt-get update -y
sudo apt-get install -y pipx
echo "pipx installed!"
fi
pipx ensurepath
echo $PATH
mkdir -p "$AIDER_START_DIRECTORY/.local/bin"
export PATH="$HOME/.local/bin:$AIDER_START_DIRECTORY/.local/bin:$PATH" # ensure in current shell too
echo "pipx installed!"


echo "Installing Aider via pipx..."
pipx install --force aider-install
aider-install
if ! command_exists aider; then
echo "Installing Aider via pipx..."
pipx install --force aider-install
aider-install
fi
echo "Aider installed: $(aider --version || echo 'check failed the Aider module insatllation failed')"
}

Expand Down
8 changes: 5 additions & 3 deletions registry/coder/modules/aider/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ else
fi




if [ -n "${AIDER_TASK_PROMPT:-}" ]; then
if [ "${AIDER_PROMPT}" == "true" ]; then
printf "Adier start only with this prompt : $AIDER_PROMPT"
mkdir -p $HOME/.aider-module/aider_output.txt
echo aider --model $ARG_AI_MODULE --message "$AIDER_PROMPT" > $AIDER_START_DIRECTORY/.aider-module/aider_output.txt
elif [ -n "${AIDER_TASK_PROMPT:-}" ]; then
printf "Aider task prompt provided : $AIDER_TASK_PROMPT"
PROMPT="Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $AIDER_TASK_PROMPT"

Expand Down
Loading