Skip to content

Zero-config startup (Phase 0.7)#75

Merged
mattleaverton merged 7 commits intodanshapiro:mainfrom
mattleaverton:impl/zero-config
Apr 1, 2026
Merged

Zero-config startup (Phase 0.7)#75
mattleaverton merged 7 commits intodanshapiro:mainfrom
mattleaverton:impl/zero-config

Conversation

@mattleaverton
Copy link
Copy Markdown
Collaborator

Summary

  • --config is now optionalkilroy attractor run --graph pipeline.dot works with no config file
  • Providers auto-detected from environment — scans builtin provider specs for API keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.) and prefers CLI backend when the binary is on PATH
  • Model catalog optional — falls back to embedded catalog when no modeldb.openrouter_model_info_path configured
  • CXDB already skips silently when config fields are empty (no --no-cxdb needed)

Changes

  • internal/attractor/engine/config.go — make modeldb.openrouter_model_info_path validation conditional
  • internal/attractor/engine/run_with_config.go — fall back to embedded catalog when no catalog path configured
  • internal/attractor/engine/autodetect.go — provider auto-detection from env vars + PATH
  • internal/attractor/engine/config_defaults.goDefaultRunConfig() builds config from CWD
  • cmd/kilroy/main.go--config optional, loadOrBuildConfig helper, updated usage
  • cmd/kilroy/detach_paths.go — config path optional in detach mode

Known rough edges (not blocking)

  • GOOGLE_API_KEY fallback is hardcoded in autodetect rather than in providerspec schema
  • CLI headless warning fires for auto-detected CLI providers (friction for zero-config)
  • No cmd-layer integration test for loadOrBuildConfig (engine-level is tested)

Test plan

  • go build ./... — clean compile
  • go test ./internal/attractor/engine/... — full suite passes (219s)
  • TestToolGraph_ZeroConfig — tool-command graph with no catalog, no CXDB, no DisableCXDB flag
  • TestDetectProviders_* — unit tests for env scanning, CLI preference, Google fallback, no-keys case
  • TestApplyDetectedProviders_DoesNotOverwrite — existing config preserved
  • Manual: kilroy attractor run --graph test.dot from a git repo with ANTHROPIC_API_KEY set, no --config, no --no-cxdb

🤖 Generated with Claude Code

mattleaverton and others added 7 commits April 1, 2026 11:06
When modeldb.openrouter_model_info_path is not configured, skip catalog
path validation and fall back to the embedded catalog at bootstrap time.
This enables running without a config file while still getting model ID
validation from the pinned catalog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scan builtin provider specs for API keys in the environment. For
providers with a CLI spec, prefer the CLI backend when the binary
is on PATH. Includes unit tests for detection logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Constructs a RunConfigFile from CWD (must be a git repo) with version 1,
real CLI profile, and empty ModelDB/CXDB sections. The bootstrap path
already handles empty ModelDB by falling back to the embedded catalog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When --config is not provided, build a default config from CWD (must be
a git repo), auto-detect providers from environment, and validate that
graph provider requirements are met. Log detected providers to stderr.
Detach mode also works without --config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs a tool-command-only graph with no model catalog configured,
verifying the zero-config path through bootstrap with embedded
catalog fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Graph provider validation already happens in bootstrapRunWithConfig
(lines 185-189) during the normal run path. The separate
ValidateGraphProviders was a redundant second graph parse. Let
bootstrap handle it — it produces better errors with full context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CXDB is already skipped when config fields are empty — the bootstrap
checks cxdbConfigured before attempting startup. Verified both in
test and manual run without --no-cxdb.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mattleaverton mattleaverton merged commit 02efa09 into danshapiro:main Apr 1, 2026
1 check failed
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.

1 participant