Skip to content

refactor(session)!: log in by QR through cli-core's loginQr, add --qr-file, drop the browser fallback - #736

Merged
leemour merged 3 commits into
mainfrom
feat/shared-login-qr
Oct 19, 2026
Merged

leemour merged 3 commits into
mainfrom
feat/shared-login-qr

Conversation

@leemour

@leemour leemour commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

tg, max and wa now share cli-core 0.347.0's loginQr (cli-core #1595), under the owner's rule that the
CLIs never diverge. max had its own drawer, opened the code in a browser on a narrow terminal, and had no
--qr-file.

  • session start qr and setup take --qr-file <png>, as tg and wa do. The image is written with mode
    0600 through a temporary file renamed over the path (WC-SECR-10). The login's finally removes it; it is
    also tracked, so the runner closes it on --timeout or Ctrl+C even if that finally never runs. A test
    aborts a login mid-poll and finds no file; it passes with or without the tracking, so it does not isolate it.
  • Without a terminal, session start qr and setup give the shared refusal ("shows a QR code to scan —
    run it in a terminal, or pass --qr-file "); qr-chrome and sms keep their own. A MAX cloud
    password still needs a terminal.
  • max's own interactive check (stdin and stderr are terminals, --no-input respected) still decides
    whether there is a terminal; it is stricter than cli-core's atTerminal, and the tests inject it.
  • BREAKING: a narrow terminal no longer opens the code in the browser. It draws nothing and says to widen
    the terminal or pass --qr-file. A browser that opens by itself could not move into cli-core for all
    three CLIs, and WC-CMD-15 already turns browser logins off when nobody is at the terminal. The cost is
    real for max: MAX issues one code per run, so a narrow-terminal user presses Ctrl+C and runs again,
    wider or with --qr-file. tg and wa renew their codes, so a widened window draws the next one.
  • Removed, used only by that path: src/session/qr-terminal.ts, serveQrPage, the browser door's
    open(), and the qrcode-generator dependency.
  • Changelog (says why the fallback is gone), docs/sessions.md, docs/commands.md, the skill and the
    test matrix updated. Pins @wirecat/cli-core 0.347.0 exactly.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com

@leemour
leemour force-pushed the feat/shared-login-qr branch from b3ea0f1 to 54e1657 Compare October 18, 2026 22:11
…le, and no browser fallback

max drew its own QR code and, on a terminal too narrow for it, served it
from 127.0.0.1 and opened the default browser. tg and wa draw cli-core's
code and take --qr-file. max now matches them through loginQr
(cli-core 0.347.0, already pinned on main):

- session start qr and setup take --qr-file <png>; the image is a
  temporary file created 0600 and renamed over the path (WC-SECR-10),
  and is removed after the login, also when the command is cut
- a narrow terminal draws nothing and says to widen it or pass --qr-file;
  nothing is opened implicitly, so the same behaviour lives in cli-core
  for all three
- without a terminal, qr gets the shared refusal; qr-chrome and sms keep
  theirs, and a cloud password still needs a terminal

Removed: src/session/qr-terminal.ts, serveQrPage and the browser door's
open(), and the qrcode-generator dependency, all used only by that path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour
leemour force-pushed the feat/shared-login-qr branch from 1d34382 to 9f876b4 Compare October 18, 2026 22:27
leemour and others added 2 commits October 19, 2026 00:33
… in the test matrix

The test matrix check found setup --qr-file with no test. A login
without a terminal now writes the code to a mode-600 PNG that is removed
after, and --qr-file is refused for qr-chrome before MAX is contacted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…he image goes on a cut login

- `max <profile> setup` with no terminal and no --qr-file now throws cli-core's qrNeedsTerminal,
  the same refusal `session start qr`, tg and wa give; qr-chrome and sms keep a browser-only one.
- --qr-file is checked against undefined in setup as in `session start`, so an empty value is not
  silently ignored.
- New test: a --qr-file login aborted while MAX is polled leaves no image behind.
- Changelog says why the browser fallback is gone and that setup's refusal changed too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour leemour changed the title refactor(session)!: QR login through cli-core's loginQr, with --qr-file, and no browser fallback refactor(session)!: log in by QR through cli-core's loginQr, add --qr-file, drop the browser fallback Oct 19, 2026
@leemour
leemour merged commit 9488d2a into main Oct 19, 2026
11 checks passed
@leemour leemour mentioned this pull request Oct 19, 2026
leemour added a commit that referenced this pull request Oct 19, 2026
Version and the dated changelog for 0.64.0: «Не выпущено» → `0.64.0 —
19.10.2026`, package.json, src/version.ts.
Nothing else. `pnpm release:check` passes 15/15 on this commit.

Since v0.63.0: #736 (QR login through cli-core's `loginQr`, `--qr-file`,
no browser fallback), #740 (cli-core 0.348.0
/ cli-base 0.47.0), #742 and #743 (cli-core 0.350.0; the scan line only
after a drawn QR code; setup's login step
headed "Link this device").

Live: `pnpm smoke:live` and the other live checks are **skipped** — no
live connection to the owner's MAX account was
allowed. The owner will run them in the morning.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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