Skip to content

fix(cli): include credentials in console URLs printed for headless users - #12333

Merged
marius-kilocode merged 1 commit into
Kilo-Org:mainfrom
IamCoder18:fix/console-headless-credentials
Jul 28, 2026
Merged

fix(cli): include credentials in console URLs printed for headless users#12333
marius-kilocode merged 1 commit into
Kilo-Org:mainfrom
IamCoder18:fix/console-headless-credentials

Conversation

@IamCoder18

Copy link
Copy Markdown
Contributor

Issue

Closes #12332

Context

Running kilo console on a headless host (Linux without DISPLAY/WAYLAND_DISPLAY, SSH sessions, CI runners) does not launch a browser. The command instead prints the Local and Network Console URLs and tells the user to open one manually. Those printed URLs were missing basic-auth credentials, leaving headless users with no way to authenticate into the Console.

Credentials were only embedded into the URL used by the in-process open() call, which is unreachable without a display.

Implementation

  • Renamed browserUrl(state) to withCredentials(base, state) so any base URL can be augmented with state.username / state.password. Behavior is identical (new URL("/console", base) with url.username/url.password set); the rename is what unlocks reuse.
  • Applied withCredentials to both printed URLs (consoleLocal, consoleNetwork) so headless users can copy/paste an authenticated URL into a browser on another machine.
  • Switched the hasDisplay() branch's open() call from browserUrl(state) to withCredentials(urls.local, state), so the URL it launches is the same one a headless user would copy from the terminal.

Screenshots / Video

image

How to Test

Manual/local verification

  • Run kilo console
  • Ensure that the console URL is printed with the correct username and password

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

Discord: @IamCoder18

@kilo-code-bot

kilo-code-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The previously suggested changeset (.changeset/console-headless-credentials.md) has been added and is well-formed: patch bump, user-facing description. This resolves the only prior finding.

Files Reviewed (2 files)
  • packages/opencode/src/kilocode/cli/cmd/console.ts - unchanged since last review, 0 issues
  • .changeset/console-headless-credentials.md - 0 issues
Previous Review Summary (commit 1c0eaa5)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 1c0eaa5)

Status: 1 Issue Found | Recommendation: Merge (non-blocking)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
PR-level - This fixes a user-facing bug (headless kilo console URLs were missing basic-auth credentials, making them unusable). Per repo convention, bug fixes with user-visible impact should include a .changeset/*.md entry; none was added in this PR.
Files Reviewed (1 file)
  • packages/opencode/src/kilocode/cli/cmd/console.ts - 0 code issues

The rename of browserUrl to withCredentials(base, state) and its reuse for the printed Local/Network URLs and the in-process open() call is correct and minimal — it lives entirely under src/kilocode/ so there are no fork-merge concerns. No bugs, security, or performance issues found in the changed code.


Reviewed by claude-sonnet-5 · Input: 22 · Output: 2.3K · Cached: 564.9K

Review guidance: REVIEW.md from base branch main

The headless path printed `${urls.local}/console` and `${urls.network}/console` without basic-auth credentials, leaving remote or display-less users unable to reach the console.

Rename `browserUrl` to `withCredentials(base, state)` so credentials are embedded into any base URL, and use it for both the printed Local/Network URLs and the in-process browser launch (which previously used `state.url` directly and now matches what the user would see if they copy/pasted the Local URL from the terminal).
@IamCoder18
IamCoder18 force-pushed the fix/console-headless-credentials branch from 1c0eaa5 to 0f57b27 Compare July 18, 2026 00:01

@marius-kilocode marius-kilocode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified the daemon password is a randomUUID rotated on every start and already lives in the local state file, so printing the credentialed URL adds no new exposure beyond the terminal output itself. Headless flow is genuinely broken without this.

@marius-kilocode
marius-kilocode merged commit 290a5af into Kilo-Org:main Jul 28, 2026
29 checks passed
@marius-kilocode

Copy link
Copy Markdown
Collaborator

Merged, thanks @IamCoder18! Nice catch on the headless flow, and thanks for the clean fix.

t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ers (Kilo-Org#12333)

The headless path printed `${urls.local}/console` and `${urls.network}/console` without basic-auth credentials, leaving remote or display-less users unable to reach the console.

Rename `browserUrl` to `withCredentials(base, state)` so credentials are embedded into any base URL, and use it for both the printed Local/Network URLs and the in-process browser launch (which previously used `state.url` directly and now matches what the user would see if they copy/pasted the Local URL from the terminal).
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.

Headless kilo console users can't authenticate into the printed Console URL

2 participants