Skip to content

Support starting a new Pi session from Telegram #81

Description

@tlerbao

Feature request

It would be useful if pi-telegram provided a Telegram-native way to start a fresh Pi session, similar to the /new command available in the local Pi TUI.

Current behavior

In a local Pi TUI session, users can run:

/new

to start a new session.

In Telegram, however, /new is not exposed as a bot command. This is understandable because pi-telegram intentionally does not forward arbitrary Pi slash commands or emulate a remote TTY.

Use case

For a long-running NAS/server deployment, a dedicated Pi process is kept alive for Telegram via /telegram-connect. The user may also run separate local Pi sessions over SSH.

In this setup, Telegram needs a clean way to reset/start a new conversation without SSHing into the host or restarting the whole service manually.

Example deployment:

systemd/tmux
  └─ pi
      └─ /telegram-connect

separate SSH sessions may run independent `pi` processes without `/telegram-connect`

Desired behavior

Provide a Telegram-native command or menu action, for example:

/new

or

/new_session

that starts a fresh Pi session for the Telegram-connected runtime.

Ideally this would use an official Pi API for session replacement rather than raw TTY injection. If Pi does not currently expose that API, even a documented recommended pattern would help.

Possible design constraints

  • Should preserve the Telegram polling lock/ownership.
  • Should avoid forwarding arbitrary slash commands from Telegram to the Pi TUI.
  • Should not conflict with separate local Pi sessions.
  • Should probably ask for confirmation if there is active work or queued Telegram prompts.
  • Could be exposed in /start menu as “New session”.

Why this matters

For always-on Telegram deployments, /compact is helpful, but it is not equivalent to starting a completely fresh conversation. Users sometimes need a clean context from Telegram without restarting the daemon/service manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions