Repository navigation
fix(runner): skip a preset default session that never logged in next to labelled accounts - #348
Merged
Conversation
…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
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Docker image and
.env.examplepresetTELEGRAM_SESSION_NAME. In a multi-account setup (labelledTELEGRAM_SESSION_STRING_*variables) the unsuffixed file session additionally registers as thedefaultaccount — and if nobody ever logged in through it,_connect_authorized_clientraises 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_accountsmarksdefaultas optional when it comes fromTELEGRAM_SESSION_NAMEnext to labelled accounts (OPTIONAL_ACCOUNTS)._connect_or_skipdrops 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.pycovers the skip path (warning emitted, account removed, others still start) and that a labelled account is still fatal when unauthorized.🤖 Generated with Claude Code