Skip to content

fix: Dispatcher updates now show the installed version#1422

Merged
hatayama merged 3 commits into
v3-betafrom
fix/dispatcher-self-update-message
Jun 28, 2026
Merged

fix: Dispatcher updates now show the installed version#1422
hatayama merged 3 commits into
v3-betafrom
fix/dispatcher-self-update-message

Conversation

@hatayama

@hatayama hatayama commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Dispatcher updates now show which launcher version was installed.
  • Automatic background updates report the version change without mixing into command stdout.

User Impact

  • Before, dispatcher self-updates could happen silently, making it unclear whether a newer launcher was actually installed.
  • After this change, users can see the dispatcher version transition, while JSON/tool command output remains clean.

Changes

  • Report dispatcher version changes after successful automatic self-updates.
  • Report version changes or already-current status for manual uloop update.
  • Keep automatic update notifications on stderr and manual update results on stdout.

Verification

  • go test ./internal/cli -run 'TestEnforceDispatcherFreshness|TestTryHandleUpdateRequest'
  • scripts/check-go-cli.sh
  • git diff --check
  • /Users/a12115/dotfiles/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/v3-beta

Review in cubic

Show the dispatcher version transition after successful automatic self-updates and manual update commands so users can tell which launcher version will run next.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 46 minutes and 11 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f13fa941-d5db-49d3-a71f-a718a046d4ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7726af0 and a1baa08.

📒 Files selected for processing (4)
  • cli/internal/cli/dispatcher.go
  • cli/internal/cli/dispatcher_update_version.go
  • cli/internal/cli/dispatcher_update_version_test.go
  • cli/internal/cli/update_test.go
📝 Walkthrough

Walkthrough

The PR adds helpers to read the installed dispatcher version and emit version-aware completion or error messages. Those helpers are wired into dispatcher freshness enforcement and manual update handling, with tests covering changed and unchanged version cases.

Changes

Dispatcher version-aware update output

Layer / File(s) Summary
Version reading and completion-writing helpers
cli/internal/cli/dispatcher_update_version.go
New file defines dispatcherReadInstalledVersion (self-executes with --version --json), dispatcherInstalledVersionOrEmpty, dispatcherVersionChanged, writeOptionalDispatcherUpdateCompletion, and writeManualDispatcherUpdateCompletion.
Freshness enforcement error with version details
cli/internal/cli/dispatcher.go
Removes the static retry message string; after dispatcherRunUpdate succeeds, the code reads the installed version and returns writeDispatcherSelfUpdateRequiredError, which sets the error message and cliError.Details from the current and updated versions.
Manual update command execution and completion output
cli/internal/cli/update.go
update.go routes command execution through updateRunCommand, uses dispatcherVersion when building update commands, and replaces the fixed success line with writeManualDispatcherUpdateCompletion.
Tests for both update paths
cli/internal/cli/dispatcher_test.go, cli/internal/cli/update_test.go
Adds stubDispatcherUpdateHooks plus freshness tests for changed, unchanged, and required-update version reporting, and manual-update tests for version-changed and already-current output.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1413: Modifies the same dispatcher self-update freshness enforcement path in dispatcher.go and touches the same dispatcher version reporting logic.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: dispatcher updates now surface the installed version.
Description check ✅ Passed The description is directly related and accurately summarizes the update behavior and output changes.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dispatcher-self-update-message

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.

Advance the dispatcher contract version marker so the changed dispatcher launcher code can produce a new dispatcher release.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/internal/cli/dispatcher_update_version.go`:
- Around line 19-81: The dispatcher self-update code in
readInstalledDispatcherVersion and the related completion helpers is being
shipped without a version bump, so update the dispatcherVersion release input
used by this PR to a new value. Make the version increment consistent with the
rest of the dispatcher release plumbing so the updated behavior is published as
a distinct launcher build and CI can pass.

In `@cli/internal/cli/update_test.go`:
- Around line 194-230: The successful manual update tests in
tryHandleUpdateRequest only assert stdout content, so they miss accidental
status leakage to stderr. Tighten TestTryHandleUpdateRequestReportsVersionChange
and TestTryHandleUpdateRequestReportsAlreadyCurrentVersion to also verify stderr
remains empty after calling tryHandleUpdateRequest, using the existing stdout
and stderr buffers and the updateCommandName/manual update hook setup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 96e58cfa-b0e2-41fd-bba6-8c8b7fb8c9d2

📥 Commits

Reviewing files that changed from the base of the PR and between 1870ac4 and cf63b88.

📒 Files selected for processing (5)
  • cli/internal/cli/dispatcher.go
  • cli/internal/cli/dispatcher_test.go
  • cli/internal/cli/dispatcher_update_version.go
  • cli/internal/cli/update.go
  • cli/internal/cli/update_test.go

Comment thread cli/internal/cli/dispatcher_update_version.go
Comment thread cli/internal/cli/update_test.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cli/internal/cli/dispatcher.go Outdated
Comment thread cli/internal/cli/update_test.go
Normalize dispatcher update versions before comparison and reporting, and assert manual update success paths keep status output off stderr.
@hatayama hatayama merged commit 954f4ad into v3-beta Jun 28, 2026
10 checks passed
@hatayama hatayama deleted the fix/dispatcher-self-update-message branch June 28, 2026 01:51
@github-actions github-actions Bot mentioned this pull request Jun 28, 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