Add MCP doctor for deterministic parameter resolution - #16
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 094a52490b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| default_tags: Optional override for which tags represent defaults. | ||
| """ | ||
|
|
||
| tags = default_tags or DEFAULT_TAGS |
There was a problem hiding this comment.
Honor explicit empty default_tags override
When callers pass an empty set to default_tags to disable tagged-default preference, tags = default_tags or DEFAULT_TAGS treats the empty set as falsy and silently falls back to DEFAULT_TAGS. This makes it impossible to opt out of tagged defaults, and the resolution will still prefer tagged candidates even though the API suggests the override should be honored. Use an explicit if default_tags is None check so set() is respected.
Useful? React with 👍 / 👎.
Motivation
ctx_patchand human-readable explanations.Description
hc_agentandhc_agent/mcpand introducehc_agent/mcp/doctor.pyimplementing the resolution logic.CandidateandResolutiondataclasses to represent candidate items and resolution results._coerce_candidateand_stable_keyand the main APIresolve_missing_parameterswhich takesctx,missing, andlist_callsand returns aResolution.apply_ctx_patchto apply returned patches and useDEFAULT_TAGS(which can be overridden) to prefer tagged defaults before applying a stable tie-break.Testing
Codex Task