Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Aider module support agentAPI #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Harsh9485 wants to merge 30 commits into coder:main
base: main
Choose a base branch
Loading
from Harsh9485:aider-tasks-agentapi-support

Conversation

Copy link
Contributor

@Harsh9485 Harsh9485 commented Aug 21, 2025
edited
Loading

Closes #239

/claim #239

Description

video :- https://www.loom.com/share/d1d1d54d48bc45c4a48271ca9a387a88?sid=933e250d-78f8-4a7f-9745-0e908c0ee4d9

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/aider
New version: v1.0.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related Issues

Copy link
Contributor Author

@matifali @DevelopmentCats, most of the module works fine, but now I’m implementing MCP configuration and task prompts with active chatting.

Screenshot 2025年08月21日 202353

The --message flag disables chat mode, runs only the prompt, and then exits the program. I’m trying to find a way to keep chat mode running inside the module.

Copy link
Member

@Harsh9485, I think we should run in chat mode using AgentAPI by default, but provide the option to use message mode and disable AgentAPI (i.e., Coder Tasks) integration if a user wants to run in that mode.

Copy link
Contributor Author

@Harsh9485, I think we should run in chat mode using AgentAPI by default, but provide the option to use message mode and disable AgentAPI (i.e., Coder Tasks) integration if a user wants to run in that mode.

So should I give the user three options:
1 Empty prompt (works fine),
2 Task prompt,
3 Run the Aider module with a task prompt (runs only once and disables AgentAPI)

matifali reacted with thumbs up emoji

Copy link
Member

So should I give the user three options:
1 Empty prompt (works fine),
2 Task prompt,
3 Run the Aider module with a task prompt (runs only once and disables AgentAPI)

Yes @Harsh9485

Copy link
Contributor Author

@matifali, unfortunately we can’t run interactive mode with the --message flag. What should I do now?

Copy link
Contributor Author

@matifali @DevelopmentCats. PR ready to review.

Copy link
Contributor Author

@matifali @DevelopmentCats, I have added the MCP server configuration.

DevelopmentCats reacted with eyes emoji

Copy link
Contributor Author

@matifali @DevelopmentCats, let me know if you need any changes in the code.

@@ -138,7 +119,7 @@ variable "ai_provider" {
variable "ai_model" {
type = string
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."
default = "sonnet"
default = "gemini"
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not choose a default and make this a required parameter.

variable "agentapi_version" {
type = string
description = "The version of AgentAPI to install."
default = "v0.3.0"
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default = "v0.3.0"
default = "v0.6.3"

Latest as per today

Comment on lines 19 to 22
install_aider = true
ai_provider = "google"
ai_model = "gemini"
install_agentapi = true
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
install_aider = true
ai_provider = "google"
ai_model = "gemini"
install_agentapi = true
ai_provider = "google"
ai_model = "gemini"

Leave out the optional inputs from the first example

- **Project Integration**: Works with any project directory, including Git repositories
- **Browser UI**: Use Aider in your browser with a modern web interface instead of the terminal
- **Non-Interactive Mode**: Automatically processes tasks when provided via the `task_prompt` variable
- Include the [Coder Login](https://registry.coder.com/modules/coder-login/coder) module in your template
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Include the [Coder Login](https://registry.coder.com/modules/coder-login/coder) module in your template

No longer needed

Comment on lines +34 to +39
data "coder_parameter" "ai_prompt" {
name = "AI Prompt"
description = "Write an initial prompt for Aider to work on."
type = "string"
default = ""
mutable = true
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L'et''s move this into the module source.

ai_provider = "google"
ai_model = "gemini"
install_agentapi = true
task_prompt = data.coder_parameter.ai_prompt.value
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still keep this to let admins provide a default prompt.

Copy link
Contributor Author

@Harsh9485 Harsh9485 Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line of code: task_prompt = data.coder_parameter.ai_prompt.value because I moved ai_prompt into the module source.
Moving ai_prompt into the module source is a good idea, since it removes the need for users to manually set it

Copy link
Member

@matifali matifali Sep 4, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add input to disable agentAPI and coder tasks altogether? Like a mode that only installs the agent. I am looking for something like.

  1. Refactor to support Coder Tasks with AgentAPI with "AI Prompt" included
  2. An install-only mode without running or starting the task also skips AgentAPI installation.

Copy link
Contributor Author

@Harsh9485 Harsh9485 Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matifali, I have a better idea. We won’t modify this Aider module, so it will fulfill the requirement: An install-only mode without running or starting the task also skips AgentAPI installation.

Instead, I’ll create a new PR to add Aider_CLI with this code. That will fulfill the requirement: Refactor to support Coder Tasks with AgentAPI with ‘AI Prompt’ included.

I’ll also move this code into the coder-labs folder, since all modules in this folder support AgentAPI. This way, both requirements will be fulfilled

Copy link
Member

@matifali matifali Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not break this into 2 modules. It will be too much to maintain.

Harsh9485 reacted with thumbs up emoji
Copy link
Contributor Author

@Harsh9485 Harsh9485 Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan is :-

  • I'll create input variable in module toso the user can choose whether they want to use with agentapi + Task or not, and What would be a good name for this variable?
  • If I implement this, it makes sense to remove the install_agentapi variable and instead set the value dynamically based on the condition.
    variable "install_agentapi" {
    type = bool
    description = "Whether to install AgentAPI."
    default = true
    }
  • If the user decides not to use these, then we should give them a CLI Aider agent, similar to what this module currently provides.

Copy link
Member

@matifali matifali Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes instead use a new varibale named use_tasks = true default value is true

Comment on lines 107 to 109
> [!IMPORTANT]
> For using **Coder Tasks** with Aider, make sure to pass the `AI Prompt` parameter and set `ai_api_key`.
> This ensures task reporting and status updates work seamlessly.
Copy link
Member

@matifali matifali Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can eb removed if we move AI Prompt into the module.

Copy link
Contributor Author

hey @matifali
Not feeling well, but I made some changes based on your suggestions. It’s just a prototype for now, I’ll keep working on it and test it. Would be awesome if you could check it.

Copy link
Member

matifali commented Sep 5, 2025

@Harsh9485 while refactoring Claude code module, we ran into an issue where it was not possible to conditionally disable the Coder Tasks e.g. "AI Prompt" needs to exist.
Lets revist this next week. Thanks for all your work

Harsh9485 reacted with thumbs up emoji

Copy link
Contributor Author

@Harsh9485 while refactoring Claude code module, we ran into an issue where it was not possible to conditionally disable the Coder Tasks e.g. "AI Prompt" needs to exist. Lets revist this next week. Thanks for all your work

@matifali, what if we implement my earlier idea? We could create a new 'Aider CLI' module for the Coder Tasks instead of modifying the existing one. I believe this would solve the problem and meet your requirement.

Copy link
Contributor Author

Hey @matifali, could you let me know what the current plan is? I'd like to start working on it and just want to make sure the plan is still the same.

Can we also add input to disable agentAPI and coder tasks altogether? Like a mode that only installs the agent. I am looking for something like.
1.Refactor to support Coder Tasks with AgentAPI with "AI Prompt" included
2.An install-only mode without running or starting the task also skips AgentAPI installation.

Copy link
Member

matifali commented Sep 9, 2025

Hi @Harsh9485 leta revert these changes as currently there is no clean way to dual-purpose the module. I will also ask @35C4n0r to guide you as they are refactoring the Claude Code module.

Copy link
Contributor Author

Hey @matifali and @35C4n0r, I reverted the changes, but I left your suggestion changes in place. Let me know when you've had a chance to look at it.

Copy link
Contributor Author

I'm refactoring the aider module now.

Copy link
Contributor Author

I'll refactor the MCP part shortly.

coder_mcp = <<-EOT
coder:
args:
- exp
- mcp
- server
cmd: coder
description: Report ALL tasks and statuses (in progress, done, failed) you are working on.
enabled: true
envs:
- CODER_MCP_APP_STATUS_SLUG: aider
- CODER_MCP_AI_AGENTAPI_URL: "http://localhost:3284"
name: Coder
timeout: 3000
type: stdio
developer:
display_name: Developer
enabled: true
name: developer
timeout: 300
type: builtin
EOT

Copy link
Contributor Author

hey @matifali @DevelopmentCats,
I wanted to let you know that the Aider agent doesn't support using a Task prompt with interacting mode. When we pass one, the module just runs the prompt and exits. We also can't get the agent's response because it disappears upon exit.

if [ -n "${ARG_AI_PROMPT:-}" ]; then
printf "Aider task prompt provided : $ARG_AI_PROMPT"
PROMPT="Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $ARG_AI_PROMPT"
agentapi server --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always --message "$ARG_AI_PROMPT"

Copy link
Contributor Author

Hey @matifali, I commented out the code you suggested for choosing between the two agents. I think we're dropping that plan now, so I'll remove it soon.

# if [[ "${AIDER_PROMPT}" == "true" && -n "${ARG_AI_PROMPT:-}" ]]; then
# printf "Aider start only with this prompt : $ARG_AI_PROMPT"
# mkdir -p $HOME/.aider-module/
# echo aider --model $ARG_MODEL --yes-always --message "$ARG_AI_PROMPT" > $HOME/.aider-module/aider_output.txt

Copy link
Contributor Author

The Aider agent doesn't have native support for MCP configuration. Is it okay if I use third-party software? and please let me know what should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@matifali matifali matifali requested changes

@DevelopmentCats DevelopmentCats Awaiting requested review from DevelopmentCats

@35C4n0r 35C4n0r Awaiting requested review from 35C4n0r

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Aider Module: Tasks+AgentAPI Support

AltStyle によって変換されたページ (->オリジナル) /