Skip to content

fix(doctor): stop reporting unrouted MCP servers as having no identity channel - #17652

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/doctor-identity-note-9566
Oct 8, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/doctor-identity-note-9566

Conversation

@buluoray

@buluoray buluoray commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: kirocrew doctor stops telling Windows and macOS users that their stock install has "no identity channel" for Crew's MCP servers and that strict tools such as cron_add are refused because of it.

#9566 asks for chat to create scheduled tasks and agents through native tools instead of the kirocrew CLI. The reporter's stated root cause was this doctor line on Windows 0.7.0: strict identity: ⏹ no identity channel for kirocrew-core, kirocrew-dashboard, kirocrew-work, followed by text saying strict tools "are refused while a server is unrouted". On current main that is no longer true. Each session's managed MCP element carries a signed per-session token that the strict resolver reads with no gateway (session_token_sig, #11383; design note docs/architecture/design-notes/mcp-stub-decoupling.md, "Session identity does not depend on the stub"). The runtime refusal text in mcp_core.strict_identity_diagnosis was already updated to say so. Main's doctor header no longer says "no identity channel" (#17450), but its note still tells users to route the servers "if you use those tools", even though an empty mcp_gateway.stub_servers is the default and needs no routing.

Why it matters

Doctor is the first place a user looks. Today it flags every stock Windows and macOS install with a "no identity channel" warning and sends the user to set up MCP routing, a broker plus one stub process per server, to fix a refusal that routing does not cause. In #9566 that misdiagnosis turned a question about the native cron_add path into a bug report about identity routing.

Not a goal

What changed (motivation → approach → change)

  • Symptom: on a stock Windows/macOS install, doctor prints no identity channel for kirocrew-core, ... and says strict tools are refused while a server is unrouted.
  • Root cause: _doctor_strict_identity was written when per-call caller injection, which exists only for servers in mcp_gateway.stub_servers, was the only identity channel on the kiro backend's session-unbound AcpRuntime. The signed per-session token on every managed MCP element (acp/runtime.py _own_stub_session / _unpooled_control_planes, acp/session_mcp.py kiro_control_plane_servers) later became the default channel, and doctor kept its old wording.
  • Already on main: the docs audit (docs: 2026-10 full audit -- docs, skills, rules and CI guards #17450) changed the header to strict identity: ⏹ not routed through the gateway: <names> and rewrote the docstring. After rebasing, this PR keeps main's header and docstring.
  • Change: in src/kiro_crew/doctor_checks/mcp.py, only the explanatory note under that header changes. It now opens with "This is the default and needs no change", names cron_add among the strict tools, says those tools identify the session from the signed per-session token, says this check reads config only, and says to route only when a tool's own refusal reports that the element carried no session token. That condition is the last branch of strict_identity_diagnosis, so the two messages now agree. Main's note still told users to "Route them ... if you use those tools". The check is still note-only, still skipped on Linux, and still never appends to issues.

Backwards compatibility

Compatible: the only change is doctor's human-readable output for one note. No exit code, issues entry, config key, or behaviour changes.

Removes nothing: the check, its skip rule, its routed-case output and its note-only contract all stay. Only the wording of the unrouted case is replaced.

Tests

test/test_strict_identity_diagnostics.py::TestDoctorStrictIdentity:

  • New test_unrouted_is_not_reported_as_a_missing_identity_channel checks that the unrouted note no longer contains "no identity channel" or "are refused while". It also checks that the note says "needs no change", names the per-session token, and lists cron_add.
  • The existing header assertions are unchanged, since the header now comes from main.
  • Red on base: with src/kiro_crew/doctor_checks/mcp.py reverted to origin/main, the new test fails on "needs no change" (1 failed, 28 passed). With the change, it passes.
  • Run with PYTHONPATH=<worktree>/src (the import was confirmed to resolve inside the worktree): test_strict_identity_diagnostics.py plus test_doctor*.py gave 190 passed.

Manual verification

N/A: unit coverage is sufficient for a text-only change. Unverified on this Linux host: whether cron_add from a Windows dashboard chat succeeds on current main. The check is skipped on Linux by design, so its live output was not reproduced here.

Related Issues

Refs #9566 (this draft is the decision-free first slice; the native agent-creation part stays an owner decision).

Decision for the owner

#9566 asks whether chat should create scheduled tasks and agents through native tools instead of the CLI. This draft only stops doctor from misreporting a stock install as having "no identity channel", because cron_add already has a gateway-free native identity path on main, and it leaves native agent creation to the Captain confirm-to-apply work (#15326) instead of adding a second, unconfirmed agent-creation tool.

Pattern harvest

Rule candidate: review-prompt
Pattern: a diagnostic or doctor message that hard-codes which channel is "the only" one goes stale when a later change adds another channel. Make it defer to the live diagnosis instead of restating the topology.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Before merge, check on a real macOS or Windows install that strict tools like cron_add resolve unrouted, which the new note now promises to every user there.

What this change ships

Inventory (3 items) — 3 justified

Intent: stop kirocrew doctor telling stock macOS and Windows users to set up MCP routing for a strict-tool refusal that routing does not cause. This is a FIX.

  1. The doctor note for unrouted servers now opens "This is the default and needs no change" and drops "Route them … if you use those tools". — justified
  2. The note says to route only when a tool's own refusal reports the element carried no session token, which matches the last branch of strict_identity_diagnosis. — justified
  3. cron_add is now named among the strict tools, and a test pins the new wording. — justified

[FIRST-PRINCIPLES-REVIEWED] 0ff6cd6

Description read

[DESCRIPTION-READ] 244860f7f908ab546222db293e3f10ed058ec8a9ebfe946662349db4b89eb908

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 0ff6cd6

Description read

[DESCRIPTION-READ] 099035599bf7902c68458f425180b518e8e12bae55a9ce650e925ec8b97b5e57

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0ff6cd6

Verdict parsed from the review's SHA-scoped output markers for commit 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0ff6cd6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5: <one-sentence reason>

@buluoray
buluoray force-pushed the fix/doctor-identity-note-9566 branch from 779d899 to ef0ec48 Compare October 7, 2026 08:31
@buluoray
buluoray marked this pull request as ready for review October 7, 2026 18:20
@buluoray
buluoray requested a review from a team as a code owner October 7, 2026 18:20
@buluoray
buluoray requested a review from chenmingwei23 October 7, 2026 18:20
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 7, 2026
@buluoray
buluoray force-pushed the fix/doctor-identity-note-9566 branch from ef0ec48 to e97f566 Compare October 7, 2026 21:47
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 7, 2026
@buluoray
buluoray force-pushed the fix/doctor-identity-note-9566 branch from e97f566 to 0ff6cd6 Compare October 8, 2026 00:30
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 0ff6cd64fa0c4f72d9db80de2d4b198896a825b5 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 8, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 8, 2026 04:22

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: fix with a diff that matches its description.

@chenmingwei23
chenmingwei23 merged commit c7a9fd3 into main Oct 8, 2026
146 of 149 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/doctor-identity-note-9566 branch October 8, 2026 06:02
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 8, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR rewrites the kirocrew doctor strict-identity note so a stock unrouted install is no longer told it lacks an identity channel or that strict tools are refused because of it. That is the real cause of the #9566 misdiagnosis, and the change touches output text only, with no resolver or routing logic. I checked the new wording against main's mcp_core.py: the strict resolver does read the signed per-session token first with no gateway, and the refusal diagnosis names the failed channel itself, so the note is accurate. The new test asserts the old "no identity channel" / "are refused while" phrasing is gone and that the note says routing needs no change. It would fail on base, which still says to route the servers. All checks pass, the Opus, GPT, Design and First Principles lanes PASS with no findings on 0ff6cd6, there are no open change requests, and the head test-merges cleanly onto main. — crew-pr-reviewer

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.

4 participants