Skip to content

fix: V2 delegation notice now names the V2 CLI version that ran - #2027

Merged
hatayama merged 1 commit into
v3-betafrom
chore/v2-mode-notice-version
Jul 27, 2026
Merged

fix: V2 delegation notice now names the V2 CLI version that ran#2027
hatayama merged 1 commit into
v3-betafrom
chore/v2-mode-notice-version

Conversation

@hatayama

@hatayama hatayama commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • The V2 delegation notice now names the V2 CLI version that actually served the command.

User Impact

When a Unity project resolves to the V2 io.github.hatayama.uloopmcp package, the dispatcher silently delegates the command to a V2 uloop-cli installed in the versioned user cache. The single stderr notice was the only signal that this happened, and it read:

uloop: executing in V2 mode

That told you the generation but not the version, so when a V3-documented command or option did not behave as expected, there was nothing to point at the concrete CLI that ran. Identifying it meant inspecting the user cache by hand.

The notice now carries the delegated package and version:

uloop: executing in V2 mode (uloop-cli@2.2.0)

The notice stays on stderr and remains one line, so stdout is still exclusively the delegated command's output.

Changes

  • Build the notice from the delegated version already passed into the V2 execution path, reusing the existing package-name constant instead of hardcoding it.
  • Extract the notice text into a pure function so it is testable without launching node.
  • Add a unit test asserting the notice names the delegated package and version and ends in exactly one newline.

Verification

  • scripts/check-go-cli.sh — passes (gofmt, vet, lint with 0 issues across all three modules, and all module tests).
  • The new test was confirmed to fail before the implementation and pass after it.
  • Not verified against a live V2 project: no V2-package project was available locally, and exercising the path would pull the real V2 CLI from npm. The unit test covers the notice text.

Review in cubic

The dispatcher delegates commands to the V2 `uloop-cli` implicitly, and the
stderr notice was the only signal that a V2 CLI ran. "executing in V2 mode"
alone did not say which V2 CLI served the command, so a behavior difference
against V3 could not be traced back to a concrete version.

Include the delegated package and version in the notice, reusing the existing
`dispatcherV2CLIPackageName` constant. The notice text is extracted into a pure
function so it can be tested without launching node.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 514d7e70-2bd4-4b70-827b-ea153ef1aaf4

📥 Commits

Reviewing files that changed from the base of the PR and between 32328ac and 24b566b.

📒 Files selected for processing (2)
  • cli/dispatcher/internal/dispatcher/dispatcher_v2_run.go
  • cli/dispatcher/internal/dispatcher/dispatcher_v2_run_test.go

📝 Walkthrough

Walkthrough

The V2 dispatcher now reports the delegated CLI package and resolved version on stderr. A unit test verifies the notice string format.

Changes

V2 delegation notice

Layer / File(s) Summary
Construct, emit, and test the V2 notice
cli/dispatcher/internal/dispatcher/dispatcher_v2_run.go, cli/dispatcher/internal/dispatcher/dispatcher_v2_run_test.go
The dispatcher generates a notice containing the V2 package name and version, emits it during V2 execution, and validates the exact output with a unit test.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: the V2 delegation notice now includes the CLI version that ran.
Description check ✅ Passed The description is directly about the same V2 delegation notice and test changes described in the diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/v2-mode-notice-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hatayama
hatayama merged commit 5ed982d into v3-beta Jul 27, 2026
13 checks passed
@hatayama
hatayama deleted the chore/v2-mode-notice-version branch July 27, 2026 10:06
@github-actions github-actions Bot mentioned this pull request Jul 27, 2026
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.

1 participant