Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Keep the token private. Anyone with the token can control the bot account.

Recommended BotFather settings for a first private-chat release:

1. Use `/setdescription` and `/setabouttext` to explain that this bot controls a local Codex installation.
1. Let the app sync its command list, description, short description, and conservative group-admin defaults automatically on startup.
2. Keep group joins disabled unless you intentionally want group support.
3. Keep privacy mode enabled unless you intentionally need ordinary group text routed to Codex.
4. Add commands later after the private-chat flow works.
4. Add a profile image manually if you want one.

Copy-paste BotFather text, command lists, and privacy recommendations are in [BotFather setup](docs/botfather.md).

Expand Down Expand Up @@ -339,12 +339,15 @@ After a successful test, you should see the transcription in Telegram before the
| `/queue` | View queued prompts for the conversation, then edit, delete, or send one now. |
| `/model` | Show or change the active session model. |
| `/thinking` | Show or change reasoning effort. |
| `/goal` | Show, set, pause, resume, complete, or clear the active session goal. |
| `/status` | Show active session status, including compact Codex usage when available. |
| `/usage` | Show five-hour and weekly Codex usage, with reset times. |
| `/tail [lines]` | Show recent output and keep following the session; defaults to 40 lines. |
| `/outbound` | Inspect delayed or batched Telegram output. |
| `/stop` | Gracefully stop a session. |
| `/restart confirm` | Show standalone-process restart guidance. |
| `/launchpad on\|off\|status` | Arm or disarm root-chat launch mode for plain-text or audio launches; launchpad names lanes from the group title plus a sequence number. |
| `/launch <name> [\| <path>]` | Create a detached git worktree-backed forum topic and Codex session while launchpad is armed. |
| `/topic ...` | Manage forum-topic sessions in allowed supergroups. |

For a fuller operator guide, see [docs/usage.md](docs/usage.md).
Expand Down Expand Up @@ -394,7 +397,7 @@ Groups and forum topics require:
3. BotFather privacy settings that match the desired behavior.
4. Topic-management rights if the bot should create forum topics.

Start privately first. Then use a trusted group root as a single project/session lane, or use forum topics when one group needs multiple independent sessions.
Start privately first. Then use a trusted group root as a single project/session lane, use launchpad mode when you want to fan out repeated plain-text, audio, or `/launch` topic launches quickly, or use forum topics when one group needs multiple independent sessions.

## Support And Security

Expand Down
64 changes: 35 additions & 29 deletions docs/botfather.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ The username must be unique and must end in `bot`.

After BotFather returns the token, store it in the app setup menu, `appsettings.Local.json`, user secrets, or environment variables. Do not paste the token into public issues, screenshots, docs, commits, or demo videos.

The app now syncs its command list, description, short description, and conservative group-admin defaults automatically on startup, so the manual BotFather commands below are only needed if you want to override the defaults yourself.

## Set Description

The description appears when a user first opens the bot conversation.
The app now writes the description automatically on startup. Use this BotFather command only if you want to override the default text manually.

Send this to BotFather:

Expand All @@ -53,12 +55,12 @@ Send this to BotFather:
Choose your bot, then paste:

```text
Talk to a local Codex CLI session from Telegram. This bot runs on the operator's machine, uses an explicit allowlist, and only works after local setup.
Talk to a local Codex installation from Telegram and route prompts to sessions.
```

## Set About Text

The about text is a shorter profile summary.
The app now writes the short profile summary automatically on startup. Use this BotFather command only if you want to override the default text manually.

Send this to BotFather:

Expand All @@ -69,12 +71,12 @@ Send this to BotFather:
Choose your bot, then paste:

```text
Private Telegram control surface for a local Codex CLI session.
Control local Codex sessions from Telegram.
```

## Set Commands

The command list appears in Telegram's command picker when users type `/`.
The app now writes the command picker list automatically on startup. Use this BotFather command only if you want to override the default list manually.

Send this to BotFather:

Expand All @@ -85,37 +87,41 @@ Send this to BotFather:
Choose your bot, then paste:

```text
help - Show supported commands
whoami - Show Telegram user, chat, and topic IDs
version - Show the running app version
trust - Trust the current group or forum chat
doctor - Diagnose authorization, routing, project, session, and queue state
projects - List known local projects
project - Select, add, or show the current project
new - Create and select a Codex session
sessions - List active and managed sessions
use - Select an existing session
send - Send text to the active session
steer - Steer the active turn
queue - View, edit, send, or delete queued prompts
model - Show or change model settings
thinking - Show or change thinking effort
tail - Show recent session output
status - Show session status and compact usage
usage - Show five-hour and weekly Codex usage
outbound - Show outbound Telegram queue status
stop - Stop the active or selected session
topic - Manage forum-topic sessions
topics - List topic/session bindings
restart - Show restart guidance
help - show this help
whoami - show Telegram user, chat, and topic thread IDs
version - show the running Codex Telegram app version
trust - trust the current group or forum chat for allowlisted users
projects - list known project directories
project - add or select a project
topics - list Telegram topics/sessions in this chat
topic - manage forum-topic sessions
launchpad - arm or disarm root-chat launch mode for plain-text and audio launches
launch - create a detached git worktree-backed forum topic and session while launchpad is armed
sessions - show active and Telegram-managed sessions
new - create and select a Codex session in the active project
use - select the active session for this conversation
send - send text to the active session
steer - steer the active turn in the selected session
queue - view, edit, delete, or send queued prompts now
model - show or change the selected session model
thinking - change the selected session thinking effort
goal - show or change the selected session goal
tail - show recent output and keep following the session live
status - show session status
usage - show Codex account usage remaining and reset times
doctor - explain authorization, routing, active project/session, workspace roots, and queue state
outbound - show outbound Telegram queue status
stop - gracefully stop a session
restart - show restart guidance
```

Command behavior:

1. Keep the command descriptions short; Telegram rejects invalid command definitions.
2. BotFather may take a few minutes to reflect command-list changes in every client.
3. Telegram's command picker lists top-level commands only, so `/queue edit`, `/queue delete`, and `/queue send` stay under the `/queue` entry.
4. `/kill`, `/rename`, and `/forget` are supported but intentionally omitted from the public command picker to keep the common menu simple. They remain documented in [command-reference.md](command-reference.md).
4. `/launchpad` and `/launch` are supported so the bot can spawn repeated forum-topic lanes from the group root without keeping launch mode on forever, and launchpad mode can also turn plain text or audio into a seeded launch while it is armed. Each launch provisions a detached git worktree-backed session lane.
5. `/kill`, `/rename`, and `/forget` are supported but intentionally omitted from the public command picker to keep the common menu simple. They remain documented in [command-reference.md](command-reference.md).

## Group Join Setting

Expand Down
103 changes: 103 additions & 0 deletions docs/command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,67 @@ Expected behavior:
2. Leaves the model unchanged.
3. Returns the updated model settings.

### `/goal`

Shows the current Codex goal for the active session.

Syntax:

```text
/goal
```

Expected behavior:

1. Defaults to the active session.
2. Shows goal status, objective, token use when Codex reports it, elapsed goal time when Codex reports it, and last update age.
3. Explains how to set a goal when none is present.
4. Fails with clear setup text if the configured Codex backend or installed app-server does not expose thread goals.

### `/goal [objective]`

Sets a new active goal objective for the active session.

Syntax:

```text
/goal <objective>
/goal set <objective>
```

Examples:

```text
/goal finish the release checklist and stop at the first real blocker
/goal set get /goal working in the Telegram app
```

Expected behavior:

1. Sets the objective on the active Codex thread.
2. Marks the goal active.
3. Shows the updated goal.

### `/goal clear|pause|resume|complete`

Changes or clears the goal for the active session.

Syntax:

```text
/goal clear
/goal pause
/goal resume
/goal complete
```

Expected behavior:

1. `/goal clear` removes the current goal.
2. `/goal pause` marks the current goal paused.
3. `/goal resume` marks the current goal active.
4. `/goal complete` marks the current goal complete.

### Inline Model Control Phrase

Sets model/thinking and sends a prompt in one message.
Expand Down Expand Up @@ -800,6 +861,48 @@ Expected behavior:
2. Shows active session status.
3. Shows active project status when present.

### `/launchpad on|off|status`

Arms or disarms the root chat for repeated launch commands and plain-text or audio launch messages.

Syntax:

```text
/launchpad on
/launchpad off
/launchpad status
```

Expected behavior:

1. Works only from the root of a forum-enabled supergroup.
2. `/launchpad on` arms the root chat for 10 minutes of inactivity.
3. `/launchpad status` shows whether the root chat is armed, the remaining time, the active project, and the launch template session if one is selected.
4. `/launchpad off` clears the armed state immediately.
5. The bot auto-clears expired launchpad state and notifies the root chat when the timeout elapses.
6. While launchpad is armed, plain text or audio messages in the root chat create a new topic/session pair with a deterministic topic title based on the root chat name and a per-chat lane number, then seed the new session with that message text.
7. Launches provision detached git worktrees under the allowed workspace root so each lane has isolated on-disk work.

### `/launch <name> [| <path>]`

Creates a new forum topic and matching Codex session while launchpad is armed, using a detached git worktree.

Syntax:

```text
/launch <name>
/launch <name> | <absolute directory path>
```

Expected behavior:

1. Works only in the root of a forum-enabled supergroup while launchpad is armed.
2. Uses the supplied path when provided and allowed.
3. Provisions a detached git worktree under the allowed workspace root and seeds the new session with the launch name, with the forum topic title capped so long prompts do not become the topic name.
3. Otherwise uses the active project for the current conversation.
4. Creates a Telegram topic and Codex session, then binds them together.
5. Copies the current root session's model and thinking settings onto the launched session when a root session is selected; otherwise the launched session uses the normal Codex defaults.

### `/topic new <name> [| <path>]`

Creates a new Telegram forum topic and matching Codex session.
Expand Down
16 changes: 10 additions & 6 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ Follow this sequence:
5. Copy the token BotFather gives you.
6. Keep that token private. Anyone with the token can control the bot.

Optional BotFather steps that are worth doing:
The app now syncs its command list, description, about text, and conservative group-admin defaults automatically on startup, so you usually do not need to set those by hand.

1. `/setdescription` to add a short explanation of what the bot does.
2. `/setabouttext` to add a slightly longer summary.
3. `/setuserpic` to give the bot a recognizable avatar.
4. `/setcommands` if you want Telegram's UI to show a command list.
5. `/revoke` if you ever leak the token and need to rotate it.
Optional BotFather steps that are still worth doing:

1. `/setuserpic` to give the bot a recognizable avatar.
2. `/revoke` if you ever leak the token and need to rotate it.

Copy-paste BotFather text, command lists, and recommended first-release settings are in [botfather.md](botfather.md).

Expand Down Expand Up @@ -422,6 +421,7 @@ The supported flow is:
4. Optionally use `/topic new <name> | <absolute directory path>` to start the topic in a specific project.
5. Use `/topic attach [sessionId]` to bind the current topic to an existing session.
6. Use `/topic current` to see the active binding.
7. Use `/launchpad on` in the group root when you want to spawn several independent topics quickly; then send a plain-text or voice launch message, or use `/launch <name>`, for each new detached worktree-backed lane. Launchpad titles the new topic from the group name plus a lane number so long prompts do not become the topic name.

Behavior to remember:

Expand All @@ -430,6 +430,7 @@ Behavior to remember:
3. If ordinary text appears to do nothing in a topic, use `/send <text>` or revisit privacy settings.
4. If Telegram rejects a reply to a stale, closed, or deleted topic, the bot does not retry the message in the group root.
5. The topic thread ID is useful when you want to debug or trace where messages are going.
6. Launchpad mode automatically turns off after 10 minutes of inactivity.

## Voice Notes, Audio, And Attachments

Expand Down Expand Up @@ -467,6 +468,8 @@ For a complete parameter-by-parameter reference, see [command-reference.md](comm
| `/project current` | Shows the current project binding. | Use to confirm what the conversation is anchored to. |
| `/topics` | Lists Telegram topics and chat sessions in the conversation. | Use in chats with multiple topic threads. |
| `/topic list` | Same as `/topics`. | Use whichever form is easiest to remember. |
| `/launchpad on` | Arms the group root for repeated plain-text or audio launches and `/launch` commands. | Use when you want to fan out multiple detached worktree-backed topic/session lanes quickly. |
| `/launch <name> \| <path>` | Creates a new topic, session, and detached git worktree while launchpad is armed. | Use with or without an explicit project path. |
| `/topic new <name>` | Creates a new forum topic and a new Codex session. | Use in a forum-enabled supergroup. |
| `/topic new <name> | <path>` | Creates a new topic and session in a specific project directory. | Use when you want the topic tied to a particular repo. |
| `/topic attach [sessionId]` | Binds the current forum topic to an existing Codex session. | Use when you want a topic to resume work instead of creating a new session. |
Expand All @@ -480,6 +483,7 @@ For a complete parameter-by-parameter reference, see [command-reference.md](comm
| `/queue` | Shows queued prompts with Send now, Edit, and Delete buttons. | Use when you want to inspect or change prompts waiting behind an active turn. |
| `/model [model] [thinking <effort>]` | Shows or changes the selected session model. | Use when you need to switch the active model. |
| `/thinking <minimal|low|medium|high|xhigh>` | Changes the reasoning effort for the selected session. | Use when you want more or less reasoning budget. |
| `/goal [objective|clear|pause|resume|complete]` | Shows or changes the selected session goal. | Use when you want Codex to keep a thread-level objective. |
| `/tail [count]` | Shows recent output and keeps following the session. | Use while waiting on a live turn. |
| `/status [sessionId]` | Shows session status and compact Codex usage when available. | Use when you want a quick health check. |
| `/usage` | Shows five-hour and weekly Codex usage and reset times. | Use when planning around Codex usage blocks. |
Expand Down
13 changes: 8 additions & 5 deletions docs/manual-test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ Record the date, operator, OS, published asset or commit SHA, Codex CLI version,
9. Send `/doctor` and confirm it explains access, routing, active project/session state, workspace roots, queue state, and a plausible next action.
10. Send `/new` and confirm the reply uses an auto-generated project-based session name without noisy status/model/thinking buttons; if Codex rate limits are available, confirm it includes a compact `Rate limits` line.
11. Send a normal text prompt and confirm live output returns to the private chat.
12. Send `/tail`, `/status`, `/usage`, `/model`, and `/thinking` and confirm each command is understandable without stale or truncated buttons; `/status`, `/model`, and `/thinking` should include compact rate limits when available.
13. Send `/stop` and confirm pending queued messages for the session are cleared.
12. Send `/tail`, `/status`, `/usage`, `/model`, `/thinking`, and `/goal` and confirm each command is understandable without stale or truncated buttons; `/status`, `/model`, and `/thinking` should include compact rate limits when available.
13. Send `/goal finish the private-chat smoke test`, then `/goal`, `/goal pause`, `/goal resume`, and `/goal clear`; confirm each reply reflects the expected objective or status when the installed Codex app-server supports thread goals.
14. Send `/stop` and confirm pending queued messages for the session are cleared.

## Authorization

Expand All @@ -48,9 +49,11 @@ Record the date, operator, OS, published asset or commit SHA, Codex CLI version,
6. If ordinary group text is part of the demo, disable privacy mode in BotFather, re-add the bot if needed, and confirm ordinary text routes only in the intended trusted group or topic.
7. In a forum-enabled supergroup, run `/topic new <name>` with the bot missing topic-management rights and confirm the error is understandable.
8. Grant the needed topic rights and rerun `/topic new <name>`.
9. Send messages in two topics and confirm each topic remains bound to its own session.
10. Close, delete, or otherwise invalidate a test topic when practical and confirm topic-scoped output is not retried in the group root.
11. Restart the process and confirm topic/session bindings rehydrate from local state.
9. Arm the group root with `/launchpad on`, send a plain-text or voice launch message from the root, and confirm a new topic/session pair is created, seeded from the root chat, and provisioned in a detached worktree.
10. Launch from a subdirectory project path and confirm the new session keeps the matching relative subpath inside the detached worktree.
11. Send messages in two topics and confirm each topic remains bound to its own session.
12. Close, delete, or otherwise invalidate a test topic when practical and confirm topic-scoped output is not retried in the group root.
13. Restart the process and confirm topic/session bindings rehydrate from local state.

## Voice And Attachments

Expand Down
2 changes: 2 additions & 0 deletions docs/menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Common commands:

```text
/topic new docs polish
/launchpad on
/launch docs polish
/topic current
/topic attach <sessionId>
/topics
Expand Down
2 changes: 1 addition & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ For groups and forum topics:
1. Add only trusted users to `TelegramBot:AllowedUserIds`.
2. Trust the group with `/trust` from an allowlisted admin account, or add the group chat ID to `TelegramBot:AllowedChatIds`.
3. Keep Telegram privacy mode enabled unless ordinary group-root text should route to Codex.
4. Grant topic-management rights only if `/topic new` is part of the supported workflow.
4. Grant topic-management rights only if `/topic new`, `/launch`, or launchpad launch mode is part of the supported workflow.

Group and forum messages require both an allowed user and a trusted chat.

Expand Down
Loading
Loading