Skip to content

fix(runner): skip a preset default session that never logged in next to labelled accounts - #348

Merged
chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/multiaccount-phantom-default
Oct 21, 2026
Merged

chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/multiaccount-phantom-default

Conversation

@axisrow

@axisrow axisrow commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The Docker image and .env.example preset TELEGRAM_SESSION_NAME. In a multi-account setup (labelled TELEGRAM_SESSION_STRING_* variables) the unsuffixed file session additionally registers as the default account — and if nobody ever logged in through it, _connect_authorized_client raises at startup and the whole server refuses to start, even though all the labelled accounts are perfectly usable.

This makes that preset-default optional, and only in that combination:

  • _discover_accounts marks default as optional when it comes from TELEGRAM_SESSION_NAME next to labelled accounts (OPTIONAL_ACCOUNTS).
  • The runner's _connect_or_skip drops such an account on _NotAuthorized: releases its session lock, disconnects, and prints an explanatory warning to stderr. Labelled accounts are never skippable, and a single-account setup still fails loudly, so a misconfigured login can't silently produce a server with zero accounts.

Testing

  • tests/test_runner.py covers the skip path (warning emitted, account removed, others still start) and that a labelled account is still fatal when unauthorized.
  • Full suite: 1413 passed.

🤖 Generated with Claude Code

…to labelled accounts

The Docker image (ENV TELEGRAM_SESSION_NAME) and .env.example (uncommented
TELEGRAM_SESSION_NAME) both set TELEGRAM_SESSION_NAME. With the documented
multi-account setup (TELEGRAM_SESSION_STRING_WORK / _PERSONAL only),
_discover_accounts therefore added a third "default" account backed by a
session nobody logged in to, and the runner refused to start:
"Telegram client 'default' is not authorized", exit code 1.

_discover_accounts now marks that implicit default as optional when labelled
accounts exist, and the runner drops an optional account that turns out not
to be logged in (releasing its lock, with a note on stderr) instead of
exiting. A logged-in default session is still used, and every explicitly
configured account must still be authorized.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Xun6C4mXUAKbVSmiEEh79
@chigwell
chigwell merged commit ad2c221 into chigwell:main Oct 21, 2026
4 checks passed
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.

3 participants