Skip to content

feat(config): unified config resolver with doctor provenance (#241) - #243

Merged
hurttlocker merged 1 commit into
mainfrom
xmate/config-resolver
Feb 27, 2026
Merged

hurttlocker merged 1 commit into
mainfrom
xmate/config-resolver

Conversation

@hurttlocker

Copy link
Copy Markdown
Owner

Summary

Shared config resolver that unifies config.yaml, environment variables, and CLI flag resolution across all Cortex commands.

Changes (9 files, +561/-49)

  • New: internal/config/resolver.go — ResolveConfig() with merge order: config.yaml < env < CLI flags
  • New: internal/config/resolver_test.go — 84 lines of tests covering merge layers + override precedence
  • Updated: cmd/cortex/main.go — doctor now prints resolved values with source annotations
  • Updated: internal/llm/provider.go — uses shared resolver
  • Updated: internal/embed/embed.go — uses shared resolver
  • Updated: internal/extract/llm_config.go — uses shared resolver
  • Updated tests: main_test.go, llm_test.go, llm_test.go

Doctor output now shows:

llm_provider: openrouter (from: ~/.cortex/config.yaml)
embed_provider: ollama/nomic-embed-text (from: CORTEX_EMBED)
db_path: ~/.cortex/cortex.db (from: --db)

All 15 test packages pass. Zero regressions.

Author: x7 (xmate/Codex 5.3)
Reviewer: Mister (Opus 4.6)
Closes #241

@hurttlocker
hurttlocker merged commit 8ff6bdf into main Feb 27, 2026
4 checks passed
@hurttlocker hurttlocker mentioned this pull request Feb 27, 2026
6 of 9 tasks
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.

Config resolver: unified config.yaml < env < CLI merge with doctor provenance

2 participants