feat(cli): warn when --port is outside discovery range - #11143
Merged
catrielmuller merged 2 commits intoJun 12, 2026
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Resolved Issues
Files Reviewed (4 files)
Reviewed by claude-sonnet-4.6 · 137,820 tokens Review guidance: REVIEW.md from base branch |
Print a yellow non-fatal warning when kilo console or kilo daemon start/restart is invoked with an explicit --port outside 4097-4116. Auto-discovery only scans that window, so an out-of-range port can silently break later manual or auto-connect attempts. Implementation stays entirely in Kilo-owned files to avoid touching upstream shared code: - Added packages/opencode/src/kilocode/cli/port-warning.ts helper exporting warnPort(port), which skips port 0 (auto-pick) and emits a yellow console.warn when the explicit port is outside Daemon.PortRange. - Hooks the helper from console.ts and daemon.ts (start/restart) The command still succeeds; the warning is informational only.
IamCoder18
force-pushed
the
feat/cli-port-discovery-warning
branch
from
June 12, 2026 01:14
d7f68bf to
4ba2bac
Compare
catrielmuller
approved these changes
Jun 12, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…very-warning feat(cli): warn when --port is outside discovery range
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Context
When
kilo console --port <port>orkilo daemon start/restart --port <port>is called with an explicit port outside the daemon discovery range (4097–4116), the daemon still starts successfully but Kilo's browser auto-discovery only scans that 20-port window. This means later manual launches or dev-mode auto-connect can silently fail to find the daemon, leaving the user with no feedback about why the console can't connect.The fix is to print a non-fatal yellow warning when an explicit port is passed outside that range, while still allowing the command to succeed normally.
Implementation
I added a small shared helper in a Kilo-owned path (
packages/opencode/src/kilocode/cli/port-warning.ts) so the change avoids touching upstream shared files and doesn't requirekilocode_changemarkers.The helper
warnIfPortOutsideDiscoveryRange(port):port === 0(auto-pick mode).Daemon.PortRange(4097–4116).console.warnwhen the explicit port is out of range.I then called this helper from:
packages/opencode/src/kilocode/cli/cmd/console.ts: after resolving network options and beforeDaemon.start().packages/opencode/src/kilocode/cli/cmd/daemon.ts: in both thestartandrestarthandlers.The warning is informational only; the command starts the daemon and opens the console as normal.
Screenshots / Video
How to Test
Manual/local verification:
kilo daemon stop && kilo console --port 4097→ no warning.kilo daemon stop && kilo console --port 4321→ yellow warning, then console opens.kilo daemon stop && kilo console --port 0→ no warning (auto-pick).kilo daemon stop && kilo daemon start --port 5000→ yellow warning.kilo daemon stop && kilo daemon restart --port 5000→ yellow warning.Checklist
Get in Touch
Discord: @IamCoder18