bug(cli): /provider login — "URL copied to clipboard" but no clipboard copy occurs #194

Closed
opened 2026-03-17 02:12:43 +00:00 by jason.woltje · 0 comments
Owner

Description

Running /provider login anthropic returns a success message containing "(URL copied to clipboard)" but no actual clipboard copy is performed. The URL is only displayed as text in a system message.

Root Cause

The gateway CommandExecutorService.handleProvider() (line ~294) hardcodes the string "(URL copied to clipboard)" in the response message, but neither the gateway nor the TUI actually copies anything to the clipboard.

The gateway constructs the login URL and returns it in command:result.data.loginUrl, but:

  1. The gateway cannot copy to clipboard — it is a server process, not a desktop process
  2. The TUI (use-socket.ts line 235) handles command:result by displaying data.message as a system message but never reads data.loginUrl or attempts a clipboard write

Location

  • apps/gateway/src/commands/command-executor.service.ts ~line 294 — misleading "(URL copied to clipboard)" string
  • packages/cli/src/tui/hooks/use-socket.ts line 235 — command:result handler only renders message text, ignores data payload

Fix

The TUI needs to handle the loginUrl from the command:result.data payload and copy it to the clipboard. This is a client-side responsibility since only the TUI process has access to the user's desktop clipboard.

Options:

  1. Use clipboardy package (cross-platform clipboard access for Node.js)
  2. Use pbcopy (macOS) / xclip/xsel (Linux) / clip (Windows) via child_process
  3. Fall back to just displaying the URL if clipboard access fails (e.g., SSH session, headless)

The gateway message should not claim the URL was copied — it should say "Copy this URL" or let the TUI append "(copied to clipboard)" only after a successful clipboard write.

Steps to Reproduce

  1. Open TUI, connect to gateway
  2. Type /provider login anthropic
  3. System message says "(URL copied to clipboard)"
  4. Paste — nothing was copied
## Description Running `/provider login anthropic` returns a success message containing "(URL copied to clipboard)" but no actual clipboard copy is performed. The URL is only displayed as text in a system message. ## Root Cause The gateway `CommandExecutorService.handleProvider()` (line ~294) hardcodes the string "(URL copied to clipboard)" in the response message, but neither the gateway nor the TUI actually copies anything to the clipboard. The gateway constructs the login URL and returns it in `command:result.data.loginUrl`, but: 1. The **gateway** cannot copy to clipboard — it is a server process, not a desktop process 2. The **TUI** (`use-socket.ts` line 235) handles `command:result` by displaying `data.message` as a system message but never reads `data.loginUrl` or attempts a clipboard write ## Location - `apps/gateway/src/commands/command-executor.service.ts` ~line 294 — misleading "(URL copied to clipboard)" string - `packages/cli/src/tui/hooks/use-socket.ts` line 235 — `command:result` handler only renders message text, ignores `data` payload ## Fix The TUI needs to handle the `loginUrl` from the `command:result.data` payload and copy it to the clipboard. This is a **client-side** responsibility since only the TUI process has access to the user's desktop clipboard. Options: 1. Use `clipboardy` package (cross-platform clipboard access for Node.js) 2. Use `pbcopy` (macOS) / `xclip`/`xsel` (Linux) / `clip` (Windows) via `child_process` 3. Fall back to just displaying the URL if clipboard access fails (e.g., SSH session, headless) The gateway message should not claim the URL was copied — it should say "Copy this URL" or let the TUI append "(copied to clipboard)" only after a successful clipboard write. ## Steps to Reproduce 1. Open TUI, connect to gateway 2. Type `/provider login anthropic` 3. System message says "(URL copied to clipboard)" 4. Paste — nothing was copied
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#194