Repository navigation
feat(doctor): diagnose an unsupported Claude plugin/runtime pairing (#729, slice 3) - #916
Conversation
…729, slice 3) The Claude plugin runs the mcp_server package of its own directory (scripts/launcher.py puts CLAUDE_PLUGIN_ROOT first on the import path), so a supported pairing is: mcp_server imported from $CLAUDE_PLUGIN_ROOT/mcp_server, and .claude-plugin/plugin.json declaring that code's version (installed wheel, else pyproject.toml). The new optional doctor check fails on either mismatch and names it; without CLAUDE_PLUGIN_ROOT it passes and says no plugin launched the process. The Codex runtime already checks its pairing at launch (runtime.py installed_python). Refs #729 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYs18rVW23Ta85PHji4
The ADR-1122 diff mutation gate left 33 survivors in doctor_pairing: the tests checked neither the check's name, optional flag nor fix text, nor a version that is an empty string or not a string, nor a [project] that is not a table. The tests now pin each. The manifest is read as bytes (json decodes UTF-8 itself, RFC 8259 section 8.1) and pyproject through tomllib.load on a binary file, which removes the encoding argument whose mutants no test can tell apart. Refs #729 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYs18rVW23Ta85PHji4
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 2m 24s —— View job PR review #916 (review 1 of 3)
I found no Blockers. There are three Notes, none needing action before merge:
I did not run the tests: the sandbox blocked fetching Verdict: approve |
Review 1 of 3 (ADR-1119), commit edce2d7I found no Blockers. The five reviews (code quality, security, performance, test coverage, docs accuracy) traced the following:
Notes, no action before merge
Verdict: approve |
|
Réponse aux trois notes de la revue 1 (aucune n'est bloquante, donc pas de push pour elles seules) :
Generated by Claude Code |
Summary
Refs #729 (tranche 3 : « définir les paires plugin/runtime supportées et diagnostiquer une paire non supportée », tranche restante n° 2 du commentaire du 2026-11-06). Tranches restantes listées sur l'issue.
Cause racine. Le plugin Claude n'épingle pas de runtime par version :
scripts/launcher.py(_resolve_paths,_set_import_paths) place$CLAUDE_PLUGIN_ROOTen tête desys.pathet dePYTHONPATH, donc le code exécuté est le paquetmcp_serverde ce répertoire. Rien ne vérifiait que le processus importe bien ce paquet-là, ni que.claude-plugin/plugin.jsondéclare la version du code qu'il lance. Un correctif publié dans la version du plugin ne pouvait donc pas être attribué au code en cours d'exécution. Côté Codex,runtime.py installed_pythonvérifie déjà la paire au lancement.Correctif. Nouveau check doctor optionnel
Plugin/runtime pairing(mcp_server/doctor_pairing.py), présent dans les deux listes (PostgreSQL et SQLite) :CLAUDE_PLUGIN_ROOT(checkout, runtime Codex,.mcpb) : il passe et dit qu'aucun plugin n'a lancé le processus. Il ne devine pas de répertoire de plugin ;mcp_serverimporté hors de$CLAUDE_PLUGIN_ROOT/mcp_server: échec, avec le chemin réel et la commande via le launcher ;pyproject.toml[project] version) : échec ;Type of change
Test plan
pytest tests_py/test_doctor_pairing.py: 19 passés. Le checkout lui-même est testé comme répertoire de plugin (manifeste 4.23.5 = pyproject 4.23.5).pytest tests_py/test_doctor*.py tests_py/scripts --ignore=tests_py/scripts/test_mutation_isolation.py: 2014 passés, 18 ignorés (avant le commit de tests ;test_mutation_isolationexigemutmut, absent au premier passage). Après le second commit :pytest tests_py/test_doctor*.py140 passés, 3 ignorés.GITHUB_BASE_REF=main python scripts/ci_mutation_diff.py) :2 file(s), 0 failed, 0 untested, 0 survivant. Le premier passage en avait laissé 33 (nom,optionaletfixnon vérifiés, version vide ou non textuelle,[project]qui n'est pas une table) ; le second commit les tue tous.CLAUDE_PLUGIN_ROOT=$PWD→True Claude plugin 4.23.5 runs its own mcp_server 4.23.5 (…/pyproject.toml);CLAUDE_PLUGIN_ROOT=/tmp→ écheccannot read the Claude plugin pairing: [Errno 2] … /tmp/.claude-plugin/plugin.json.ruff checketruff format --check(0.17.3) sur les fichiers modifiés ;python scripts/check_craftsmanship.py: OK.--no-install-package torch). Windows et macOS sont laissés à la CI.Audit notes
runtime.py; le doctor exécuté dans le runtime Codex ne connaît pas le chemin du manifeste Codex, donc il n'est pas comparé ici.Coding-standards compliance
doctor_pairing.pyn'importe que la stdlib,mcp_serveret deux constantes dedoctor_artifact.doctor.py, déjà en baseline, ne gagne que le câblage (8 lignes).# source:.https://claude.ai/code/session_018kyZYs18rVW23Ta85PHji4
Generated by Claude Code