Skip to content

Fix AI agent modules to use coder_env instead of coder_agent env #159

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jun 24, 2025

Fixes #128

This PR updates AI coding modules to use the coder_env resource for setting environment variables instead of recommending users set them on the coder_agent resource.

Changes Made

Updated Modules:

  • aider: Added coder_env resource for AI provider API keys, removed export commands from shell scripts
  • claude-code: Added variables and coder_env resources for API key and prompts, updated documentation
  • goose: Added variables and coder_env resources for prompts and API key, updated documentation

Documentation Updates:

  • Removed examples showing environment variables set on coder_agent resource
  • Added examples showing how to use the new module variables
  • Updated README files to reflect the cleaner approach

Benefits

Reduced cognitive load: Users no longer need to manually configure environment variables on coder_agent
Cleaner approach: Environment variables are managed within the modules themselves
Consistent pattern: All AI modules now follow the same pattern for environment variable management
Better encapsulation: Module internals are hidden from users

Testing

  • ✅ Terraform syntax validation passed for all modules
  • ✅ Terraform formatting check passed
  • ✅ All modules validate successfully with terraform validate

@DevelopmentCats

This change addresses issue #128 by updating AI coding modules to use the
coder_env resource for setting environment variables instead of recommending
users set them on the coder_agent resource.

Changes made:
- Updated aider module to use coder_env for AI provider API keys
- Updated claude-code module to add variables and coder_env resources for API key and prompts
- Updated goose module to add variables and coder_env resources for prompts and API key
- Updated documentation in README files to show the new approach
- Removed export commands from shell scripts since env vars are now set by coder_env

This reduces cognitive load for users and provides a cleaner, more consistent
approach to environment variable management in AI modules.

Co-authored-by: DevelopmentCats <176868952+DevelopmentCats@users.noreply.github.com>
@DevelopmentCats
Copy link
Contributor

Fixes #128

This PR updates AI coding modules to use the coder_env resource for setting environment variables instead of recommending users set them on the coder_agent resource.

Changes Made

Updated Modules:

  • aider: Added coder_env resource for AI provider API keys, removed export commands from shell scripts
  • claude-code: Added variables and coder_env resources for API key and prompts, updated documentation
  • goose: Added variables and coder_env resources for prompts and API key, updated documentation

Documentation Updates:

  • Removed examples showing environment variables set on coder_agent resource
  • Added examples showing how to use the new module variables
  • Updated README files to reflect the cleaner approach

Benefits

Reduced cognitive load: Users no longer need to manually configure environment variables on coder_agentCleaner approach: Environment variables are managed within the modules themselves ✅ Consistent pattern: All AI modules now follow the same pattern for environment variable management ✅ Better encapsulation: Module internals are hidden from users

Testing

  • ✅ Terraform syntax validation passed for all modules
  • ✅ Terraform formatting check passed
  • ✅ All modules validate successfully with terraform validate

@DevelopmentCats

Can you Make sure to update the tests for each module changed to make sure that the change to using coder env resources matches up with what we are testing.

Afterwards run bun fmt and then make sure to update the versions using the version bump script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI Agent Modules: Switch to coder_env instead of recommending config on the coder_agent
1 participant