feat(cli): add doctor command for configuration validation#100
Open
garethpaul wants to merge 5 commits intomainfrom
Open
feat(cli): add doctor command for configuration validation#100garethpaul wants to merge 5 commits intomainfrom
garethpaul wants to merge 5 commits intomainfrom
Conversation
Adds `poe-code doctor [agent]` to validate the full configuration stack — system dirs, config integrity, API key, and per-agent binary, config probe, and model checks. All agent checks are derived from provider config with zero provider branching. - System checks: home dir exists, config.json valid, no corruption backups - Auth checks: API key present, API key valid (HTTP) - Agent checks: binary exists, config probe, model configured - Sequential execution with dependency skipping - SDK exports: collectChecks, runChecks, DoctorResult types - 42 unit tests across 6 test files
Address code review feedback: - Rename to accurately reflect what the check does (validates service existence in configured_services, not model value) - Use ScopedLogger type instead of inline shape in logCheckResult - Provide proper previousResults map in run.test.ts stub context
Add MCP config validation derived from agent-mcp-config package: - mcpConfigValidCheck: validates MCP config file exists and parses - mcpCommandExistsCheck: verifies MCP server command binary on PATH - Automatically discovers MCP config paths per agent - Export AgentMcpConfig type and resolveConfigPath from agent-mcp-config
Verify doctor command in Docker container: - System and auth checks run without configured agents - Agent checks appear after configure - Agent filtering works with positional argument - Help text displays correctly
- Fix homeDirCheck description: "Home directory writable" → "Home directory exists" - Remove dead mcpCommandExistsCheck (not wired into collectChecks) - Add proper TOML parsing via smol-toml instead of just checking non-empty - Warn when agent argument doesn't match any known provider - Align TOML validation with JSON: check configKey presence, report parse errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
poe-code doctor [agent]command that validates the full configuration stack — system directories, config integrity, API keys, agent binaries, config probes, and MCP config filessmol-tomlcollectChecks,runChecks, and all types fromsrc/index.tsCheck categories
New files (20)
src/sdk/doctor/— types, checks (system/auth/agent/mcp), collector, runner, indexsrc/cli/commands/doctor.ts— CLI command + output formattinge2e/doctor.test.ts— E2E tests in DockerTest plan
doctor,doctor --help)