Skip to content

fix(event): clarify remote bus blocker recovery#1454

Merged
liangshuo-1 merged 1 commit into
larksuite:mainfrom
Zhang-986:codex/event-remote-blocker-guidance
Jun 15, 2026
Merged

fix(event): clarify remote bus blocker recovery#1454
liangshuo-1 merged 1 commit into
larksuite:mainfrom
Zhang-986:codex/event-remote-blocker-guidance

Conversation

@Zhang-986

@Zhang-986 Zhang-986 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • clarify that a positive remote event connection preflight is a remote/server-side blocker
  • avoid suggesting local-only status/stop as the full recovery path
  • point users toward stopping the owner host/process, waiting for platform timeout, or using a separate app/profile

Fixes #1381.

Tests

  • go test ./internal/event/consume -run TestEnsureBus_RemoteBusAlreadyConnectedIsFailedPrecondition -count=1 (fails before the fix, passes after)
  • go test ./internal/event/consume ./cmd/event -count=1
  • go test ./internal/event/consume ./cmd/event ./errs -count=1
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error messages when attempting to start a local event bus while a remote connection is already active. The improved guidance provides clearer instructions referencing CLI commands for checking connection status, stopping remote connections, and clarifies how to handle platform connection timeouts.

@Zhang-986
Zhang-986 requested a review from liangshuo-1 as a code owner June 14, 2026 07:49
Copilot AI review requested due to automatic review settings June 14, 2026 07:49
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db0a8e37-6e0b-4529-9984-b637d8c38e14

📥 Commits

Reviewing files that changed from the base of the PR and between c0730b4 and 42e948f.

📒 Files selected for processing (2)
  • internal/event/consume/startup.go
  • internal/event/consume/startup_guard_test.go

📝 Walkthrough

Walkthrough

The error message and hint returned by EnsureBus when a remote event connection blocks bus startup are updated to reference lark-cli event status, lark-cli event stop, and platform connection timeout. The corresponding test is extended to assert all new hint substrings.

Changes

Remote Bus Precondition Error Message and Test

Layer / File(s) Summary
Error message wording and hint assertions
internal/event/consume/startup.go, internal/event/consume/startup_guard_test.go
Error text in EnsureBus changes from "active connection(s)" to "remote event connection(s) detected via API" and the hint is reworded to reference lark-cli event status, lark-cli event stop, and platform connection timeout. Test TestEnsureBus_RemoteBusAlreadyConnectedIsFailedPrecondition replaces a single event stop substring check with a loop asserting all new hint fragments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A stale connection once confused the flock,
The hint said "stop it!" but gave no clock.
Now the message says "remote!" with timeout to wait,
And tests check each phrase to keep the docs straight.
Hop along, brave CLI — the path is now clear! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 'fix(event): clarify remote bus blocker recovery' accurately summarizes the main change—improving error messaging to clarify remote bus blockers and recovery guidance.
Description check ✅ Passed The description provides a clear summary of motivation, documents concrete test steps, and references the related issue #1381 as required by the template.
Linked Issues check ✅ Passed The PR fully addresses issue #1381's primary objective of clarifying that remote event connection blockers are server-side and providing actionable recovery guidance in error messages.
Out of Scope Changes check ✅ Passed All changes are scoped to clarifying the error message and test validation for the remote bus blocker scenario; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Jun 14, 2026

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves the error messaging when a remote event bus connection is already active, making it clearer that local CLI commands won’t affect remote connections and suggesting appropriate remediation steps.

Changes:

  • Updated the validation error message/hint emitted when the API reports an existing remote bus connection.
  • Updated the corresponding test to assert the new hint content via multiple required substrings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/event/consume/startup.go Refines the failed-precondition error copy and expands the hint for remote-connection scenarios.
internal/event/consume/startup_guard_test.go Adjusts assertions to match and enforce the new multi-part hint messaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/event/consume/startup.go
Comment thread internal/event/consume/startup.go
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.35%. Comparing base (c0730b4) to head (42e948f).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1454   +/-   ##
=======================================
  Coverage   73.35%   73.35%           
=======================================
  Files         750      750           
  Lines       69250    69250           
=======================================
  Hits        50799    50799           
  Misses      14711    14711           
  Partials     3740     3740           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@42e948fed9b90629568470ce5bec386ef83d46c6

🧩 Skill update

npx skills add Zhang-986/cli#codex/event-remote-blocker-guidance -y -g

@liangshuo-1
liangshuo-1 merged commit 80a5f30 into larksuite:main Jun 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

event consume blocked by remote online_instance_cnt=1 but status/stop cannot recover

4 participants