Skip to content

fix(tui): carry server token in /web and print it on exit - #1133

Merged
wbxl2000 merged 2 commits into
mainfrom
fix/tui-web-token
Jun 26, 2026
Merged

fix(tui): carry server token in /web and print it on exit#1133
wbxl2000 merged 2 commits into
mainfrom
fix/tui-web-token

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

N/A — minor parity fix for the /web slash command.

Problem

/web hands the current session off to the browser, but unlike the kimi web subcommand it opened the session deep link without the bearer token. The web UI therefore loaded unauthenticated (and prompted for a token), and the token was never shown, so there was no way to copy it from the terminal.

What changed

After the background daemon is up, resolve the persistent server token and:

  • append it as the #token= fragment on the session deep link, so the browser signs in on load exactly like kimi web;
  • show it as a green status line directly below "Starting Kimi server and opening web UI…" inside the TUI, so it can be copied before the terminal exits.

Falls back to the plain URL (and skips the token line) when no token file exists, matching kimi web.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • 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.

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5dbc32a

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 Jun 26, 2026

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

commit: 5dbc32a

@wbxl2000
wbxl2000 force-pushed the fix/tui-web-token branch from 1313382 to 39d02a9 Compare June 26, 2026 09:48
The /web slash command opened the session deep link without the bearer token, so the web UI was not authenticated and the token was never shown, unlike the kimi web subcommand. Resolve the persistent server token, append it as the #token= fragment so the browser signs in on load, and show it in green below the status line so it can be copied before the terminal exits.
@wbxl2000
wbxl2000 force-pushed the fix/tui-web-token branch from 39d02a9 to 48e942e Compare June 26, 2026 09:52
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

PluginSummary/PluginInfo gained a required hookCount field, so the app's typecheck failed on fixtures that did not provide it. Add hookCount: 0 to the test summaries (none of these fixtures declare hooks).
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 48e942e88f

ℹ️ 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".

@wbxl2000
wbxl2000 merged commit f1c8175 into main Jun 26, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the fix/tui-web-token branch June 26, 2026 10:04
@github-actions github-actions Bot mentioned this pull request Jun 26, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Jul 11, 2026
…#1133)

* fix(tui): show the server token when handing off via /web

The /web slash command opened the session deep link without the bearer token, so the web UI was not authenticated and the token was never shown, unlike the kimi web subcommand. Resolve the persistent server token, append it as the #token= fragment so the browser signs in on load, and show it in green below the status line so it can be copied before the terminal exits.

* test(plugins-selector): add required hookCount to fixtures

PluginSummary/PluginInfo gained a required hookCount field, so the app's typecheck failed on fixtures that did not provide it. Add hookCount: 0 to the test summaries (none of these fixtures declare hooks).

(cherry picked from commit f1c8175)
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