Skip to content

feat: make coding-agent installs opt-in per project (AIDC_AGENTS) - #15

Open
ai-anant wants to merge 1 commit into
cyfinoid:mainfrom
ai-anant:feat/agents-opt-in
Open

feat: make coding-agent installs opt-in per project (AIDC_AGENTS)#15
ai-anant wants to merge 1 commit into
cyfinoid:mainfrom
ai-anant:feat/agents-opt-in

Conversation

@ai-anant

@ai-anant ai-anant commented Aug 2, 2026

Copy link
Copy Markdown

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 via curl | bash in every project image. A user who only runs aidc claude still downloads ~800 MB of agents they never invoke.

This PR makes agent installs opt-in per project, mirroring the existing AIDC_TOOLCHAINS / AIDC_SECURITY_TOOLS pattern.

Changes

  • templates/devcontainer/Dockerfile.tmpl
    • New ARG AIDC_AGENTS (default: all five, back-compat) with a for agent in ... case loop. 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 — passes AIDC_AGENTS as a build arg.
  • lib/aidc.sh
    • run_tool seeds AIDC_AGENTS from the invoked tool (e.g. aidc claudeAIDC_AGENTS=claude) before the first build, so a fresh project builds only the agent actually used. Explicit AIDC_AGENTS in project.env / environment wins.
    • export_compose_env defaults AIDC_AGENTS=all for plain aidc up (back-compat).
  • README.md — documents the opt-in behaviour.

Expected impact

  • aidc claude on a fresh repo: agent layer drops from 981 MB to ~150–200 MB (claude-only).
  • Smaller supply-chain surface: fewer unpinned curl | bash installers fetched per build.
  • Unchanged when AIDC_AGENTS is unset (all five, current behaviour).

Test plan

  • Simulated the Dockerfile RUN loop for unset / all / claude / claude,codex / bogus — correct expansion + safe skip
  • bash -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 pass

Closes #8

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
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.

Image size: make coding-agent installs opt-in (AIDC_AGENTS) — 981MB agent layer is the biggest chunk

1 participant