Skip to content

Remote Control cannot start: stale rc.json + recycled PID causes false "running in another process" error #5448

Done

Description

@Meaolock

Environment

  • Kimi Code Desktop 1.3.7 (stable channel), Windows
  • Error: Remote Control is still running in another process on this machine and did not stop in time. Stop it there and try again.

What happened

Enabling Remote Control always failed with the error above, even though no other Kimi Code process on the machine was running Remote Control.

Root cause (confirmed locally)

  • ~/.kimi-code/server/rc.json still contained state from a previous run:
    {"pid":6252,"nonce":"<redacted>","local_origin":"http://127.0.0.1:4474","device_id":"<redacted>","url":"<redacted>","started_at":1795603644816}
  • The original Remote Control process had already exited. Its PID (6252) had been recycled by Windows and now belongs to an unrelated sshd.exe, created hours AFTER started_at.
  • Nothing was listening on 127.0.0.1:4474 anymore.
  • The app apparently only checks "does this PID exist / can it be stopped", so the recycled PID made it believe Remote Control was still running elsewhere, and stopping it (an unrelated system process) timed out.

Workaround

Renaming ~/.kimi-code/server/rc.json fixed it; Remote Control can then start normally.

Suggested fix

When validating rc.json, verify process identity instead of PID existence alone (e.g. compare process creation time against started_at, check the executable path, or do a nonce/health check against local_origin). If the recorded process is gone or doesn't match, treat the state file as stale and clean it up instead of trying to stop the PID.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions