Skip to content

fix(server): return an explicit absent result from sumo_qa_check_external_skill_installed - #834

Merged
sumithr merged 3 commits into
mainfrom
fix/issue-821-check-skill-installed-absent
Oct 4, 2026
Merged

sumithr merged 3 commits into
mainfrom
fix/issue-821-check-skill-installed-absent

Conversation

@sumithr

@sumithr sumithr commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

For a skill that is not installed, sumo_qa_check_external_skill_installed used to return None, which the host received as empty content ("completed with no output"). It now returns {"installed": false, "skill": "<name>", "scope": "<requested scope>"}. The found result and the error envelope are unchanged.

Related issue

Closes #821

Changes

  • src/sumo_qa/server.py: the MCP wrapper returns the absent dict when the library returns None. The library function keeps returning None for its other caller. The return type is now CheckExternalSkillInstalledOutput | CheckExternalSkillNotInstalledOutput | ErrorEnvelope.
  • src/sumo_qa/server_schemas.py: new strict CheckExternalSkillNotInstalledOutput (installed: Literal[False], skill, scope; no extra fields, so no candidate paths leak).
  • skills/sumo-qa-suggesting-external-skill/SKILL.md step 1: installed: false, like an execute isError, falls through to search.
  • Eval fixtures (skill-suggesting-external-skill*.yaml) and tests/scenarios/TOOL-SELECTION.md TS-12 use the real result shape instead of "returned null".

Drift from the issue text: the issue asks for structured content and a served output schema. No tool serves outputSchema/structuredContent (_drop_structured_output, #335), and the tools-list snapshot pins outputSchema: null. The contract here is the typed three-way return union, delivered as JSON text; re-enabling output schemas for one tool would go against #335.

How it was verified

  • Red/green: tests/test_external_skills.py::test_check_external_skill_installed_dispatch_separates_found_absent_and_error runs found, absent and error through real call_tool dispatch with an empty HOME and cwd; it failed before the fix with JSONDecodeError on empty content. tests/test_server_schemas.py adds rejection cases for the absent model.
  • CI on the final head (931bcf1): every check green, including mypy (the only failure on the previous head) and pytest on ubuntu, macOS and Windows, py3.10 to py3.14. Mutation gate run 37165090383: 0 survivors, strict gate passed.
  • Pre-push full suite: 5449 passed, 17 skipped, 1 xfailed, 100% coverage; scoped mutmut passed.
  • Behaviour on the real surface: the branch wheel in a clean venv, driven by a headless haiku agent through the MCP tools, returns the absent result as non-empty installed: false content (origin/main shows "completed with no output"), keeps found output and precedence identical to origin/main, and the suggesting-external-skill flow falls through to search and stops at the [y/N] gate. Full ledger in the proof comment.
  • Evals (haiku candidate, claude-opus-5-5 judge): skill-suggesting-external-skill.yaml 1/1; conversion config 7/8, the one failure passed 3/3 on this head and 3/3 on origin/main when repeated (candidate variance on an untouched path).
  • audit_context_budget.py: context budget OK.
  • Review: sumo-qa per-file review of every changed file and /code-review high on the whole diff; round 1 fixed a stale "was null" eval sentence, an em-dash in the rewritten skill line and the scope field description; the fix-delta reviews found no defects.

Not changed, noted for later: the found result has no installed: true key (hosts tell outcomes apart by path), kept so found output stays byte-compatible. The suggesting-external-skill SKILL.md still has em-dashes on lines this PR did not touch, and scripts/check_no_em_dashes.py does not scan skills/.

Checklist

  • PR title follows Conventional Commits
  • Tests pass locally (pytest) and lint/type checks are green (pre-commit run --all-files, python -m mypy)
  • Added or updated tests covering the change
  • Updated the relevant docs in this same PR
  • No breaking changes (or they are called out above)

…rnal_skill_installed

A missing skill made the wrapper return None, which MCP serialized as empty
content, so the host could not tell "not installed" from an output-less call.
The wrapper now returns {"installed": false, "skill", "scope"} (no candidate
paths), typed as CheckExternalSkillNotInstalledOutput alongside the found model
and the error envelope. The library function keeps its None contract.

The suggesting-external-skill step 1 names the absent result as a fall-through
to search, and the eval fixtures and TS-12 scenario carry the real wire shape.

Closes #821
@sumithr

sumithr commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Merge-readiness evidence, head 931bcf18

CI: all checks green on 931bcf1883c46a494578bee5356820ed46e00393, including mypy (static type check) (the only failure on the previous head 64d7de79, fixed by 931bcf18) and pytest on ubuntu, macOS and Windows, py3.10 to py3.14.

Mutation gate: triggered (the diff touches tests/**/*.py). Run 37165090383 on this head: every module at or above baseline, 0 survivors, strict gate passed.

Pre-push full suite (final head): 5449 passed, 17 skipped, 1 xfailed, 100% coverage; scoped mutmut passed.

Per-file review (sumo-qa reviewing_before_merge, each changed file's full content vs origin/main): SAFE on all 8 files (server.py, server_schemas.py, the suggesting-external-skill SKILL.md, both eval YAMLs, TOOL-SELECTION.md, test_external_skills.py, test_server_schemas.py). Two low notes, not material: the absent payload is a hand-built dict (as the found arm already is), and model/wire parity is pinned by two separate tests.

/code-review (high): round 1 on the whole diff found a stale "was null" eval sentence, an em-dash in the rewritten skill line, and the scope field description; all fixed in 64d7de79. Delta reviews of 2074bef7..64d7de79 and 64d7de79..931bcf18 (the mypy annotation): no defects.

Behavioural verification (step 4.7), 5 of 5 rows met. Branch wheel installed into a clean venv; origin/main (1e25f84) into a second; each row driven by a real headless claude -p agent (haiku 4.5) through --strict-mcp-config with only mcp__sumo-qa allowed, cwd a fresh clone of this repo (551 commits), HOME a temp dir.

# behaviour observed met
1 absent skill returns non-empty text with installed: false {"installed": false, "skill": "zzz-not-a-skill", "scope": "auto"} yes
2 found / absent / error distinguishable found {name, path, agent, scope}; absent {installed: false, ...}; error {"isError": true, "error": {"type": "ValueError", "message": "skill is required", ...}} yes
3 found output and precedence unchanged identical to origin/main for a global skill and for a project-over-global collision yes
4 no more "completed with no output" branch: non-empty JSON content; origin/main: (… completed with no output) yes
5 suggesting-external-skill falls through on installed: false router -> suggesting skill -> check (installed: false) -> sumo_qa_search_external_skills -> stops at the [y/N] gate; zero install/execute calls yes

Existing flow: using_sumo_qa + sumo_qa_load_classifications produce byte-identical results on branch and origin/main.

Evals (haiku candidate, claude-opus-5-5 judge, repeat 1, this head): skill-suggesting-external-skill.yaml 1/1. skill-suggesting-external-skill-conversion.yaml 7/8; the failing case ("execute success returns a skill_body to FOLLOW") then passed 3/3 on this head and 3/3 on origin/main at repeat 3, and its graded path is untouched by this diff, so the single failure is candidate variance, not a regression.

Acceptance criteria (#821):

  1. Absent skill returns non-empty text with a stable discriminator: met (installed: false). "Structured content" is not served: _drop_structured_output (perf(server): slim always-on tools/list (drop outputSchema + schema titles) #335) strips it from every tool.
  2. Output schema covering found, absent, error: met only as the typed return union (CheckExternalSkillInstalledOutput | CheckExternalSkillNotInstalledOutput | ErrorEnvelope); no served outputSchema (perf(server): slim always-on tools/list (drop outputSchema + schema titles) #335). Drift recorded on [Bug]: sumo_qa_check_external_skill_installed returns empty content instead of its documented null for a missing skill #821.
  3. Found output and search precedence compatible: met (4.7 row 3).
  4. Claude Code no longer renders "completed with no output": met (4.7 row 4).
  5. Unit, server-dispatch, schema, annotation, snapshot tests: met.
  6. Suggesting-external-skill handles the absent result: met (4.7 row 5).

Review threads: 0.

@sumithr
sumithr merged commit ad44ce5 into main Oct 4, 2026
29 checks passed
@sumithr
sumithr deleted the fix/issue-821-check-skill-installed-absent branch October 4, 2026 11:00
sumithr added a commit that referenced this pull request Oct 4, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.73.1](v0.73.0...v0.73.1)
(2026-10-04)


### Bug Fixes

* **server:** return an explicit absent result from
sumo_qa_check_external_skill_installed
([#834](#834))
([ad44ce5](ad44ce5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
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.

[Bug]: sumo_qa_check_external_skill_installed returns empty content instead of its documented null for a missing skill

1 participant