Skip to content

Commit 18c77d3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/issue-75832-elevated-followup
# Conflicts: # src/agents/bash-tools.exec-host-shared.test.ts
2 parents 66a42d3 + 8329958 commit 18c77d3

4,625 files changed

Lines changed: 182337 additions & 99452 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Telegram Maintainer Decisions
2+
3+
Use this page during Telegram PR review. These are intentional maintainer decisions, not incidental implementation details.
4+
5+
Verified against Telegram Bot API 10.0, May 8 2026.
6+
7+
## Streaming
8+
9+
- Do not reintroduce `sendMessageDraft` for answer streaming. Telegram drafts are ephemeral 30-second previews in private chats; final delivery still requires a separate `sendMessage`. OpenClaw uses `sendMessage` plus `editMessageText`, then finalizes in place so the user sees one persistent answer.
10+
- Streaming owns one visible preview message. Edit it forward. Do not send an extra final bubble unless the final edit genuinely failed.
11+
- Keep the first-preview debounce. If a provider sends token-sized deltas, coalesce them into cumulative preview text instead of removing the debounce.
12+
- Respect Telegram limits in the Telegram layer. Text over 4096 chars chains into continuation messages. Polls keep the current Bot API 12-option cap.
13+
14+
## Telegram API Ownership
15+
16+
- Prefer grammY primitives and Telegram-native helpers when they model the behavior directly. Avoid custom Bot API wrappers for behavior grammY already owns.
17+
- Throttling is bot-token scoped. All Telegram API clients for the same token share one grammY `apiThrottler()` instance.
18+
- Do not silently retry failed topic sends without topic metadata. A wrong-surface success is worse than a loud Telegram error.
19+
- DM topics and forum topics are distinct. `direct_messages_topic_id` and `message_thread_id` are not interchangeable.
20+
21+
## Context And Authorization
22+
23+
- Reply context comes from OpenClaw-observed messages. Bot API updates expose `reply_to_message`, but there is no arbitrary `getMessage(chat, id)` hydration path later.
24+
- Current local chat context must outrank stale reply ancestry in the prompt. Old replied-to messages should not look like the active conversation.
25+
- Pairing is DM-only. Group and topic authorization need explicit config allowlists.
26+
- Telegram allowlists use numeric sender IDs. Usernames are optional, mutable, and not a reliable arbitrary-user lookup key in the Bot API.
27+
- Group and channel visible replies are policy-controlled. Normal room replies stay private unless `messages.groupChat.visibleReplies: "automatic"` is set or the agent explicitly calls `message.send`.
28+
29+
## Interactive Surfaces
30+
31+
- Native callbacks stay structured. Approval, native command, plugin, select, and multiselect callbacks must not fall through as raw callback text.
32+
- Preserve callback values exactly, including delimiters such as `env|prod`.
33+
- Native slash commands should remain fast-pathable before full workspace and agent-turn setup.
34+
35+
## Review Standard
36+
37+
Telegram behavior PRs need real Telegram proof when they touch transport, streaming, topics, callbacks, authorization, or reply context. Prefer the bot-to-bot QA lane or an equivalent live Telegram probe over synthetic-only validation.

.agents/skills/clawsweeper/SKILL.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Use for all ClawSweeper work: OpenClaw issue/PR sweep reports, com
77

88
ClawSweeper lives at `~/Projects/clawsweeper`. It is the one OpenClaw
99
maintenance bot for sweeping, commit review, repair jobs, and guarded fix PRs.
10-
Use this skill whenever Peter asks about reports, findings, dispatch health,
10+
Use this skill whenever asked about reports, findings, dispatch health,
1111
repair/cloud PR creation, comment commands, automerge, permissions, or gates.
1212

1313
## Start
@@ -20,7 +20,7 @@ pnpm run build:all
2020
```
2121

2222
Do not overwrite unrelated edits. If the tree is dirty, inspect first and keep
23-
read-only report work read-only unless Peter asked to commit.
23+
read-only report work read-only unless the requester asked to commit.
2424

2525
## One Bot, One App
2626

@@ -79,7 +79,7 @@ gh workflow run commit-review.yml --repo openclaw/clawsweeper \
7979
-f enabled=true
8080
```
8181

82-
Use `create_checks=true` only when Peter explicitly wants target commit Check
82+
Use `create_checks=true` only when the requester explicitly wants target commit Check
8383
Runs. Add `-f additional_prompt="..."` for focused one-off review instructions.
8484

8585
## Sweep Reports
@@ -175,7 +175,7 @@ gh variable set CLAWSWEEPER_ALLOW_MERGE --repo openclaw/clawsweeper --body 1
175175
gh variable set CLAWSWEEPER_ALLOW_AUTOMERGE --repo openclaw/clawsweeper --body 1
176176
```
177177

178-
Reset gates only when Peter asks; the active maintainer window may intentionally
178+
Reset gates only when explicitly requested; the active maintainer window may intentionally
179179
leave them at `1`.
180180

181181
Important gates:
@@ -255,15 +255,16 @@ loop. The router:
255255
- never merges autofix PRs or draft PRs;
256256
- merges automerge PRs only when ClawSweeper passed the exact current head,
257257
checks are green, GitHub says mergeable, no human-review label is present,
258-
the PR is not draft, required user-facing OpenClaw changelog entries are
259-
present, and both merge gates are open.
258+
the PR is not draft, and both merge gates are open.
259+
260+
Missing changelog is not a review finding or merge blocker. If repairing a user-facing change, add/update changelog automatically when practical; never ask or block solely on it.
260261

261262
If ClawSweeper passes while merge gates are closed, it labels
262263
`clawsweeper:merge-ready` and comments instead of merging. `@clawsweeper stop`
263264
adds `clawsweeper:human-review`.
264265

265-
When Peter asks Codex to create a PR and enable ClawSweeper automerge, do not
266-
leave his local OpenClaw checkout on the PR branch. After the PR is created,
266+
When asked to create a PR and enable ClawSweeper automerge, do not
267+
leave the local OpenClaw checkout on the PR branch. After the PR is created,
267268
pushed, and the `@clawsweeper automerge` request is posted or otherwise
268269
confirmed, return the local checkout to `main` and fast-forward it when the
269270
working tree is clean:

.agents/skills/crabbox/SKILL.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ pnpm crabbox:run -- --help | sed -n '1,120p'
3131
- Check `.crabbox.yaml` for repo defaults, but override provider explicitly.
3232
Even if config still says AWS, maintainer validation should normally pass
3333
`--provider blacksmith-testbox`.
34+
- For live/provider bugs, check keys on the local Mac before downgrading to
35+
mocks: source local `~/.profile` and test only presence/length. If Crabbox
36+
does not already have the key, copy only the exact needed key into the remote
37+
process environment for that one command. Do not print it, do not sync it as a
38+
repo file, and do not leave it in remote shell history or logs. If no
39+
secret-safe injection path is available, say true live provider auth is
40+
blocked instead of silently using a fake key.
3441
- Prefer local targeted tests for tight edit loops. Broad gates belong remote.
3542
- Do not treat inherited shell env as operator intent. In particular,
3643
`OPENCLAW_LOCAL_CHECK_MODE=throttled` from the local shell is not permission
@@ -131,6 +138,81 @@ unclear:
131138
blacksmith testbox list
132139
```
133140

141+
## Efficient Bug E2E Verification
142+
143+
Use the smallest Crabbox lane that proves the reported user path, not just the
144+
touched code. Aim for one after-fix E2E proof before commenting, closing, or
145+
opening a PR for a user-visible bug.
146+
147+
Pick the lane by symptom:
148+
149+
- Docker/setup/install bug: build a package tarball and run the matching
150+
`scripts/e2e/*-docker.sh` or package script. This proves npm packaging,
151+
install paths, runtime deps, config writes, and container behavior.
152+
- Provider/model/auth bug: prefer true live E2E. First source local Mac
153+
`~/.profile`, then inject the single needed key into Crabbox if needed. Scrub
154+
unrelated provider env vars in the child command so interactive defaults do
155+
not drift to another provider. If only a dummy key is used, label the proof
156+
narrowly, e.g. "UI/install path only; live provider auth not exercised."
157+
- Channel delivery bug: use the channel Docker/live lane when available; include
158+
setup, config, gateway start, send/receive or agent-turn proof, and redacted
159+
logs.
160+
- Gateway/session/tool bug: prefer an end-to-end CLI or Gateway RPC command that
161+
creates real state and inspects the resulting files/API output.
162+
- Pure parser/config bug: targeted tests may be enough, but still run a
163+
Crabbox command when OS, package, Docker, secrets, or service lifecycle could
164+
change behavior.
165+
166+
Efficient flow:
167+
168+
1. Reproduce or prove the pre-fix symptom when feasible. If the issue cannot be
169+
reproduced, capture the exact command and observed behavior instead.
170+
2. Patch locally and run narrow local tests for edit speed.
171+
3. Run one Crabbox E2E command that starts from the user-facing entrypoint:
172+
package install, Docker setup, onboarding, channel add, gateway start, or
173+
agent turn as appropriate.
174+
4. Record proof as: Testbox id, command, environment shape, redacted secret
175+
source, and copied success/failure output.
176+
5. If the issue says "cannot reproduce", ask for the missing config/log fields
177+
that would distinguish the tested path from the reporter's path.
178+
179+
Keep it efficient:
180+
181+
- Reuse existing E2E scripts and helper assertions before writing ad hoc shell.
182+
- Use one-shot Crabbox for a single proof; use a reusable Testbox only when
183+
several commands must share built images, installed packages, or live state.
184+
- Prefer `OPENCLAW_CURRENT_PACKAGE_TGZ` with Docker/package lanes when testing a
185+
candidate tarball; prefer the repo's package helper instead of direct source
186+
execution when the bug might be packaging/install related.
187+
- Keep secrets redacted. It is fine to report key presence, source, and length;
188+
never print secret values.
189+
- Include `--timing-json` on broad or flaky runs when command duration or sync
190+
behavior matters.
191+
192+
Interactive CLI/onboarding:
193+
194+
- For full-screen or prompt-heavy CLI flows, run the target command inside tmux
195+
on the Crabbox and drive it with `tmux send-keys`; capture proof with
196+
`tmux capture-pane`, redacted through `sed`.
197+
- Prefer deterministic arrow navigation over search typing for Clack-style
198+
searchable selects. Raw `send-keys -l openai` may not trigger filtering in a
199+
tmux pane; inspect option order locally or on-box and send exact Down/Enter
200+
sequences.
201+
- Isolate mutable state with `OPENCLAW_STATE_DIR=$(mktemp -d)`. Plugin npm
202+
installs live under that state dir (`npm/node_modules/...`), not under
203+
`OPENCLAW_CONFIG_DIR`. Verify downloads by checking the state dir, package
204+
lock, and installed package metadata.
205+
- To test automatic setup installs against local package artifacts, use
206+
`OPENCLAW_ALLOW_PLUGIN_INSTALL_OVERRIDES=1` plus
207+
`OPENCLAW_PLUGIN_INSTALL_OVERRIDES='{"plugin-id":"npm-pack:/tmp/plugin.tgz"}'`.
208+
Pack with `npm pack`, set an isolated `OPENCLAW_STATE_DIR`, and verify the
209+
package under `npm/node_modules`. Overrides are test-only and must not be
210+
treated as official/trusted-source installs.
211+
- For OpenAI/Codex onboarding proof, the useful markers are the UI line
212+
`Installed Codex plugin`, `npm/node_modules/@openclaw/codex`, and the
213+
package-lock entry showing the bundled `@openai/codex` dependency. A dummy
214+
OpenAI-shaped key can prove only UI/install behavior; it is not live auth.
215+
134216
## Reuse And Keepalive
135217

136218
For most Blacksmith-backed Crabbox calls, one-shot is enough. Use reuse only

0 commit comments

Comments
 (0)