feat: make coding-agent installs opt-in per project (AIDC_AGENTS) - #15
Open
ai-anant wants to merge 1 commit into
Open
feat: make coding-agent installs opt-in per project (AIDC_AGENTS)#15ai-anant wants to merge 1 commit into
ai-anant wants to merge 1 commit into
Conversation
All five agents (claude, codex, opencode, cursor-agent, grok) were baked into every image — a ~981MB layer. Tool commands now seed AIDC_AGENTS to the invoked tool so a first 'aidc claude' only installs claude; project.env can pin a list (AIDC_AGENTS=claude,codex); 'all' (the default for plain 'aidc up') keeps back-compat. Unknown agent names are skipped safely. Refs cyfinoid#8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The biggest single layer in the aidc image is the coding agents layer — 981 MB — because all five agents (
claude,codex,opencode,cursor-agent,grok) are installed unconditionally viacurl | bashin every project image. A user who only runsaidc claudestill downloads ~800 MB of agents they never invoke.This PR makes agent installs opt-in per project, mirroring the existing
AIDC_TOOLCHAINS/AIDC_SECURITY_TOOLSpattern.Changes
templates/devcontainer/Dockerfile.tmplARG AIDC_AGENTS(default: all five, back-compat) with afor agent in ... caseloop. Unknown names are skipped with a warning — safe to list an agent you don't use.all(or empty) expands to the full five-agent list.templates/devcontainer/compose.yaml.tmpl— passesAIDC_AGENTSas a build arg.lib/aidc.shrun_toolseedsAIDC_AGENTSfrom the invoked tool (e.g.aidc claude→AIDC_AGENTS=claude) before the first build, so a fresh project builds only the agent actually used. ExplicitAIDC_AGENTSin project.env / environment wins.export_compose_envdefaultsAIDC_AGENTS=allfor plainaidc up(back-compat).README.md— documents the opt-in behaviour.Expected impact
aidc claudeon a fresh repo: agent layer drops from 981 MB to ~150–200 MB (claude-only).curl | bashinstallers fetched per build.AIDC_AGENTSis unset (all five, current behaviour).Test plan
unset / all / claude / claude,codex / bogus— correct expansion + safe skipbash -n lib/aidc.sh,shellcheck -x lib/aidc.sh— clean.github/scripts/bash-compat-check.sh— passes (bash 3.2)tests/resolve-oauth-token.test.sh— 7/7 passCloses #8