Skip to content

fix(remote-control): carry server token in rc local UI link - #3696

Merged
sailist merged 3 commits into
MoonshotAI:mainfrom
sailist:bug-184-09-10-rc-local-ui-token
Sep 10, 2026
Merged

fix(remote-control): carry server token in rc local UI link#3696
sailist merged 3 commits into
MoonshotAI:mainfrom
sailist:bug-184-09-10-rc-local-ui-token

Conversation

@sailist

@sailist sailist commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

None — reported directly by an internal user; the problem is explained below.

Problem

In remote-control mode (kimi web --rc and the TUI /rc command), the Local UI: line printed to the terminal shows the bare localhost origin without the #token= fragment. In non-rc mode (kimi web / TUI /web) the opened URL carries #token=, so the web UI authenticates automatically on load. With rc running, clicking the Local UI link instead hits the server-auth login dialog even though the terminal just printed a token-authenticated relay URL.

What changed

  • RemoteControlOutputOptions gains a required localServerToken; the Local UI: line is now built with buildOpenableUrl(localOrigin, token) so it carries #token=, and the fragment is rendered dim (base in accent) via splitTokenFragment, matching the ready banner's access-link styling.
  • Both rc call sites pass the token they already resolve and require: kimi web --rc (cli/sub/web/run.ts) and TUI /rc (tui/commands/web.ts).
  • Existing formatRemoteControlOutput tests updated to cover the token fragment; no new test cases added.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

- add required localServerToken to RemoteControlOutputOptions
- render the Local UI line with buildOpenableUrl and dim the #token= fragment like the ready banner
- pass the resolved token at both rc call sites (kimi web --rc, TUI /rc)
@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2d89e05

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@2d89e05
npx https://pkg.pr.new/@moonshot-ai/kimi-code@2d89e05

commit: 2d89e05

… link

- assert the Local UI line carries the #token= fragment
- scope the token-free ban to the relay and session URLs, which must never leak the local server token
@sailist
sailist merged commit d3dc594 into MoonshotAI:main Sep 10, 2026
15 checks passed
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