# CLI-066 Tasks — Env-var-only zero-config startup

Spec: `.agents/spec-docs/active/CLI-066-env-key-zero-config-startup.md`

- [x] T1 (TC-01): agent-framework — env-default synthesis in provider resolution: no settings profile + `ANTHROPIC_API_KEY` set → anthropic config from definition defaults, `source: 'env-default'`, key stays a `$ENV:` reference
- [x] T2 (TC-02): priority — multiple synthesizable env keys set (`ANTHROPIC_API_KEY` + `GEMINI_API_KEY`) → anthropic wins (definition order)
- [x] T3 (TC-03): settings profile present + env key set → profile wins (regression)
- [x] T4 (TC-04): no profile + no recognized env key → `ProviderConfigError` unchanged (regression)
- [x] T5 (TC-05): exclusion rule — gemma (literal non-`$ENV:` apiKey) and openai (no default model) never synthesize even with env vars set; qwen/deepseek synthesize from their complete defaults (incl. baseURL)
- [x] T6 (TC-06): agent-cli — startup notice printed exactly once when running on an env-synthesized config, naming provider/model/env var, never the key value
- [x] T7 (TC-07): SPEC sync — framework resolution order (settings → env-default → error) + CLI startup contract
- [x] T8: build/typecheck/lint/test green; PR to develop; backlog CLI-066 evidence recording

## Test Plan

Authoritative TC table lives in the spec document (`.agents/spec-docs/active/CLI-066-env-key-zero-config-startup.md` § Test Plan).
Summary: unit tests in agent-framework on the resolution function with an injected env map (no stubEnv — worker-thread gotcha): synthesis, priority order, profile-wins, no-key error, exclusion rules; integration test in agent-cli capturing the stderr notice on an env-synthesized run. Verification: `pnpm --filter @robota-sdk/agent-framework --filter @robota-sdk/agent-cli test` plus workspace typecheck/lint.
