-
Notifications
You must be signed in to change notification settings - Fork 58
feat: add aider module #456
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
Conversation
…port in README.md
…ey and model configuration
…urate categorization
…values for Aider parameters
…documentation in README.md
…in README.md and tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested some changes.
Co-authored-by: M Atif Ali <[email protected]>
…oder_env's. removed deafult references in examples. Combine API Key info and add link to aider docs. Removed defaults
…g macOS installation logic for initial commit. Change icon to refer to new aider icon. Made folder variable required. Screen and Task Reporting are defaulted to true now.
… of AI providers and models - pretter
…or improved readability - prettier
…g multi-user settings in .screenrc and enhancing log file creation
…ts to include user bin directories for improved command accessibility
… reporting instructions into Aider execution
…ter and clarify task reporting instructions
…r improved task reporting and documentation
…ameter for enhanced task reporting
…nes and examples for improved clarity
…ask tracking and debugging
…d task handling and reporting
…ed readability of task reporting instructions
…quired flags and output messages
…ts for cleaner execution verification
…n the screen session
…r consistent status reporting in Aider sessions, and remove tee since it might have been interfering with the app_status
Aider does not currently have the functionality to make external MCP Calls, so task reporting is not possible until this PR gets merged for Aider: Aider-AI/aider#3937 At this point the module: I'm going to request that someone review this so we can merge it, and then I can prepare this for a module release to then push it to the registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, down the road we will need a list of allowed commands for aider as well, but this can wait.
aider/main.test.ts
Outdated
const instance = findResourceInstance(state, "coder_script"); | ||
|
||
// Check for the correct tmux condition with the interpolated value | ||
expect(instance.script.includes('if [ "true" = "true" ]')).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be possible for this string to be present with other variable combinations too?
aider/main.test.ts
Outdated
// Verify all required flags are present in the aider command | ||
expect( | ||
instance.script.includes( | ||
"aider --architect --yes-always --read CONVENTIONS.md --message", | ||
), | ||
).toBe(true); | ||
|
||
// Verify the expected message format is correct | ||
expect( | ||
instance.script.includes( | ||
'--message \\"Report each step to Coder. Your task: $CODER_MCP_AIDER_TASK_PROMPT\\"', | ||
), | ||
).toBe(true); | ||
|
||
// Verify the script creates a flag file to prevent duplicate execution | ||
expect(instance.script.includes('touch "$HOME/.aider_task_executed"')).toBe( | ||
true, | ||
); | ||
|
||
// Verify the app status slug is properly set in the screen session | ||
expect( | ||
instance.script.includes('export CODER_MCP_APP_STATUS_SLUG=\\"aider\\"'), | ||
).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we checking that the script contains these strings? Is it to prevent typos when it's edited in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will go through and remove this functionality.
I was going down a rabbit-hole when I was trying to figure out why app_status was not generating, but then later realized its because I actually need to have aider utilize the coder mcp server.
I will most likely change this to be a variable, so people can choose to pass specific options in the template rather than it being hard-coded one specific way in the module
…s on essential configurations
…suring tmux and screen are only installed if not present, and move checks for Python dependencies into Aider installation section
await execContainer(id, [ | ||
"sh", | ||
"-c", | ||
` | ||
apk add --no-cache bash | ||
mkdir -p /home/coder/bin | ||
touch /home/coder/.aider.log | ||
${extraCommands} | ||
`, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the first two elements of the array are individual command segments, and then the last one is a multi-line template literal encompassing multiple commands? Is that guaranteed to be safe?
aider/main.test.ts
Outdated
agent_id: "foo", | ||
}); | ||
|
||
// Install bash and run the script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete comments like this? I don't know if they're artifacts from AI coding, but they add a lot of extra noise when someone is reading through the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add them in when I'm writing everything, and I have rules in my cursor IDE to insert these comments for when I am reading through everything again. I realize this might be confusing and noisy for anyone else, so I will make sure to remove any unnecessary comments in the future.
aider/main.test.ts
Outdated
// Verify task reporting is mentioned | ||
expect(output.stdout).toContain( | ||
"Configuring Aider to report tasks via Coder MCP...", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to improve the test/module to make it more clear that the reporting actually exists? "Configuring" implies an incomplete action, as opposed to "configured"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im standardizing the command flags, and re-writing the tests right now so I will make sure that they are more meaningful rather than looking for the echo command. I was ultimately just making sure that the task reporting aspect of the script was triggered properly when the variable was set.
aider/main.test.ts
Outdated
// Verify all required flags are present in the aider command | ||
expect( | ||
instance.script.includes( | ||
"aider --architect --yes-always --read CONVENTIONS.md --message", | ||
), | ||
).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be refactored to
expect(instance.script).toInclude(
"aider --architect --yes-always --read CONVENTIONS.md --message",
);
…fication in main test file
…ution for Aider setup, enhancing readability and maintainability
…nhance code clarity
We are moving to https://github.com/coder/regitsry. Please move your PR there. Thanks |
This pull request introduces the
aider
module, enabling seamless integration of Aider AI pair programming into Coder workspaces. The module provides a robust and configurable setup for developers to leverage AI assistance in their coding workflows.Key Features:
screen
(default) ortmux
for maintaining Aider sessions across workspace connections.README.md
.Changes:
main.tf
to define the Aider module with Terraform resources for installation, configuration, and session management.README.md
with detailed instructions, examples, and feature descriptions.main.test.ts
to validate module functionality with comprehensive test cases.Testing:
bun test
.screen
,tmux
, task reporting).Notes: