Skip to content

Commit 7191d5c

Browse files
Merge branch 'main' into fix/issue-54242
2 parents 04ee028 + a00e7d3 commit 7191d5c

267 files changed

Lines changed: 9426 additions & 816 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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: channel-message-flows
3+
description: "Use when previewing local channel message flow fixtures."
4+
---
5+
6+
# Channel Message Flows
7+
8+
Use this from the OpenClaw repo root to send canned channel preview flows while iterating on message UX. These are real sends/edits/deletes against the configured channel target.
9+
10+
## Telegram
11+
12+
Native Telegram `sendMessageDraft` tool progress, then a final answer:
13+
14+
```bash
15+
node --import tsx scripts/dev/channel-message-flows.ts \
16+
--channel telegram \
17+
--target <telegram-chat-id> \
18+
--flow working-final \
19+
--duration-ms 20000
20+
```
21+
22+
Thinking preview, then a final answer:
23+
24+
```bash
25+
node --import tsx scripts/dev/channel-message-flows.ts \
26+
--channel telegram \
27+
--target <telegram-chat-id> \
28+
--flow thinking-final
29+
```
30+
31+
## Options
32+
33+
- `--account <accountId>`: Telegram account id when not using the default.
34+
- `--thread-id <id>`: Telegram forum topic/message thread id.
35+
- `--delay-ms <ms>`: Override preview update cadence.
36+
- `--duration-ms <ms>`: Simulated working duration for `working-final`.
37+
- `--final-text <text>`: Override the durable final message.
38+
39+
## Notes
40+
41+
- `--target` is the numeric Telegram chat id.
42+
- `working-final` exercises native Telegram `sendMessageDraft` with static `Working` status and sample tool progress.
43+
- `thinking-final` exercises formatted `Thinking` reasoning preview clearing before the final answer.
44+
- Only `--channel telegram` is implemented for now.

.github/codex/prompts/mantis-telegram-desktop-proof.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ than Telegram-visible behavior`. Use this manifest shape and do not create
119119
`$OPENCLAW_TELEGRAM_USER_DRIVER_SCRIPT`, the workflow-provided `crabbox`
120120
binary, and the workflow-provided local `ffmpeg`/`ffprobe`; do not generate,
121121
install, or patch replacement proof tooling during the run. Use the same
122-
proof idea for baseline and candidate. You may iterate and rerun if the
123-
visual result is not convincing.
122+
proof idea for baseline and candidate. Let `start` return or fail on its
123+
own; do not kill it while Crabbox is still waiting for bootstrap. Use a long
124+
command timeout for `start`, `send`, `view`, and `finish`. You may iterate
125+
and rerun if the visual result is not convincing.
124126
7. Open Telegram Desktop directly to the newest relevant message with the
125127
runner `view` command before finishing each recording. Keep the chat scrolled
126128
to the bottom so new proof messages appear in-frame.

.github/pull_request_template.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ If this PR fixes a plugin beta-release blocker, title it `fix(<plugin-id>): beta
99
- What changed:
1010
- What did NOT change (scope boundary):
1111

12+
## Motivation
13+
14+
Explain why this change should exist now. Link it to the user pain, failure mode, maintainer need, or product goal. If this is purely mechanical, write `N/A`.
15+
16+
-
17+
1218
## Change Type (select all)
1319

1420
- [ ] Bug fix
@@ -35,12 +41,6 @@ If this PR fixes a plugin beta-release blocker, title it `fix(<plugin-id>): beta
3541
- Related #
3642
- [ ] This PR fixes a bug or regression
3743

38-
## Motivation
39-
40-
Explain why this change should exist now. Link it to the user pain, failure mode, maintainer need, or product goal. If this is purely mechanical, write `N/A`.
41-
42-
-
43-
4444
## Real behavior proof (required for external PRs)
4545

4646
External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only. Screenshots are encouraged even for CLI, console, text, or log changes; terminal screenshots and copied live output count. Be mindful of private information like IP addresses, API keys, phone numbers, non-public endpoints, or other private details when providing evidence.

.github/workflows/docker-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
cache-from: type=gha,scope=docker-release-amd64
156156
cache-to: type=gha,mode=max,scope=docker-release-amd64
157157
build-args: |
158-
OPENCLAW_EXTENSIONS=diagnostics-otel
158+
OPENCLAW_EXTENSIONS=diagnostics-otel,codex
159159
tags: ${{ steps.tags.outputs.value }}
160160
labels: ${{ steps.labels.outputs.value }}
161161
sbom: true
@@ -253,7 +253,7 @@ jobs:
253253
cache-from: type=gha,scope=docker-release-arm64
254254
cache-to: type=gha,mode=max,scope=docker-release-arm64
255255
build-args: |
256-
OPENCLAW_EXTENSIONS=diagnostics-otel
256+
OPENCLAW_EXTENSIONS=diagnostics-otel,codex
257257
tags: ${{ steps.tags.outputs.value }}
258258
labels: ${{ steps.labels.outputs.value }}
259259
sbom: true

.github/workflows/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ jobs:
760760
core.info(`Processed ${processed} pull requests.`);
761761
762762
label-issues:
763+
if: github.event_name == 'issues'
763764
permissions:
764765
issues: write
765766
runs-on: ubuntu-24.04

.github/workflows/mantis-telegram-desktop-proof.yml

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,36 @@ jobs:
308308
run: |
309309
set -euo pipefail
310310
current_created="$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" --jq .created_at)"
311+
stale_before="$(date -u -d '8 hours ago' +%Y-%m-%dT%H:%M:%SZ)"
312+
run_has_active_jobs() {
313+
local run_id="$1"
314+
local run_state="$2"
315+
if [[ "$run_state" != "in_progress" ]]; then
316+
return 0
317+
fi
318+
local active_jobs
319+
active_jobs="$(gh run view "$run_id" --repo "$GITHUB_REPOSITORY" --json jobs --jq '[.jobs[] | select(.status == "queued" or .status == "in_progress" or .status == "waiting" or .status == "pending" or .status == "requested")] | length')"
320+
[[ "$active_jobs" != "0" ]]
321+
}
311322
while true; do
312-
blockers="$(
323+
candidates="$(
313324
for workflow in mantis-telegram-desktop-proof.yml mantis-telegram-live.yml; do
314-
gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --limit 100 --json databaseId,status,createdAt,url \
315-
| jq -r \
316-
--argjson current_id "$GITHUB_RUN_ID" \
317-
--arg current_created "$current_created" \
318-
'.[] | select(.databaseId != $current_id) | select(.createdAt < $current_created or (.createdAt == $current_created and .databaseId < $current_id)) | select(.status == "queued" or .status == "in_progress" or .status == "waiting" or .status == "pending" or .status == "requested") | "\(.createdAt)\t#\(.databaseId)\t\(.status)\t\(.url)"'
325+
for status in queued in_progress waiting pending requested; do
326+
gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --status "$status" --limit 100 --json databaseId,status,createdAt,url \
327+
| jq -r \
328+
--argjson current_id "$GITHUB_RUN_ID" \
329+
--arg current_created "$current_created" \
330+
--arg stale_before "$stale_before" \
331+
'.[] | select(.databaseId != $current_id) | select(.createdAt >= $stale_before) | select(.createdAt < $current_created or (.createdAt == $current_created and .databaseId < $current_id)) | "\(.createdAt)\t#\(.databaseId)\t\(.status)\t\(.url)"'
332+
done
319333
done | sort -u
320334
)"
335+
blockers=""
336+
while IFS=$'\t' read -r created run_id run_state url; do
337+
if [[ -n "$run_id" ]] && run_has_active_jobs "${run_id#\#}" "$run_state"; then
338+
blockers+="${created}"$'\t'"${run_id}"$'\t'"${run_state}"$'\t'"${url}"$'\n'
339+
fi
340+
done <<<"$candidates"
321341
if [[ -z "$blockers" ]]; then
322342
break
323343
fi
@@ -406,7 +426,7 @@ jobs:
406426
printf '%s\n' 'Defaults env_keep += "BASELINE_REF BASELINE_SHA CANDIDATE_REF CANDIDATE_SHA"'
407427
printf '%s\n' 'Defaults env_keep += "CRABBOX_ACCESS_CLIENT_ID CRABBOX_ACCESS_CLIENT_SECRET CRABBOX_COORDINATOR CRABBOX_COORDINATOR_TOKEN CRABBOX_LEASE_ID CRABBOX_PROVIDER"'
408428
printf '%s\n' 'Defaults env_keep += "GH_TOKEN MANTIS_CANDIDATE_TRUST MANTIS_INSTRUCTIONS MANTIS_OUTPUT_DIR MANTIS_PR_NUMBER"'
409-
printf '%s\n' 'Defaults env_keep += "OPENCLAW_BUILD_PRIVATE_QA OPENCLAW_ENABLE_PRIVATE_QA_CLI OPENCLAW_QA_CONVEX_SECRET_CI OPENCLAW_QA_CONVEX_SITE_URL OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN"'
429+
printf '%s\n' 'Defaults env_keep += "OPENCLAW_BUILD_PRIVATE_QA OPENCLAW_ENABLE_PRIVATE_QA_CLI OPENCLAW_QA_CONVEX_SECRET_CI OPENCLAW_QA_CONVEX_SITE_URL OPENCLAW_QA_CREDENTIAL_OWNER_ID OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN"'
410430
printf '%s\n' 'Defaults env_keep += "OPENCLAW_TELEGRAM_USER_CRABBOX_BIN OPENCLAW_TELEGRAM_USER_CRABBOX_PROVIDER OPENCLAW_TELEGRAM_USER_DRIVER_SCRIPT OPENCLAW_TELEGRAM_USER_PROOF_CMD"'
411431
} | sudo tee /etc/sudoers.d/mantis-codex-env >/dev/null
412432
sudo chmod 0440 /etc/sudoers.d/mantis-codex-env
@@ -442,6 +462,7 @@ jobs:
442462
MANTIS_PR_NUMBER: ${{ needs.resolve_request.outputs.pr_number }}
443463
OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
444464
OPENCLAW_QA_CONVEX_SITE_URL: ${{ secrets.OPENCLAW_QA_CONVEX_SITE_URL }}
465+
OPENCLAW_QA_CREDENTIAL_OWNER_ID: mantis-telegram-desktop-${{ github.run_id }}-${{ github.run_attempt }}
445466
OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR: ${{ secrets.OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR }}
446467
OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN: ${{ secrets.OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN }}
447468
OPENCLAW_TELEGRAM_USER_CRABBOX_BIN: /usr/local/bin/crabbox
@@ -460,6 +481,47 @@ jobs:
460481
codex-user: codex
461482
allow-bot-users: clawsweeper[bot]
462483

484+
- name: Release leaked Telegram proof leases
485+
if: ${{ always() }}
486+
env:
487+
CRABBOX_PROVIDER: ${{ needs.resolve_request.outputs.crabbox_provider }}
488+
OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
489+
OPENCLAW_QA_CONVEX_SITE_URL: ${{ secrets.OPENCLAW_QA_CONVEX_SITE_URL }}
490+
shell: bash
491+
run: |
492+
set -euo pipefail
493+
if [[ ! -d .artifacts/qa-e2e ]]; then
494+
exit 0
495+
fi
496+
status=0
497+
mapfile -d '' session_files < <(sudo find .artifacts/qa-e2e -path '*/telegram-user-crabbox/*/session.json' -type f -print0)
498+
for session_file in "${session_files[@]}"; do
499+
lease_file="${session_file%/session.json}/.session/lease.json"
500+
if [[ ! -f "$lease_file" ]]; then
501+
continue
502+
fi
503+
if ! sudo -u codex env \
504+
OPENCLAW_QA_CONVEX_SECRET_CI="$OPENCLAW_QA_CONVEX_SECRET_CI" \
505+
OPENCLAW_QA_CONVEX_SITE_URL="$OPENCLAW_QA_CONVEX_SITE_URL" \
506+
OPENCLAW_TELEGRAM_USER_CRABBOX_BIN=/usr/local/bin/crabbox \
507+
OPENCLAW_TELEGRAM_USER_CRABBOX_PROVIDER="$CRABBOX_PROVIDER" \
508+
node --import tsx "$GITHUB_WORKSPACE/scripts/e2e/telegram-user-crabbox-proof.ts" \
509+
finish --session "$session_file" --preview-crop telegram-window; then
510+
status=1
511+
fi
512+
done
513+
mapfile -d '' lease_files < <(sudo find .artifacts/qa-e2e -path '*/telegram-user-crabbox/*/.session/lease.json' -type f -print0)
514+
for lease_file in "${lease_files[@]}"; do
515+
if ! sudo -u codex env \
516+
OPENCLAW_QA_CONVEX_SECRET_CI="$OPENCLAW_QA_CONVEX_SECRET_CI" \
517+
OPENCLAW_QA_CONVEX_SITE_URL="$OPENCLAW_QA_CONVEX_SITE_URL" \
518+
node --import tsx "$GITHUB_WORKSPACE/scripts/e2e/telegram-user-credential.ts" \
519+
release --lease-file "$lease_file"; then
520+
status=1
521+
fi
522+
done
523+
exit "$status"
524+
463525
- name: Inspect Mantis evidence manifest
464526
id: inspect
465527
if: ${{ always() }}

.github/workflows/mantis-telegram-live.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,36 @@ jobs:
272272
run: |
273273
set -euo pipefail
274274
current_created="$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" --jq .created_at)"
275+
stale_before="$(date -u -d '8 hours ago' +%Y-%m-%dT%H:%M:%SZ)"
276+
run_has_active_jobs() {
277+
local run_id="$1"
278+
local run_state="$2"
279+
if [[ "$run_state" != "in_progress" ]]; then
280+
return 0
281+
fi
282+
local active_jobs
283+
active_jobs="$(gh run view "$run_id" --repo "$GITHUB_REPOSITORY" --json jobs --jq '[.jobs[] | select(.status == "queued" or .status == "in_progress" or .status == "waiting" or .status == "pending" or .status == "requested")] | length')"
284+
[[ "$active_jobs" != "0" ]]
285+
}
275286
while true; do
276-
blockers="$(
287+
candidates="$(
277288
for workflow in mantis-telegram-desktop-proof.yml mantis-telegram-live.yml; do
278-
gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --limit 100 --json databaseId,status,createdAt,url \
279-
| jq -r \
280-
--argjson current_id "$GITHUB_RUN_ID" \
281-
--arg current_created "$current_created" \
282-
'.[] | select(.databaseId != $current_id) | select(.createdAt < $current_created or (.createdAt == $current_created and .databaseId < $current_id)) | select(.status == "queued" or .status == "in_progress" or .status == "waiting" or .status == "pending" or .status == "requested") | "\(.createdAt)\t#\(.databaseId)\t\(.status)\t\(.url)"'
289+
for status in queued in_progress waiting pending requested; do
290+
gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --status "$status" --limit 100 --json databaseId,status,createdAt,url \
291+
| jq -r \
292+
--argjson current_id "$GITHUB_RUN_ID" \
293+
--arg current_created "$current_created" \
294+
--arg stale_before "$stale_before" \
295+
'.[] | select(.databaseId != $current_id) | select(.createdAt >= $stale_before) | select(.createdAt < $current_created or (.createdAt == $current_created and .databaseId < $current_id)) | "\(.createdAt)\t#\(.databaseId)\t\(.status)\t\(.url)"'
296+
done
283297
done | sort -u
284298
)"
299+
blockers=""
300+
while IFS=$'\t' read -r created run_id run_state url; do
301+
if [[ -n "$run_id" ]] && run_has_active_jobs "${run_id#\#}" "$run_state"; then
302+
blockers+="${created}"$'\t'"${run_id}"$'\t'"${run_state}"$'\t'"${url}"$'\n'
303+
fi
304+
done <<<"$candidates"
285305
if [[ -z "$blockers" ]]; then
286306
break
287307
fi

0 commit comments

Comments
 (0)