Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Cannot sign into Kimi #24302

OpenRickatRITE(GitHub profile, opens in a new tab) opened this issue 8 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Add Kimi as a provider (new install)
  2. Proceed to the sign in step
  3. It hangs at "Starting sign-in…"

Replicated on two Windows and two Omarchy Linux boxes

Image

Expected behavior

Sign in should proceed to that step

Actual behavior

Hangs at "Starting sign-in…"

Impact

Blocks work completely

Version or commit

0.1.3-nightly.20261023.3579

Environment

Windows 11, Omarchy Linux

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Tried logging into CLI manually (worked), did not change the outcome.

  1. RickatRITE(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. MaximSedov(GitHub profile, opens in a new tab)commented

    same

  3. I'm also reproducing this one!

  4. Reproduced on macOS with T3 Code Beta 0.1.5 and the registry-managed Kimi CLI 1.52.0 (aarch64-apple-darwin). Sign-in stalls without opening a browser.

    The Kimi log shows two attempts on 2026-10-30 at 13:16 and 13:17 local time. Both connect successfully as ACP client t3-code-provider-auth, then fail:

    kimi_cli.acp.server:authenticate:385
    Authentication not complete for method: login (no valid token found)
    
    kimi_cli/acp/server.py:390, in authenticate
    acp.exceptions.RequestError: Authentication required
    
    During handling of the above exception:
    acp/connection.py:219, in _run_request
    acp/task/sender.py:33, in send
    json/__init__.py:242, in dumps
    TypeError: Object of type AuthMethod is not JSON serializable
    when serializing list item 0
    when serializing dict item authMethods
    when serializing dict item data
    when serializing dict item error

    This indicates that Kimi fails while serializing its authentication-required error response. That would explain the pending ACP request / stalled sign-in UI, although it does not establish why browser login was never initiated. T3 server traces also show an ACP authenticate request interrupted when the attempt was replaced.

    Potentially related: #15899 identifies the registry-managed 1.52.0 runtime as the archived Kimi CLI. These observations do not yet establish whether upgrading the runtime resolves the issue.

    Diagnostics collected with Codex (gpt-6.1-sol) in T3 Code.

  5. Still reproduces on T3 Code desktop 0.1.6, macOS 26.5 (arm64), with the registry-managed Kimi CLI 1.52.0. Retry sign-in stays on "Starting sign-in…" and then shows "Not authenticated". ~/.kimi/logs/kimi.log has the same trace already posted here: authenticate:385 … no valid token found, then RequestError: Authentication required, then TypeError: Object of type AuthMethod is not JSON serializable (when serializing error.data.authMethods). Root cause and the _meta["terminal-auth"] analysis are in #28833; the fix is #24409 (still open).

    Workaround on macOS: set Executable override to ~/.kimi-code/bin/kimi (Kimi Code CLI 2.4.1). If ~/.kimi-code/credentials/kimi-code.json already exists, the provider check goes to ready and loads 256 models with no re-login. Its auth status shows unknown rather than authenticated.

    Triage by Claude Opus 5.5 (Claude Code) via t3 triage.

  6. Same on Windows 11, T3 Code 0.1.6 (t3 serve), registry-managed Kimi CLI 1.52.0. Login does nothing.

    Workaround from @AskAlice's comment works on Windows too. I already had Kimi Code CLI 2.4.1 installed and logged in (~/.kimi-code/bin/kimi.exe), so I pointed the provider at it with Executable override in Settings → Providers → Kimi CLI.

    If you run headless and want to set it in the file, it's commandPath in ~/.t3/userdata/settings.json:

    "acpRegistry_kimi_cli": {
      "driver": "acpRegistry",
      "config": {
        "agentId": "kimi",
        "distribution": "auto",
        "commandPath": "C:\\Users\\<user>\\.kimi-code\\bin\\kimi.exe"
      }
    }

    Restart the server after editing. No re-login needed. My credentials file is named kimi-code-env-<hash>.json rather than kimi-code.json, and it still worked.

  7. Root cause (Linux x86_64, t3 Code 0.1.11 and 0.1.12-nightly, registry-managed Kimi CLI 1.52.0)

    The registry's kimi entry ships kimi-cli 1.52.0. Its ACP server advertises sign-in like this:

    {
      "id": "login",
      "name": "Login with Kimi account",
      "description": "Run `kimi login` command in the terminal, then follow the instructions to finish login.",
      "_meta": {
        "terminal-auth": { "type": "terminal", "label": "Kimi Code Login", "command": "<kimi>", "args": ["login"], "env": {} }
      }
    }

    There is no top-level "type": "terminal", only _meta.terminal-auth. In packages/provider-acp-registry/src/server/auth.ts, AcpRegistryAuth.authenticate takes the terminal path only when method.type === "terminal", so 1.52.0 falls into the runtime.authenticate(methodId) branch instead.

    1.52.0 never answers that request. ~/.kimi/logs/kimi.log at the moment of the click:

    authenticate:385 | Authentication not complete for method: login (no valid token found)
    acp.exceptions.RequestError: Authentication required
    TypeError: Object of type AuthMethod is not JSON serializable
      when serializing dict item 'authMethods' / 'data' / 'error'

    It decides the login failed immediately, then crashes while serializing the error response, so no JSON-RPC reply is ever written and the process stays up. t3 Code awaits that reply with no timeout, hence "Starting sign-in…" forever. Reproduced directly: initialize + authenticate(methodId=login) against kimi acp 1.52.0 gives no response within 20 s, process alive.

    Smallest fix

    Treat a method as terminal when it carries _meta["terminal-auth"] (the ACP terminal-auth extension), not only when type === "terminal". 1.52.0's own description says "Run kimi login in the terminal" and its _meta.terminal-auth supplies args: ["login"], so the existing runTerminal path (<spawn> login) does exactly what the reporter confirmed works manually. A test that feeds the payload above and asserts the terminal path covers it.

    Robustness

    Race runtime.authenticate(methodId) against the runtime exiting or its connection closing, so an agent that dies mid-request surfaces "The ACP agent could not complete sign-in" instead of hanging.

    Product note

    The registry now has a separate kimi-code entry ("Kimi Code", 2.7.3 via npx @moonshot-ai/kimi-code) and labels kimi as "Kimi CLI (Legacy)". 2.x advertises type: "terminal" with args: ["--login"] (kimi acp --login, a device-code flow with URL and user code), which t3 Code's existing terminal path handles unchanged. Worth defaulting new Kimi providers to kimi-code.

    Workaround today, no code change

    Change the provider's Registry agent ID from kimi to kimi-code. Same ~/.kimi-code/ config dir, so an existing login carries over. Verified here: status ready, authenticated. Alternative: Executable override pointing at a kimi-code 2.x binary.

Sign in to join this conversation.