Skip to content

fix(vscode): make the gear sign-in actually log in - #1779

Merged
wbxl2000 merged 2 commits into
mainfrom
qer/vscode-sdk-followups
Jul 16, 2026
Merged

fix(vscode): make the gear sign-in actually log in#1779
wbxl2000 merged 2 commits into
mainfrom
qer/vscode-sdk-followups

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No issue — the problem is explained in the next section.

Problem

The gear (Action) menu's Sign in item in the VS Code webview was a dead button. When not logged in, ActionMenu.handleAuthAction only closed the menu and triggered a refresh — it never called bridge.login(). The full LoginScreen only appears when zero models are configured, so for users with a working config.toml setup the click had no visible effect at all.

The menu deliberately reflects only the managed Kimi account OAuth session — statically provisioned api_key providers in config.toml don't count, because Sign out must remain a meaningful action that maps to deleting the OAuth session, mirroring the CLI's /login and /logout. An earlier revision of this PR counted configured api keys as signed in; that made Sign out a no-op for those users, so it was reverted.

What changed

  • webview-ui/src/components/ActionMenu.tsx: the gear Sign in item now actually calls bridge.login() (device-code flow opens the browser automatically) with the existing loading state, and surfaces failures via a toast. Sign out keeps calling bridge.logout(); because the menu state tracks the OAuth session only, both actions now visibly toggle the menu state.
  • No changes to login detection (updateLoginContext stays OAuth-based) or to the login-screen gating (unchanged: the screen only shows when no models are configured).

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. (Covered by the existing bridge/handler test suite; the change is webview event wiring verified by typecheck and the full extension test suite.)
  • Ran gen-changesets skill, or this PR needs no changeset. (No changeset: vscode-extension-only change, nothing enters the CLI bundle.)
  • Ran gen-docs skill, or this PR needs no doc update. (Internal behavior fix, no user-facing docs affected.)

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 38de981

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

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

commit: 38de981

@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: b6e046a215

ℹ️ 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 thread apps/vscode/src/utils/context.ts Outdated
*/
export function hasConfiguredProviderCredentials(config: KimiConfig): boolean {
return Object.values(config.providers ?? {}).some(
(provider) => typeof provider.apiKey === "string" && provider.apiKey.trim().length > 0,

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 Don't treat unrelated provider keys as managed login

When a config has a static API key for one provider but the default/first model still uses managed:kimi-code without an OAuth token, this returns true just because some provider has apiKey. useAppInit then calls requiresManagedProviderLogin(..., loginStatus.loggedIn), which short-circuits on loggedIn and skips the login screen, leaving the UI ready even though the active managed model has no token and prompts will fail; the check needs to be tied to the active provider (or keep managed OAuth status separate from other provider credentials).

Useful? React with 👍 / 👎.

@wbxl2000 wbxl2000 changed the title fix(vscode): count configured provider credentials as signed in and make the gear sign-in actually log in fix(vscode): make the gear sign-in actually log in Jul 16, 2026
@wbxl2000
wbxl2000 merged commit ba36c6a into main Jul 16, 2026
18 checks passed
@wbxl2000
wbxl2000 deleted the qer/vscode-sdk-followups branch July 16, 2026 10:21
@wbxl2000 wbxl2000 mentioned this pull request Jul 16, 2026
5 tasks
ywh114 pushed a commit to ywh114/kimi-code that referenced this pull request Jul 19, 2026
* fix(vscode): count configured provider credentials as signed in and make the gear sign-in actually log in

* fix(vscode): keep the gear auth action scoped to the Kimi account session
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