Skip to content

fix(web): handle EACCES from os.networkInterfaces() on restricted platforms - #5684

Open
xuilen wants to merge 2 commits into
MoonshotAI:mainfrom
xuilen:fix/web-network-interfaces-eacces
Open

xuilen wants to merge 2 commits into
MoonshotAI:mainfrom
xuilen:fix/web-network-interfaces-eacces

Conversation

@xuilen

@xuilen xuilen commented Nov 28, 2026

Copy link
Copy Markdown

Closes #5529

Summary

On Android/Termux and other restricted environments where os.networkInterfaces() fails with ERR_SYSTEM_ERROR (uv_interface_addresses / EACCES), running kimi web --host 0.0.0.0 crashed during startup while formatting access URLs.

Changes

  • apps/kimi-code/src/cli/sub/web/networks.ts: Wrap networkInterfaces() in try/catch inside listNetworkAddresses() and return [] on failure so accessUrlLines() still prints the Local: URL and the web server starts normally.
  • apps/kimi-code/test/cli/web/networks.test.ts: Add a unit test verifying listNetworkAddresses() returns [] when os.networkInterfaces() throws ERR_SYSTEM_ERROR (EACCES).

Testing

  • vitest run test/cli/web/networks.test.ts: 1 passed, 0 failed.

@changeset-bot

changeset-bot Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b61607

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T10:03:21.659377Z 1369e1c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1369e1c32d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +12 to +13
} catch {
return [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the required CLI changeset

Returning [] makes the kimi web --host 0.0.0.0 startup fix user-visible, but this commit adds no .changeset entry. Add a short English patch changeset for @moonshot-ai/kimi-code so the fix is represented in release notes, as required for CLI behavior changes.

AGENTS.md reference: AGENTS.md:L169-L170

Useful? React with 👍 / 👎.

@xuilen

xuilen commented Nov 29, 2026

Copy link
Copy Markdown
Author

Added the patch changeset for @moonshot-ai/kimi-code\ (.changeset/web-network-interfaces-eacces.md) as requested.

This branch has not been deployed

No deployments
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.

[Bug] kimi web --host 0.0.0.0 在 Android 上崩溃:os.networkInterfaces() 抛 EACCES

1 participant