Skip to content

fix(cli): show a proper error message when port is already in use for web and serve - #46262

Open
MohamedSayed0573 wants to merge 1 commit into
anomalyco:devfrom
MohamedSayed0573:cli_error
Open

fix(cli): show a proper error message when port is already in use for web and serve#46262
MohamedSayed0573 wants to merge 1 commit into
anomalyco:devfrom
MohamedSayed0573:cli_error

Conversation

@MohamedSayed0573

@MohamedSayed0573 MohamedSayed0573 commented Aug 30, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #46263

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Handle the case where the port is already used when using opencode web and opencode serve
instead of the generic:

Error: Unexpected error.
ServeError

Now it shows:

Error: Port 4096 is already in use

How did you verify your code works?

  • bun typecheck

Screenshots / recordings

Before:
image

After:
image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copilot AI lite review requested due to automatic review settings August 30, 2026 14:48

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

CLI: web and serve show generic error message when the port is already in use

2 participants