@foxden-app/foxclaw 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README_EN.md CHANGED
@@ -1,297 +1,300 @@
1
- [中文](./README.md) | English
2
-
3
- # 🦊 FoxClaw
4
-
5
- **A mobile-first AI coding assistant built for programming workflows.**
6
-
7
- FoxClaw lets you control your local Codex from your phone via Telegram or Weixin. Leave your desk for lunch, hop on a treadmill, or take the kids to the park your Codex keeps coding and reports back to you in real time.
8
-
9
- No public server required. FoxClaw runs on your own computer, talks to `codex app-server` locally, handles approvals on your machine, and pushes results back to your phone.
10
-
11
- ## Why FoxClaw
12
-
13
- **Why Codex as the underlying engine?**
14
-
15
- 1. **Open source with complete APIs** — Codex is OpenAI's open-source CLI agent. It ships `codex app-server` with a full JSON-RPC interface that external programs can control precisely.
16
- 2. **Strong GPT model performance** — Codex uses GPT-series models (o3, o4-mini, etc.) that deliver excellent real-world coding results.
17
- 3. **Multi-account quota rotation** — Rotate across multiple OpenAI accounts (free tier, Plus trials, Team trials) automatically. When one account hits the 5-hour usage limit, FoxClaw switches to the next available account and keeps working.
18
-
19
- **Built for these scenarios:**
20
-
21
- - 🍜 Leave your desk for lunch — Codex keeps coding, tap to approve when needed
22
- - 🚶 Commuting or traveling — dispatch coding tasks and check progress without opening a laptop
23
- - 🏃 On the treadmill or at the park with kids monitor coding progress and handle approvals
24
- - 🔒 Code, shell, auth, approvals, and runtime data stay on your machine nothing exposed to the public internet
25
- - 👤 Only one trusted Telegram user can operate the bot
26
-
27
- ## Start Here
28
-
29
- - Already have a shell-capable agent such as Codex, OpenClaw, QwenPaw, Hermes, OpenCode, or Kimi CLI? Use the [Agent-Assisted Install](./docs/agent-assisted-install.md) first. This is the recommended path.
30
- - New to Node, Telegram bots, or Codex CLI? Use the [Beginner Install Guide](./docs/install-for-beginners.md).
31
- - Already comfortable with Git, Node, and `.env` files? Use the quick setup below.
32
- - Something failed? Check [Troubleshooting](./docs/troubleshooting.md).
33
-
34
- The minimum install needs only a Telegram bot token, your numeric Telegram user id, Node.js 24, and a logged-in `codex` CLI. A first install usually takes 10–20 minutes.
35
-
36
- **30-second demo**: after FoxClaw is running, send `List files in DEFAULT_CWD` to your Telegram bot. FoxClaw asks local Codex to inspect that folder on your computer and sends the answer back to Telegram.
37
-
38
- ## Requirements
39
-
40
- - macOS or Linux with a working `codex` CLI
41
- - Codex authenticated on the host machine
42
- - Node.js 24+
43
- - A Telegram bot token from `@BotFather`
44
- - Your Telegram numeric user id
45
-
46
- ## Quick Setup
47
-
48
- ```bash
49
- npm install -g @foxden-app/foxclaw
50
- foxclaw init
51
- $EDITOR ~/.foxclaw/.env
52
- foxclaw doctor
53
- foxclaw start
54
- ```
55
-
56
- pnpm users:
57
-
58
- ```bash
59
- pnpm add -g @foxden-app/foxclaw
60
- foxclaw init
61
- $EDITOR ~/.foxclaw/.env
62
- foxclaw doctor
63
- foxclaw start
64
- ```
65
-
66
- Edit `.env` before running `doctor` or `start`. Minimum private-chat config:
67
-
68
- ```dotenv
69
- TG_BOT_TOKEN=123456:telegram-token
70
- TG_ALLOWED_USER_ID=123456789
71
- DEFAULT_CWD=/absolute/path/to/workspace
72
- DEFAULT_APPROVAL_POLICY=on-request
73
- DEFAULT_SANDBOX_MODE=workspace-write
74
- ```
75
-
76
- The default config file is `~/.foxclaw/.env`. Set `FOXCLAW_ENV=/path/to/.env` if you want to keep it somewhere else.
77
-
78
- `foxclaw start` runs checks and installs or restarts the background service. It is idempotent — run it again after upgrading.
79
-
80
- FoxClaw accepts messages only from `TG_ALLOWED_USER_ID`. Putting the bot in a group does not make it available to every group member.
81
-
82
- <details>
83
- <summary>What FoxClaw can do after it is running</summary>
84
-
85
- **Core capabilities:**
86
- - Telegram private chat, group, and topic control for your local Codex
87
- - Optional Weixin/iLink channel sharing the same bridge core
88
- - Full thread lifecycle management from mobile: create, rename, archive, fork, rollback, compact, review, diff
89
- - Inline approval buttons for commands, file changes, and granular permissions one tap to approve
90
- - MCP elicitation cards for structured questions raised by tools during a turn
91
-
92
- **Multi-account management:**
93
- - Codex account controls: `/account`, `/quota`, `/login_device`, `/auth add <name>`
94
- - Automatic auth rotation across local `auth.json_*` files when a usage limit is hit — seamless account switching
95
- - `/auth` panel to view, enable, disable, and switch between candidate accounts
96
-
97
- **Threads and sessions:**
98
- - `/threads`, `/open`, `/new`, `/where`, `/interrupt` sticky chat-to-thread binding
99
- - Chat-scoped setup panel for model, reasoning effort, Fast tier, access preset, Agent/Plan mode
100
- - Skills, MCP, hooks, plugins, apps, feature flags, config, requirements, and provider diagnostics
101
-
102
- **Reliability:**
103
- - SQLite persistence for bindings, offsets, approvals, pending input prompts, and audit logs
104
- - Single-instance process lock to prevent duplicate Telegram polling on the same bot token
105
-
106
- </details>
107
-
108
- ## Multi-Account Rotation
109
-
110
- A key FoxClaw feature is automatic multi-account switching. When one account's 5-hour usage limit is triggered, FoxClaw automatically switches to the next available account and continues working.
111
-
112
- Setup:
113
-
114
- 1. Place multiple auth files in the Codex auth directory (usually `~/.codex/`), named like `auth.json_personal`, `auth.json_team`, etc.
115
- 2. Use `/auth add <name>` to add new accounts directly from Telegram.
116
- 3. Use `/auth` to view all candidate account statuses.
117
- 4. Use `/auth enable <n>` / `/auth disable <n>` to control which accounts participate in auto-rotation.
118
-
119
- When Codex reports a usage-limit error, FoxClaw automatically:
120
- - Switches to the next non-failed candidate account
121
- - Restarts app-server to load the new auth
122
- - Retries the failed request with the new account
123
-
124
- ## Service And Debugging
125
-
126
- Recommended:
127
-
128
- ```bash
129
- foxclaw start
130
- ```
131
-
132
- It installs or restarts the Linux user systemd service, or loads/reloads launchd on macOS. To inspect Linux service state:
133
-
134
- ```bash
135
- systemctl --user status foxclaw.service
136
- journalctl --user -u foxclaw.service -f
137
- ```
138
-
139
- For foreground debugging:
140
-
141
- ```bash
142
- foxclaw serve
143
- ```
144
-
145
- Default runtime files are stored under `~/.foxclaw`:
146
-
147
- | Purpose | Path |
148
- |---------|------|
149
- | Database | `~/.foxclaw/data/bridge.sqlite` |
150
- | Bridge log | `~/.foxclaw/logs/service.log` |
151
- | Status | `~/.foxclaw/runtime/status.json` |
152
- | App-server state | `~/.foxclaw/runtime/codex-app-server.json` |
153
- | App-server log | `~/.foxclaw/logs/codex-app-server.log` |
154
-
155
- Override with `STORE_PATH`, `LOCK_PATH`, `CODEX_APP_SERVER_STATE_PATH`, and `CODEX_APP_SERVER_LOG_PATH`.
156
-
157
- ## Migrating From telegram-codex-app-bridge
158
-
159
- FoxClaw was originally forked from `Gan-Xing/telegram-codex-app-bridge` and remains distributed under the MIT License.
160
-
161
- When upgrading an existing local install:
162
-
163
- ```bash
164
- systemctl --user disable --now telegram-codex-app-bridge.service 2>/dev/null || true
165
- test -e ~/.foxclaw || cp -a ~/.telegram-codex-app-bridge ~/.foxclaw
166
- foxclaw start
167
- ```
168
-
169
- For launchd installs, unload the old plist if present:
170
-
171
- ```bash
172
- launchctl unload ~/Library/LaunchAgents/com.ganxing.telegram-codex-app-bridge.plist 2>/dev/null || true
173
- foxclaw start
174
- ```
175
-
176
- The old runtime directory is not read automatically. Copy it once if you want to keep existing bindings, cached thread lists, approvals, and status data.
177
-
178
- ## Telegram Setup
179
-
180
- 1. Create a bot with `@BotFather` and copy the token into `TG_BOT_TOKEN`.
181
- 2. Get your Telegram numeric user id and place it into `TG_ALLOWED_USER_ID`.
182
- 3. Start FoxClaw with `foxclaw start`.
183
- 4. Open a private chat with the bot and send `/help`.
184
-
185
- Optional group/topic config:
186
-
187
- ```dotenv
188
- TG_ALLOWED_CHAT_ID=-1001234567890
189
- TG_ALLOWED_TOPIC_ID=42
190
- ```
191
-
192
- - Leave `TG_ALLOWED_CHAT_ID` empty for private-chat mode.
193
- - Set `TG_ALLOWED_CHAT_ID` only to allow one group as the default conversation scope.
194
- - Set both `TG_ALLOWED_CHAT_ID` and `TG_ALLOWED_TOPIC_ID` to bind one topic as the default scope.
195
- - Private chat remains available for `TG_ALLOWED_USER_ID` even when a group is configured.
196
-
197
- **How to find group and topic IDs:**
198
-
199
- 1. Stop FoxClaw.
200
- 2. Send a message in the target group or topic.
201
- 3. Open `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates`.
202
- 4. Read `message.chat.id` as `TG_ALLOWED_CHAT_ID`.
203
- 5. Read `message.message_thread_id` as `TG_ALLOWED_TOPIC_ID`.
204
-
205
- If FoxClaw is still running, it may consume the update before you inspect it.
206
-
207
- ## Telegram Group Checklist
208
-
209
- For natural-language messages in a group or supergroup:
210
-
211
- 1. Add the bot to the target group.
212
- 2. Disable the bot's `privacy mode` in `@BotFather`.
213
- 3. Promote the bot to administrator in that group.
214
- 4. If privacy mode was changed after adding the bot, remove and re-add the bot.
215
-
216
- Explicit commands such as `/status@botname` can work even when privacy mode blocks normal messages, so use a plain message to verify group setup.
217
-
218
- ## Codex App-Server Lifecycle
219
-
220
- By default:
221
-
222
- ```dotenv
223
- CODEX_APP_AUTOLAUNCH=true
224
- CODEX_APP_LAUNCH_CMD=codex app
225
- CODEX_APP_SERVER_STATE_PATH=
226
- CODEX_APP_SERVER_LOG_PATH=
227
- CODEX_APP_SYNC_ON_OPEN=true
228
- CODEX_APP_SYNC_ON_TURN_COMPLETE=false
229
- ```
230
-
231
- FoxClaw starts `codex app-server` as a detached, bridge-managed process and records its pid and port. On restart, it reconnects to the recorded app-server if that process is still alive; otherwise it starts a new one. `/auth_reload` and auth switching restart the managed app-server so the current `auth.json` is reloaded.
232
-
233
- No static Codex app-server port is required in normal installs.
234
-
235
- ## Commands
236
-
237
- - `/help`
238
- - `/setup` — unified preference panel
239
- - `/fast <on|off|toggle>`
240
- - `/active <steer|queue>`
241
- - `/status`, `/account`, `/quota`
242
- - `/quota_nudge <credits|usage_limit> confirm`
243
- - `/login_device`, `/login_cancel [id]`, `/logout confirm`
244
- - `/auth [list|use <n>|enable <n>|disable <n>|reload|add <name>]`
245
- - `/threads [query]`, `/threads archived`, `/open <n>`
246
- - `/goal [objective|pause|resume|done|budget <tokens|off>|clear confirm]`
247
- - `/history [limit]`, `/files <query>`, `/remote`
248
- - `/new [cwd]`
249
- - `/steer <message>`, `/takeover <message>`, `/queue <message>`
250
- - `/review [base <branch>|commit <sha>|custom <instructions>]`
251
- - `/diff`, `/fork [name]`, `/undo [n]`, `/rollback [n]`
252
- - `/rename <name>`, `/compact`, `/archive`, `/unarchive <n>`
253
- - `/skills [query]`, `/skill <name>`, `/skill_enable <name>`, `/skill_disable <name>`
254
- - `/loaded`, `/hooks`, `/plugins [query]`, `/apps [reload]`, `/features`, `/config`, `/requirements`, `/provider`
255
- - `/mcp`, `/mcp_reload`, `/mcp_login <server>`, `/mcp_resource <server> <uri>`
256
- - `/models`, `/model`, `/effort`, `/permissions`, `/access`, `/mode`, `/plan`, `/agent`
257
- - `/reveal`, `/where`, `/interrupt`
258
-
259
- Plain text sends to the current thread, or creates a new one if none is bound.
260
-
261
- ## Weixin/iLink
262
-
263
- Weixin support is optional and disabled by default:
264
-
265
- ```dotenv
266
- WX_ENABLED=true
267
- WX_ALLOWED_ILINK_USER_IDS=
268
- ```
269
-
270
- Run the QR login helper once after building:
271
-
272
- ```bash
273
- foxclaw weixin-login
274
- ```
275
-
276
- Weixin runtime files default to `~/.foxclaw/weixin`.
277
-
278
- ## Codex Skill
279
-
280
- This repo ships a Codex skill at [`skills/foxclaw`](./skills/foxclaw). Use it when you want Codex to bootstrap FoxClaw locally or on another Mac over SSH — write `.env`, build, run doctor, install launchd, and guide first-message validation.
281
-
282
- ## Troubleshooting
283
-
284
- See [Troubleshooting](./docs/troubleshooting.md) for `doctor` failures, Telegram no-reply cases, service logs, reboot behavior, and migration issues.
285
-
286
- ## Operations
287
-
288
- ```bash
289
- foxclaw doctor
290
- foxclaw status
291
- foxclaw start
292
- foxclaw uninstall-systemd
293
- ```
294
-
295
- ## Contributing
296
-
297
- Issues and PRs are welcome at [GitHub](https://github.com/foxden-app/foxclaw).
1
+ [中文](./README.md) | English
2
+
3
+ # 🦊 FoxClaw
4
+
5
+ **A mobile Codex controller built for real programming workflows.**
6
+
7
+ FoxClaw turns your phone into a practical web coding cockpit for your local Codex. Telegram or Weixin handles the chat interface, `codex app-server` handles local execution, and you can send tasks, inspect progress, approve actions, switch threads, and keep working without opening a laptop.
8
+
9
+ It is built for the moments when you leave your desk for lunch, commute, travel, use a treadmill, or take the kids to the park. You can step away from the keyboard while Codex keeps coding and sends progress, errors, approval requests, and final results back to your phone.
10
+
11
+ No public server required. FoxClaw runs on your own computer, talks to `codex app-server` locally, and keeps code, shell access, auth, approvals, and runtime data on that machine.
12
+
13
+ ## Why FoxClaw
14
+
15
+ **Why Codex as the underlying engine?**
16
+
17
+ 1. **Open source with complete APIs** — Codex is OpenAI's open-source CLI agent and ships `codex app-server`. FoxClaw does not scrape a terminal; it uses the app-server interface to read threads, switch models, handle approvals, and resume sessions.
18
+ 2. **Strong current coding experience** — FoxClaw reads the model list from your local Codex app-server. If your Codex environment has GPT-5.5 available, you can select and use it from your phone. For many heavy coding workflows, Codex/GPT-5.5 is already the reason to choose this stack.
19
+ 3. **Multi-account quota rotation** — Free quota, trial Plus/Team accounts, and small account-specific allowances can all live as local `auth.json_*` candidates. When one account hits a 5-hour usage limit, FoxClaw switches to the next available account, restarts app-server, and retries the failed request.
20
+
21
+ **Built for these scenarios:**
22
+
23
+ - 🍜 Leave your desk for lunch Codex keeps coding, tap to approve when needed
24
+ - 🚶 Commute or travel dispatch tasks, inspect progress, and continue debugging without a laptop
25
+ - 🏃 Use a treadmill or spend time at the park — monitor Codex's coding process from your phone
26
+ - 🔒 Code, shell, auth, approvals, and runtime data stay on your machine — nothing exposed to the public internet
27
+ - 👤 Only one trusted Telegram user can operate the bot
28
+
29
+ ## Start Here
30
+
31
+ - Already have a shell-capable agent such as Codex, OpenClaw, QwenPaw, Hermes, OpenCode, or Kimi CLI? Use the [Agent-Assisted Install](./docs/agent-assisted-install.md) first. This is the recommended path.
32
+ - New to Node, Telegram bots, or Codex CLI? Use the [Beginner Install Guide](./docs/install-for-beginners.md).
33
+ - Already installed and want the full command guide for `/help`, `/setup`, `/threads`, `/watch`, `/auth`, and auth rotation? Read the [User Manual](./docs/user-manual.md).
34
+ - Already comfortable with Git, Node, and `.env` files? Use the quick setup below.
35
+ - Something failed? Check [Troubleshooting](./docs/troubleshooting.md).
36
+
37
+ The minimum install needs only a Telegram bot token, your numeric Telegram user id, Node.js 24, and a logged-in `codex` CLI. A first install usually takes 10–20 minutes.
38
+
39
+ **30-second demo**: after FoxClaw is running, send `List files in DEFAULT_CWD` to your Telegram bot. FoxClaw asks local Codex to inspect that folder on your computer and sends the answer back to Telegram.
40
+
41
+ ## Requirements
42
+
43
+ - macOS or Linux with a working `codex` CLI
44
+ - Codex authenticated on the host machine
45
+ - Node.js 24+
46
+ - A Telegram bot token from `@BotFather`
47
+ - Your Telegram numeric user id
48
+
49
+ ## Quick Setup
50
+
51
+ ```bash
52
+ npm install -g @foxden-app/foxclaw
53
+ foxclaw init
54
+ $EDITOR ~/.foxclaw/.env
55
+ foxclaw doctor
56
+ foxclaw start
57
+ ```
58
+
59
+ pnpm users:
60
+
61
+ ```bash
62
+ pnpm add -g @foxden-app/foxclaw
63
+ foxclaw init
64
+ $EDITOR ~/.foxclaw/.env
65
+ foxclaw doctor
66
+ foxclaw start
67
+ ```
68
+
69
+ Edit `.env` before running `doctor` or `start`. Minimum private-chat config:
70
+
71
+ ```dotenv
72
+ TG_BOT_TOKEN=123456:telegram-token
73
+ TG_ALLOWED_USER_ID=123456789
74
+ DEFAULT_CWD=/absolute/path/to/workspace
75
+ DEFAULT_APPROVAL_POLICY=on-request
76
+ DEFAULT_SANDBOX_MODE=workspace-write
77
+ ```
78
+
79
+ The default config file is `~/.foxclaw/.env`. Set `FOXCLAW_ENV=/path/to/.env` if you want to keep it somewhere else.
80
+
81
+ `foxclaw start` runs checks and installs or restarts the background service. It is idempotent — run it again after upgrading.
82
+
83
+ FoxClaw accepts messages only from `TG_ALLOWED_USER_ID`. Putting the bot in a group does not make it available to every group member.
84
+
85
+ <details>
86
+ <summary>What FoxClaw can do after it is running</summary>
87
+
88
+ **Core capabilities:**
89
+ - Telegram private chat, group, and topic control for your local Codex
90
+ - Optional Weixin/iLink channel sharing the same bridge core
91
+ - Full thread lifecycle management from mobile: create, rename, archive, fork, rollback, compact, review, diff
92
+ - Inline approval buttons for commands, file changes, and granular permissions — one tap to approve
93
+ - MCP elicitation cards for structured questions raised by tools during a turn
94
+
95
+ **Multi-account management:**
96
+ - Codex account controls: `/account`, `/quota`, `/login_device`, `/auth add <name>`
97
+ - Automatic auth rotation across local `auth.json_*` files when a usage limit is hit — seamless account switching
98
+ - `/auth` panel to view, enable, disable, and switch between candidate accounts
99
+
100
+ **Threads and sessions:**
101
+ - `/threads`, `/open`, `/new`, `/where`, `/interrupt` — sticky chat-to-thread binding
102
+ - Chat-scoped setup panel for model, reasoning effort, Fast tier, access preset, Agent/Plan mode
103
+ - Skills, MCP, hooks, plugins, apps, feature flags, config, requirements, and provider diagnostics
104
+
105
+ **Reliability:**
106
+ - SQLite persistence for bindings, offsets, approvals, pending input prompts, and audit logs
107
+ - Single-instance process lock to prevent duplicate Telegram polling on the same bot token
108
+
109
+ </details>
110
+
111
+ ## Multi-Account Rotation
112
+
113
+ A key FoxClaw feature is automatic multi-account switching. When one account's 5-hour usage limit is triggered, FoxClaw automatically switches to the next available account and continues working.
114
+
115
+ Setup:
116
+
117
+ 1. Place multiple auth files in the Codex auth directory (usually `~/.codex/`), named like `auth.json_personal`, `auth.json_team`, etc.
118
+ 2. Use `/auth add <name>` to add new accounts directly from Telegram.
119
+ 3. Use `/auth` to view all candidate account statuses.
120
+ 4. Use `/auth enable <n>` / `/auth disable <n>` to control which accounts participate in auto-rotation.
121
+
122
+ When Codex reports a usage-limit error, FoxClaw automatically:
123
+ - Switches to the next non-failed candidate account
124
+ - Restarts app-server to load the new auth
125
+ - Retries the failed request with the new account
126
+
127
+ ## Service And Debugging
128
+
129
+ Recommended:
130
+
131
+ ```bash
132
+ foxclaw start
133
+ ```
134
+
135
+ It installs or restarts the Linux user systemd service, or loads/reloads launchd on macOS. To inspect Linux service state:
136
+
137
+ ```bash
138
+ systemctl --user status foxclaw.service
139
+ journalctl --user -u foxclaw.service -f
140
+ ```
141
+
142
+ For foreground debugging:
143
+
144
+ ```bash
145
+ foxclaw serve
146
+ ```
147
+
148
+ Default runtime files are stored under `~/.foxclaw`:
149
+
150
+ | Purpose | Path |
151
+ |---------|------|
152
+ | Database | `~/.foxclaw/data/bridge.sqlite` |
153
+ | Bridge log | `~/.foxclaw/logs/service.log` |
154
+ | Status | `~/.foxclaw/runtime/status.json` |
155
+ | App-server state | `~/.foxclaw/runtime/codex-app-server.json` |
156
+ | App-server log | `~/.foxclaw/logs/codex-app-server.log` |
157
+
158
+ Override with `STORE_PATH`, `LOCK_PATH`, `CODEX_APP_SERVER_STATE_PATH`, and `CODEX_APP_SERVER_LOG_PATH`.
159
+
160
+ ## Migrating From telegram-codex-app-bridge
161
+
162
+ FoxClaw was originally forked from `Gan-Xing/telegram-codex-app-bridge` and remains distributed under the MIT License.
163
+
164
+ When upgrading an existing local install:
165
+
166
+ ```bash
167
+ systemctl --user disable --now telegram-codex-app-bridge.service 2>/dev/null || true
168
+ test -e ~/.foxclaw || cp -a ~/.telegram-codex-app-bridge ~/.foxclaw
169
+ foxclaw start
170
+ ```
171
+
172
+ For launchd installs, unload the old plist if present:
173
+
174
+ ```bash
175
+ launchctl unload ~/Library/LaunchAgents/com.ganxing.telegram-codex-app-bridge.plist 2>/dev/null || true
176
+ foxclaw start
177
+ ```
178
+
179
+ The old runtime directory is not read automatically. Copy it once if you want to keep existing bindings, cached thread lists, approvals, and status data.
180
+
181
+ ## Telegram Setup
182
+
183
+ 1. Create a bot with `@BotFather` and copy the token into `TG_BOT_TOKEN`.
184
+ 2. Get your Telegram numeric user id and place it into `TG_ALLOWED_USER_ID`.
185
+ 3. Start FoxClaw with `foxclaw start`.
186
+ 4. Open a private chat with the bot and send `/help`.
187
+
188
+ Optional group/topic config:
189
+
190
+ ```dotenv
191
+ TG_ALLOWED_CHAT_ID=-1001234567890
192
+ TG_ALLOWED_TOPIC_ID=42
193
+ ```
194
+
195
+ - Leave `TG_ALLOWED_CHAT_ID` empty for private-chat mode.
196
+ - Set `TG_ALLOWED_CHAT_ID` only to allow one group as the default conversation scope.
197
+ - Set both `TG_ALLOWED_CHAT_ID` and `TG_ALLOWED_TOPIC_ID` to bind one topic as the default scope.
198
+ - Private chat remains available for `TG_ALLOWED_USER_ID` even when a group is configured.
199
+
200
+ **How to find group and topic IDs:**
201
+
202
+ 1. Stop FoxClaw.
203
+ 2. Send a message in the target group or topic.
204
+ 3. Open `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates`.
205
+ 4. Read `message.chat.id` as `TG_ALLOWED_CHAT_ID`.
206
+ 5. Read `message.message_thread_id` as `TG_ALLOWED_TOPIC_ID`.
207
+
208
+ If FoxClaw is still running, it may consume the update before you inspect it.
209
+
210
+ ## Telegram Group Checklist
211
+
212
+ For natural-language messages in a group or supergroup:
213
+
214
+ 1. Add the bot to the target group.
215
+ 2. Disable the bot's `privacy mode` in `@BotFather`.
216
+ 3. Promote the bot to administrator in that group.
217
+ 4. If privacy mode was changed after adding the bot, remove and re-add the bot.
218
+
219
+ Explicit commands such as `/status@botname` can work even when privacy mode blocks normal messages, so use a plain message to verify group setup.
220
+
221
+ ## Codex App-Server Lifecycle
222
+
223
+ By default:
224
+
225
+ ```dotenv
226
+ CODEX_APP_AUTOLAUNCH=true
227
+ CODEX_APP_LAUNCH_CMD=codex app
228
+ CODEX_APP_SERVER_STATE_PATH=
229
+ CODEX_APP_SERVER_LOG_PATH=
230
+ CODEX_APP_SYNC_ON_OPEN=true
231
+ CODEX_APP_SYNC_ON_TURN_COMPLETE=false
232
+ ```
233
+
234
+ FoxClaw starts `codex app-server` as a detached, bridge-managed process and records its pid and port. On restart, it reconnects to the recorded app-server if that process is still alive; otherwise it starts a new one. `/auth_reload` and auth switching restart the managed app-server so the current `auth.json` is reloaded.
235
+
236
+ No static Codex app-server port is required in normal installs.
237
+
238
+ ## Commands
239
+
240
+ - `/help`
241
+ - `/setup` unified preference panel
242
+ - `/fast <on|off|toggle>`
243
+ - `/active <steer|queue>`
244
+ - `/status`, `/account`, `/quota`
245
+ - `/quota_nudge <credits|usage_limit> confirm`
246
+ - `/login_device`, `/login_cancel [id]`, `/logout confirm`
247
+ - `/auth [list|use <n>|enable <n>|disable <n>|reload|add <name>]`
248
+ - `/threads [query]`, `/threads archived`, `/open <n>`
249
+ - `/goal [objective|pause|resume|done|budget <tokens|off>|clear confirm]`
250
+ - `/history [limit]`, `/files <query>`, `/remote`
251
+ - `/new [cwd]`
252
+ - `/steer <message>`, `/takeover <message>`, `/queue <message>`
253
+ - `/review [base <branch>|commit <sha>|custom <instructions>]`
254
+ - `/diff`, `/fork [name]`, `/undo [n]`, `/rollback [n]`
255
+ - `/rename <name>`, `/compact`, `/archive`, `/unarchive <n>`
256
+ - `/skills [query]`, `/skill <name>`, `/skill_enable <name>`, `/skill_disable <name>`
257
+ - `/loaded`, `/hooks`, `/plugins [query]`, `/apps [reload]`, `/features`, `/config`, `/requirements`, `/provider`
258
+ - `/mcp`, `/mcp_reload`, `/mcp_login <server>`, `/mcp_resource <server> <uri>`
259
+ - `/models`, `/model`, `/effort`, `/permissions`, `/access`, `/mode`, `/plan`, `/agent`
260
+ - `/reveal`, `/where`, `/interrupt`
261
+
262
+ Plain text sends to the current thread, or creates a new one if none is bound.
263
+
264
+ ## Weixin/iLink
265
+
266
+ Weixin support is optional and disabled by default:
267
+
268
+ ```dotenv
269
+ WX_ENABLED=true
270
+ WX_ALLOWED_ILINK_USER_IDS=
271
+ ```
272
+
273
+ Run the QR login helper once after building:
274
+
275
+ ```bash
276
+ foxclaw weixin-login
277
+ ```
278
+
279
+ Weixin runtime files default to `~/.foxclaw/weixin`.
280
+
281
+ ## Codex Skill
282
+
283
+ This repo ships a Codex skill at [`skills/foxclaw`](./skills/foxclaw). Use it when you want Codex to bootstrap FoxClaw locally or on another Mac over SSH — write `.env`, build, run doctor, install launchd, and guide first-message validation.
284
+
285
+ ## Troubleshooting
286
+
287
+ See [Troubleshooting](./docs/troubleshooting.md) for `doctor` failures, Telegram no-reply cases, service logs, reboot behavior, and migration issues.
288
+
289
+ ## Operations
290
+
291
+ ```bash
292
+ foxclaw doctor
293
+ foxclaw status
294
+ foxclaw start
295
+ foxclaw uninstall-systemd
296
+ ```
297
+
298
+ ## Contributing
299
+
300
+ Issues and PRs are welcome at [GitHub](https://github.com/foxden-app/foxclaw).
@@ -260,6 +260,7 @@ export declare class BridgeSessionCore {
260
260
  private handleThreadOpenCallback;
261
261
  private handleThreadActionCallback;
262
262
  private handleThreadNewCallback;
263
+ private handleThreadNewFromThreadCallback;
263
264
  private handleThreadNewCwdCallback;
264
265
  private handleThreadNewCwdTextReply;
265
266
  private startNewThreadForRequestedCwd;