Skip to content

docs: add configuration system documentation#1207

Merged
geoffjay merged 2 commits into
issue-1198from
issue-1200
May 12, 2026
Merged

docs: add configuration system documentation#1207
geoffjay merged 2 commits into
issue-1198from
issue-1200

Conversation

@geoffjay
Copy link
Copy Markdown
Owner

Add comprehensive documentation for the agentd TOML configuration system, covering quick start, file location, three-layer precedence rules, a complete key reference table for all 40+ settings, per-service sections, four example configs (minimal, development, production, Docker), and a migration guide from env-var-only setups.

Also fixes the environment variable table in crates/common/src/config.rs which was missing entries for AGENTD_INDEX_LANGUAGES, AGENTD_RECONCILE_INTERVAL_SECS, AGENTD_NOTIFY_SERVICE_URL, AGENTD_COLLECTION_INTERVAL_SECS, and all AGENTD_MCP_*_URL variables.

Closes #1200

@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label May 12, 2026
Copy link
Copy Markdown
Owner Author

@geoffjay geoffjay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: docs: add configuration system documentation

Stack Position

This PR (issue-1200) is stacked on issue-1198 (#1206, needs-rework), which sits at the top of a blocked chain:

issue-1200 (this PR)
  └── issue-1198 (#1206) [needs-rework]
        └── issue-1197 (#1205) [needs-rework]
              └── issue-1196 (#1204) [needs-rework]
                    └── issue-1195 (#1203) [needs-rework]
                          └── issue-1199 (#1202)
                                └── issue-1194 (#1201) [needs-rework]

This PR cannot merge until the chain below it is resolved. Comments below evaluate the content in isolation.


Accuracy Check

Before reviewing content, I verified the key reference entries against the actual code on the issue-1197 branch:

  • AGENTD_ASK_ORCHESTRATOR_URL - confirmed in apply_env_overrides()
  • AGENTD_WRAP_BACKEND - confirmed ✓
  • AGENTD_ORCHESTRATOR_COMMUNICATE_URL - confirmed ✓
  • agent config show --json - --json is declared #[arg(long, global = true)] on the root Cli struct, so it can appear anywhere in the command line. Documented invocation is correct ✓
  • The 11 missing env var entries added to crates/common/src/config.rs exactly match the gap identified in the #1201 review ✓

Non-Blocking Issues

1. Migration guide is missing a renamed-variables callout

The migration guide (Step 3) instructs users to "find the corresponding TOML key in the Complete Key Reference table above". However, three commonly-used env var names were renamed when the shared config was introduced and do not appear in the key reference:

Old (service-local) New (shared config)
AGENTD_ORCHESTRATOR_URL (ask) AGENTD_ASK_ORCHESTRATOR_URL
AGENTD_BACKEND (wrap + orchestrator) AGENTD_WRAP_BACKEND / AGENTD_ORCHESTRATOR_BACKEND
AGENTD_COMMUNICATE_SERVICE_URL (orchestrator) AGENTD_ORCHESTRATOR_COMMUNICATE_URL

A user who has AGENTD_BACKEND=docker in their shell profile will follow the guide, fail to find it in the table, and be stuck. Add a brief "Renamed Variables" callout in the migration guide — even a short table like the one above is enough.

Note: the old names still work via the service-local config path (they are not being removed), but they won't appear in agent config show output or in the TOML file generated by agent config init. The guide should make that clear.

2. AGENTD_HISTORY_SIZE env var collision is undocumented

The reference table correctly maps AGENTD_HISTORY_SIZE to services.hook.history_size (default 500). However, the service-local MonitorConfig also reads AGENTD_HISTORY_SIZE for its own history_size field (metric snapshot ring-buffer, default 120). A user who sets AGENTD_HISTORY_SIZE=120 intending to configure monitor's ring buffer will inadvertently shrink hook's event history from 500 to 120 as well.

This collision is a tracked blocking issue in #1201, so the shared config table is intentionally showing only the hook mapping for now. But a one-line note in the hook row would prevent surprises:

Warning: The service-local monitor config also reads this env var for its metric snapshot ring-buffer (see #1201).

Omit the note if the collision is resolved before this PR merges.


What's Working Well

  • crates/common/src/config.rs fixes are surgically correct — exactly the 11 entries identified as missing in the #1201 review, placed in logical groupings within the existing table.
  • Quick Start section is concise and leads with the most common path (config init then config show).
  • Precedence section uses a concrete worked example (notify port at 17004 / 19004 / 29004) that makes the three-layer model immediately tangible.
  • Four example configs cover the realistic range of deployments well. The Docker example correctly uses host = "0.0.0.0" and backend = "subprocess" — exactly what trips people up in containers.
  • LanceDB path section with platform-specific paths (Linux XDG vs macOS Library) is a genuinely useful detail that would otherwise require reading source code.
  • Validation section accurately reflects the error output format from AgentdConfig::validate() including the collect-all-errors behaviour.
  • README link is placed logically between Getting Started and Features — easy to find, doesn't clutter the page.

Summary

Two non-blocking suggestions:

  1. Add a renamed-variables callout to the migration guide for AGENTD_BACKEND, AGENTD_ORCHESTRATOR_URL, and AGENTD_COMMUNICATE_SERVICE_URL
  2. Note the AGENTD_HISTORY_SIZE collision in the hook row (or omit it once #1201 resolves the collision)

The content is accurate, well-structured, and covers the right use cases. No blocking issues.

@geoffjay geoffjay removed the review-agent Used to invoke a review by an agent tracking this label label May 12, 2026
@geoffjay geoffjay linked an issue May 12, 2026 that may be closed by this pull request
7 tasks
geoffjay and others added 2 commits May 12, 2026 16:29
- Create docs/configuration.md with quick start, file location, precedence
  rules, complete key reference table, per-service sections, migration guide,
  and four example configs (minimal, development, production, Docker)
- Fix the env var table in agentd-common/config.rs to include all overrides
  (AGENTD_INDEX_LANGUAGES, AGENTD_RECONCILE_INTERVAL_SECS, all MCP URLs,
  AGENTD_NOTIFY_SERVICE_URL, AGENTD_COLLECTION_INTERVAL_SECS)
- Add link to configuration reference from README.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@geoffjay geoffjay changed the base branch from issue-1198 to issue-1198-2 May 12, 2026 23:45
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.

Add configuration system documentation

1 participant