Skip to content

BYO agents Phase 2: bbox agents add / agents init scaffolding #201

Closed

Description

@JAORMX

Follow-up to #191 (epic). Phase 1 landed declarative custom agents + bbox agents list|inspect|doctor in #200. This issue adds the remaining Phase 2 CLI for authoring a custom agent without hand-editing YAML.

Scope

  • bbox agents add NAME --image IMAGE --command CMD [--env PATTERN ...] [--memory 4g] [--cpus 4] [--egress-profile standard] [--mcp] [--mcp-authz-profile safe-tools] — appends a validated custom agent to the global config file (~/.config/broodbox/config.yaml), then runs the existing ValidateCustomAgent checks and prints the result. Refuses to overwrite a built-in or an existing custom agent unless --force.
  • bbox agents init [NAME] — writes a commented starter agents: stanza (or a standalone manifest, see #(Phase 4)) the user can fill in. Should reuse the documentation already in internal/infra/config/writer.go's default template.

Notes / constraints

  • Pure mapping (config.AgentFromOverride) and validation (config.ValidateCustomAgent) already exist from Add declarative bring-your-own agent support (#191 Phase 1) #200 — reuse them; the new code is just CLI + a config-file mutation in internal/infra/config.
  • Writing config is I/O → lives in internal/infra/config + cmd/bbox; keep the domain pure.
  • Must preserve existing comments/formatting on rewrite as much as practical (or document that it normalizes).
  • Custom agents remain global-only; agents add must never target a workspace .broodbox.yaml.

Acceptance criteria

bbox agents add aider --image ghcr.io/acme/aider-bbox:latest --command aider --env OPENAI_API_KEY --mcp
bbox agents doctor aider   # PASS
bbox aider

with no manual YAML editing.

Activity

  1. added
    enhancement
    on Jun 27, 2026
  2. added
    needs-triage
    on Jun 27, 2026
  3. HarperZ9 commented on Jun 27, 2026

    @HarperZ9

    One small acceptance-criteria suggestion from the agent-observability side: make agents add/init emit or preserve a config mutation receipt distinct from doctor pass/fail.

    Since this command takes user input and writes global config, the receipt would be useful if it captured:

    • before/after config fingerprint
    • agent name, image, command, egress profile, MCP enabled state, and MCP authz profile
    • forwarded env patterns by name only, never values
    • validator/schema version used for ValidateCustomAgent
    • writer behavior: comments preserved, normalized, or intentionally dropped
    • explicit non-effects: no workspace .broodbox.yaml mutation, no secret values read/written, no credential path widening

    Then bbox agents doctor aider --json can be the re-checkable predicate: parse config, map to domain agent, validate, resolve required env names as present/missing, and produce evidence refs that are safe to paste into an issue.

    The main risk in this class of CLI is not just a bad YAML write. It is later debugging where "this agent was added safely" becomes a self-report. A small JSON stdout receipt or local receipt file gives users something they can attach without leaking credentials.

    I am building similar receipt shapes in Project Telos for agent handoffs, so this issue jumped out. Context if useful: https://harperz9.github.io/field-guide.html

  4. JAORMX commented on Jun 28, 2026

    @JAORMX
    ContributorAuthor

    Thanks for bringing this up, it's quite useful @HarperZ9 !

  5. JAORMX commented on Jul 3, 2026

    @JAORMX
    ContributorAuthor

    Delivered in #210 (commit e9b531a), which added bbox agents add, bbox agents init, JSON mutation receipts, and comment-preserving config writes. All acceptance criteria are met:

    bbox agents add aider --image ghcr.io/acme/aider-bbox:latest --command aider --env OPENAI_API_KEY --mcp
    bbox agents doctor aider   # PASS
    bbox aider
    

    Custom agents are registered as runnable commands via registerCustomAgents (cmd/bbox/main.go:1300), so bbox <name> works for any agent added to global config. The issue didn't auto-close on merge because PR #210 referenced #201 without a closing keyword (closes/fixes/resolves). Closing now.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions