Skip to content

fix(channels): Telegram progress drafts lost per-tool emoji on tool rows - #167392

Merged
obviyus merged 4 commits into
openclaw:mainfrom
keshavbotagent:fix/telegram-progress-tool-emojis-20261008
Oct 9, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
keshavbotagent:fix/telegram-progress-tool-emojis-20261008

Conversation

@keshavbotagent

@keshavbotagent keshavbotagent commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Telegram progress drafts lost the leading per-tool emoji on tool-log rows (🛠️ Exec, 📖 Read) after #165095 moved tool display metadata to semantic icons.

User Impact

User impact: Telegram tool-log rows show a per-tool glyph again, in standard and rich-message previews. Slack and every other channel keep plain rows, and graphical clients are unchanged. No config changes.

Why This Change Was Made

#165095 (42ebb9d) replaced each tool's emoji with one semantic icon and moved status-reaction emoji to a reaction-only table. As a side effect, core stopped setting ChannelProgressDraftLine.icon, so Telegram's renderer no longer had a glyph to show. Removing the glyph was not the goal of #165095.

Core now owns the text presentation of those icons, following the native-client pattern from #165095:

  • One table. src/channels/progress-tool-glyphs.ts maps each semantic tool icon to a text emoji. A coverage test fails if a configured icon has no glyph, like the Swift and Android tables.
  • One producer. buildNamedProgressLine, where draft lines are built, fills line.icon only when the caller passes toolIcons. Plan and approval rows stay plain, commentary/reasoning rows are unchanged, and lines a plugin builds with its own icon keep it.
  • Per-channel opt-in. Tool emoji look out of place on some channels, Slack especially, so the default is plain. A channel opts in with one optional SDK field, toolIcons?: boolean, on createChannelProgressDraftCompositor (next to the existing reasoningLinePrefix/commentaryLinePrefix lane markers) and on the buildChannelProgressDraftLine options. Telegram opts in; nothing else does.

This PR began as a Telegram-only fix by @keshavbotagent that reused the status-reaction emoji table inside the Telegram plugin. Per maintainer direction it now uses a core owner. That reaction-table use is gone, and Keshav's commit and credit remain.

Follow-up for a maintainer decision: Discord already passes the 🧠/💬 lane markers and could opt in with toolIcons: true. This PR leaves Discord unchanged.

Bounded cost

  • When a channel opts in, each core-built tool row costs one static Record lookup. Channels that don't opt in skip it.
  • No new config keys, protocol fields, network calls, or extra Telegram sends or edits. In the live runs below, before and after each sent one progress message, six edits, and one final reply.
  • Production: +63/−1 lines (47 of them are the glyph table). Tests: +50. Docs: +5/−2.

Evidence

Regression tests (each failed on clean origin/main and passes on this head):

  • src/channels/progress-draft-compositor.test.ts, the prefixes generated tool rows with text glyphs… case. With toolIcons it renders 💬 _Checking_\n🛠️ Exec: running\n🧪 Read: running. By default it renders • Exec: running. In both cases commentary is unchanged and an explicit plugin icon (🧪) wins. On main: - 🛠️ Exec: running / + • Exec: running.
  • src/channels/progress-tool-glyphs.test.ts: every icon in TOOL_DISPLAY_CONFIG (tools and fallback) has a glyph.
  • extensions/telegram/src/bot-message-dispatch.preview.telegram-http.test.ts: real Telegram dispatch over HTTP Bot API. The progress card keeps 🛠️ Exec through the failure edit. On main: expected '<b>Working</b>\n<b>Exec</b> <i>failed…' to contain '🛠️ Exec'.
  • These suites also pass: the focused channel, streaming, and tool-display suites, plus the Telegram dispatch suites (preview, progress-card, final-delivery-lifecycle, reply-targets, draft-stream).

Telegram Test Server, live gpt-6-astra (real-user DM, streaming.progress.toolProgress: true). Prompt: run printf glyph-check > note.txt with exec, read note.txt, then reply OPENCLAW_E2E_OK. Each run made 5 gpt-6-astra requests, all 200.

Progress card, last edit Final
Before (origin/main aa60a5f) Working ⏎ Skill Search write read local text file ⏎ … ⏎ Exec ⏎ Read lines 1-10 from note.txt ⏎ Exec OPENCLAW_E2E_OK; card deleted
After (this PR, 126e5c3; later commits change tests only) Working ⏎ 🔎 Skill Search write and read a local text file shell printf ⏎ … ⏎ 🛠️ Exec ⏎ 📖 Read lines 1-10 from note.txt ⏎ 🛠️ Exec OPENCLAW_E2E_OK; card deleted

Slack stays plain (isolated formatter check). Core progress lines from the real compositor, built with Slack's flags (no toolIcons) and rendered through Slack's real formatSlackProgressDraftLine, buildSlackProgressTextBlocks, and buildSlackProgressCardBlocks:

Slack flags:          draft "• Exec: running\n• Read: note.txt"; card "Exec — running\nRead — note.txt · running"; glyphs: none
control toolIcons:    draft "🛠️ Exec: running\n📖 Read: note.txt"; card unchanged (Slack cards ignore icon)

The existing Slack dispatch suite still asserts plain Bash / Apply Patch task titles.

CI: Everything is green on c6a2d40 except one test, extensions/whatsapp/src/send.delivery-recovery.test.ts ("preserves long styles and quotes only the first chunk"), in checks-node-changed-extensions-bundle; openclaw/ci-gate fails only because of it. This PR doesn't touch WhatsApp, and the same test fails the same way on clean origin/main aa60a5f (expected [ …(3) ] to deeply equal [ …(5) ]).

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram size: S labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Telegram progress drafts, the messages updated while an agent works, regain tool-specific emoji through a shared core mapping that other channel plugins can optionally enable.

Example: A Telegram user asks the agent to write and read note.txt with the tool log enabled.

  • Before: The progress card shows plain Exec and Read rows.
  • After: The progress card shows 🛠️ Exec and 📖 Read rows.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, bounded presentation change with live Telegram proof, compatible opt-in behavior, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body records a real-user Telegram Test Server write/read turn on the core revision: the progress card gains 🛠️ Exec and 📖 Read, final output remains OPENCLAW_E2E_OK, and cleanup completes. The final head changes only tests; inspected client screenshots supplement the trace, and both preview formats share the same prepared rows.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes
User problem: Telegram users lose recognizable tool markers in dense progress logs.
Reason: Plain text was an intentional design, so this is a presentation preference. The recorded maintainer-directed revision accepts a bounded Telegram exception with a shared owner and unchanged defaults elsewhere.

Merge readiness

✅ Ready for maintainer review

This PR remains useful and distinct from current main. The maintainer-directed revision resolves the earlier presentation decision, and the new live Telegram evidence resolves the previous proof gap; no actionable patch defect was found.

Priority: P3
Reviewed head: c6a2d40d9525abb324bbdfcd823d0949ebda0326

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared progress compositor turns agent activity into structured progress rows. Telegram converts those rows into standard or rich previews and sends updates through its existing draft transport.

flowchart TD
 A[Agent tool activity] --> B[Shared progress compositor]
 B --> C{Channel enables tool glyphs?}
 D[Semantic tool icons] --> E[Core text glyph mapping]
 E --> C
 C --> F[Structured progress rows]
 F --> G[Telegram standard or rich preview]
 G --> H[Visible progress message]
Loading

Technical review

Best possible solution:

Keep the shared semantic-icon mapping and Telegram opt-in while preserving plain output for channels that omit the option.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: the earlier merged change intentionally made text rows plain. Source and the recorded live comparison establish the presentation difference this PR addresses.

Is this the best way to solve the issue?

Yes: one glyph mapping consumes existing semantic icons at the shared producer, and Telegram enables it through the existing compositor contract without coupling presentation to status reactions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 959197ba0923.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned implementation: The introduced delta adds glyph selection to the shared line producer and enables it in both ordinary and retained Telegram compositors; the earlier Telegram-local reaction lookup is absent from the final delta. (src/channels/streaming.ts:288, c6a2d40d9525)
  • Current main still uses plain rows: Fetched main's shared producer has no glyph assignment or toolIcons option, so the requested Telegram presentation remains distinct. (src/channels/streaming.ts:283, 959197ba0923)
  • Original presentation intent: improve: native tool rows show Tool Search calls and every client shares tool icons #165095 explicitly removed emoji from text surfaces while retaining optional plugin-supplied icons; restoring Telegram glyphs is an accepted presentation exception rather than evidence of an accidental removal. (src/channels/streaming.ts, 42ebb9d73483)
  • Recorded maintainer direction: fix(channels): Telegram progress drafts lost per-tool emoji on tool rows #167392 (comment) records the core mapping, optional SDK field, Telegram opt-in, and unchanged plain defaults elsewhere; GitHub independently confirms obviyus has repository write permission.
  • Live Test Server result: The complete PR body records a real-user Telegram Test Server DM before and after the core revision: writing and reading note.txt changes plain Exec/Read rows to 🛠️ Exec/📖 Read, returns OPENCLAW_E2E_OK, and deletes the card. The final commit changes only the HTTP regression test, preserving the exercised production implementation. Captured body sourceRevision: 867d748c4c27eff630b401d30bf9db69b1a8feb99f355b2c05f6832d9196daf1. (126e5c37fa41)
  • Inspected client comparison: Prepared images 1 and 2 visibly show plain tool labels before and emoji-prefixed tool labels afterward. These older client captures supplement the new core-revision Test Server trace; images 3 and 4 concern the earlier native-client change and do not prove this PR. (e17f361283f4)

PR surface

Source +62, Tests +50, Docs +3. Total +115 across 11 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 7 63 1 +62
Tests 3 50 0 +50
Docs 1 5 2 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 118 3 +115

Review metrics

Metric Value Why it matters
Plugin presentation option 1 optional toolIcons field; default plain The SDK gains an opt-in presentation capability without requiring existing callers to change.
Production versus tests Production +63/−1; tests +50/−0 Production growth is bounded and justified by one shared glyph table and propagation through the existing producer.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The public compositor gains an optional presentation field; the recorded maintainer direction accepts this addition while existing callers retain plain output.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P3: This improves Telegram tool-row readability without changing execution or delivery behavior.
  • merge-risk: 🚨 compatibility: The public compositor gains an optional presentation field; the recorded maintainer direction accepts this addition while existing callers retain plain output.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Tool glyphs are visible Telegram behavior; the recorded Test Server userbot run exercises the changed rows.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-08T18:30:28.432Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-08T19:10:16.886Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T03:42:23.480Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T04:48:02.634Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T20:23:55.833Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T20:33:41.484Z sha e17f361 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T21:14:24.521Z sha e17f361 :: needs real behavior proof before merge. :: none

Reviewed October 9, 2026, 7:37 PM ET / 23:37 UTC (Revision 8).

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 8, 2026
@keshavbotagent
keshavbotagent marked this pull request as ready for review October 9, 2026 04:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T04:04:50.986367Z e17f361 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e17f361283

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

it.each([false, true])(
"keeps tool emojis through progress sends and edits (rich: %s)",
async (richMessages) => {
const api = createMockDraftApi();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate the preview against live Telegram

This changes Telegram's visible streaming send/edit path, but the new regression uses createMockDraftApi() for both standard and rich modes, so it cannot establish that either payload renders correctly through the real Bot API/client. The scoped Telegram guide requires real Telegram proof for streaming behavior; add a bot-to-bot or Test Server send-and-edit probe before treating this change as validated.

AGENTS.md reference: extensions/telegram/AGENTS.md:L134-L139

Useful? React with 👍 / 👎.

@keshavbotagent

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@keshavbotagent

keshavbotagent commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Live Telegram client proof: before / after

Posting the existing inspected screenshots together in a new comment so the comparison is directly visible in the review timeline. Reviewed PR head: e17f361283f4688ca31f76baed815eb2d0f93e8f.

Before — previous running build

User-provided live Telegram-client capture. Bash, Session Status, and Browser rows have no leading tool emojis; the authored commentary emoji remains. A private path fragment was redacted before public upload. This is reported before-state evidence, not an exact-head Test Server run.

Before: live Telegram progress with plain Bash, Session Status, and Browser rows; private path fragment redacted

After — reviewed PR build, standard mode

User-provided live Telegram mobile-client capture made during a real multi-tool turn after an explicitly authorized handoff to the already validated PR build, retaining the existing config, state, history, and chat. The running service, built revision, and clean worktree matched the reviewed head. Effective settings: richMessages: false, streaming.mode: "progress", streaming.progress.toolProgress: true.

Visible result: 🛠️ Bash, 📊 Session Status, 📖 Skill Read, and 🛠️ LS; authored commentary remains visible. The after image is the original, unmodified JPEG. The change restores tool prefixes, not extra blank-line spacing.

After: live standard-mode Telegram progress with emoji-prefixed Bash, Session Status, Skill Read, and LS tool rows

Shared icon path and re-review request

Standard and rich progress previews both consume the same progressLineText() icon decision and prepared row content before the final transport projection. This patch changes that shared preparation, not separate icon logic per mode. The live before/after comparison exercises the changed decision; existing regression cases cover both projections. A separate rich-mode screenshot is not an additional proof requirement for this emoji-only change.

The latest review already acknowledges the after image as meaningful client proof. Both images are now explicit together. They are real client captures, not Telegram Test Server captures, and no Test Server run or still-image proof of the send/edit lifecycle is claimed. QA access for the reviewer-requested Test Server lifecycle evidence remains unavailable; presentation-owner acceptance remains open. Existing isolated validation remains 104/104 focused tests, full build, and targeted lint passed; no code or runtime changes were made for this comment.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Core owns one text-glyph table keyed by the semantic tool icon from
openclaw#165095 and fills ChannelProgressDraftLine.icon where draft lines are
built, only for channels that pass toolIcons to the progress compositor.
Telegram opts in; Slack and other channels keep plain rows. Replaces the
Telegram-local status-reaction table lookup.
@obviyus obviyus changed the title improve(telegram): restore tool emoji prefixes in progress drafts fix(channels): Telegram progress drafts lost per-tool emoji on tool rows Oct 9, 2026
@obviyus

obviyus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Taking this over as a maintainer edit (thanks @keshavbotagent, your commit stays on the branch). Per maintainer direction, the fix now lives in core instead of the Telegram plugin: core owns one text-glyph table keyed by the semantic tool icon from #165095, with a coverage test like the native tables. The draft-line builder fills icon only for channels that pass the new optional toolIcons progress-compositor flag. Telegram opts in. Slack and other channels stay plain by default. The status-reaction table is no longer used for progress rows. Details and live Telegram Test Server proof are in the PR body.

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 9, 2026
@obviyus

obviyus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Oct 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 9, 2026
@obviyus
obviyus merged commit 8defdee into openclaw:main Oct 9, 2026
243 of 248 checks passed
obviyus added a commit that referenced this pull request Oct 10, 2026
)

## What Problem This Solves

Discord progress drafts show tool-log rows without a per-tool glyph (`• Exec: running`), while Telegram shows `🛠️ Exec: running` since #167392. Discord already marks the 🧠 reasoning and 💬 commentary lanes, so its tool rows were the only unmarked lane.

## User Impact

Discord tool-log rows in progress drafts now start with the tool's text glyph (`🛠️ Exec`, `📖 Read`, `🩹 Apply Patch`). The 🧠 / 💬 lanes, plan rows, approval rows, and plain status rows are unchanged. No config changes. Slack and other channels keep plain rows.

## Why This Change Was Made

#167392 added the core opt-in (`toolIcons?: boolean` on `createChannelProgressDraftCompositor`, glyph table in `src/channels/progress-tool-glyphs.ts`) and left Discord as a follow-up. This PR sets `toolIcons: true` on every Discord compositor so all Discord paths render the same:

- live draft preview (`message-handler.draft-preview.ts`)
- retained progress continuation after handoff (`message-handler.progress-continuation.ts`)
- retained-card `edit` action rendering a progress snapshot (`runtime.messaging.messages.ts`)

No Discord-specific glyph code. Rows that already carry an explicit `icon` keep it.

## Tests

- `message-handler.draft-preview.rest.test.ts`: new regression through the real draft preview and Discord REST client: `🧠 _Planning the check_` / `💬 Looking at the workspace` / `🛠️ Exec: running` / `📖 Read: running`. Fails on main with `• Exec: running` / `• Read: running`.
- `message-bodies.test.ts`: a retained row's explicit icon (`🧪 Read`) wins over the tool glyph.
- `message-handler.process.draft-final.test.ts`: existing expectations updated to the glyph rows.

## Bounded cost

- One static `Record` lookup per core-built tool row on Discord (core opt-in from #167392).
- No new config keys, protocol fields, network calls, or extra Discord sends/edits; the draft text gains one glyph and a space per tool row, inside the existing per-message length bounds.
- Production: +3 lines. Tests: +65/−5. Docs: +3/−3. No extra Discord sends or edits in the runs above beyond the existing progress-draft cadence.

## Evidence

Isolated gateway (`HOME`/`OPENCLAW_STATE_DIR`/`OPENCLAW_CONFIG_PATH` under `/tmp`) with the real bundled Discord plugin against QA Lab's Crabline Discord provider server, `streaming.mode: "progress"`, `progress.toolProgress: true`. Rows below are the Discord REST bodies the plugin sent, from the Crabline provider recorder (`artifacts/crabline/discord-provider-server.jsonl`).

**Live model `openai/gpt-6-astra`** (`qa suite --provider-mode live-frontier --model openai/gpt-6-astra --channel-driver crabline --channel discord`), prompt asked for one exec then one read:

```
POST  "Working\n\n🛠️ Exec: running\n🛠️ Exec: running"
PATCH "Working\n\n🛠️ Exec: running\n🛠️ Exec"
PATCH "…\n\n🛠️ Exec\n🛠️ Exec\n🛠️ Exec: running"
PATCH "…\n\n🛠️ Exec\n🛠️ Exec\n🛠️ Exec\n📖 Read from glyph-proof.txt"
POST  final reply (separate message)
```

**Scripted model (`mock-openai`)**, commentary + one exec:

```
POST  "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D"
PATCH "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D\n🛠️ Exec: running"
PATCH "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D\n🛠️ Exec"
POST  "SLACK-QA-COMMENTARY-DONE-200C8C6D"
```

The 💬 commentary lane keeps its prefix, and the final reply is one separate message, as before. Before this change, the same rows render as `• Exec: running` / `• Read: running` (the new REST regression fails on main with exactly that diff).
@keshavbotagent

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for considering putting the icons back

@keshavbotagent
keshavbotagent deleted the fix/telegram-progress-tool-emojis-20261008 branch October 10, 2026 03:23
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…ows (openclaw#167392)

## What Problem This Solves

Fixes: Telegram progress drafts lost the leading per-tool emoji on tool-log rows (`🛠️ Exec`, `📖 Read`) after openclaw#165095 moved tool display metadata to semantic icons.

## User Impact

User impact: Telegram tool-log rows show a per-tool glyph again, in standard and rich-message previews. Slack and every other channel keep plain rows, and graphical clients are unchanged. No config changes.

## Why This Change Was Made

openclaw#165095 (0b22a3e) replaced each tool's `emoji` with one semantic `icon` and moved status-reaction emoji to a reaction-only table. As a side effect, core stopped setting `ChannelProgressDraftLine.icon`, so Telegram's renderer no longer had a glyph to show. Removing the glyph was not the goal of openclaw#165095.

Core now owns the text presentation of those icons, following the native-client pattern from openclaw#165095:

- **One table.** `src/channels/progress-tool-glyphs.ts` maps each semantic tool icon to a text emoji. A coverage test fails if a configured icon has no glyph, like the Swift and Android tables.
- **One producer.** `buildNamedProgressLine`, where draft lines are built, fills `line.icon` only when the caller passes `toolIcons`. Plan and approval rows stay plain, commentary/reasoning rows are unchanged, and lines a plugin builds with its own `icon` keep it.
- **Per-channel opt-in.** Tool emoji look out of place on some channels, Slack especially, so the default is plain. A channel opts in with one optional SDK field, `toolIcons?: boolean`, on `createChannelProgressDraftCompositor` (next to the existing `reasoningLinePrefix`/`commentaryLinePrefix` lane markers) and on the `buildChannelProgressDraftLine` options. Telegram opts in; nothing else does.

This PR began as a Telegram-only fix by @keshavbotagent that reused the status-reaction emoji table inside the Telegram plugin. Per maintainer direction it now uses a core owner. That reaction-table use is gone, and Keshav's commit and credit remain.

Follow-up for a maintainer decision: Discord already passes the 🧠/💬 lane markers and could opt in with `toolIcons: true`. This PR leaves Discord unchanged.

## Bounded cost

- When a channel opts in, each core-built tool row costs one static `Record` lookup. Channels that don't opt in skip it.
- No new config keys, protocol fields, network calls, or extra Telegram sends or edits. In the live runs below, before and after each sent one progress message, six edits, and one final reply.
- Production: +63/−1 lines (47 of them are the glyph table). Tests: +50. Docs: +5/−2.

## Evidence

**Regression tests (each failed on clean `origin/main` and passes on this head):**

- `src/channels/progress-draft-compositor.test.ts`, the `prefixes generated tool rows with text glyphs…` case. With `toolIcons` it renders `💬 _Checking_\n🛠️ Exec: running\n🧪 Read: running`. By default it renders `• Exec: running`. In both cases commentary is unchanged and an explicit plugin icon (`🧪`) wins. On main: `- 🛠️ Exec: running / + • Exec: running`.
- `src/channels/progress-tool-glyphs.test.ts`: every icon in `TOOL_DISPLAY_CONFIG` (tools and fallback) has a glyph.
- `extensions/telegram/src/bot-message-dispatch.preview.telegram-http.test.ts`: real Telegram dispatch over HTTP Bot API. The progress card keeps `🛠️ Exec` through the failure edit. On main: `expected '<b>Working</b>\n<b>Exec</b> <i>failed…' to contain '🛠️ Exec'`.
- These suites also pass: the focused channel, streaming, and tool-display suites, plus the Telegram dispatch suites (preview, progress-card, final-delivery-lifecycle, reply-targets, draft-stream).

**Telegram Test Server, live `gpt-6-astra` (real-user DM, `streaming.progress.toolProgress: true`).** Prompt: run `printf glyph-check > note.txt` with exec, read `note.txt`, then reply `OPENCLAW_E2E_OK`. Each run made 5 `gpt-6-astra` requests, all 200.

| | Progress card, last edit | Final |
| --- | --- | --- |
| Before (`origin/main` 46635f6) | `Working ⏎ Skill Search write read local text file ⏎ … ⏎ Exec ⏎ Read lines 1-10 from note.txt ⏎ Exec` | `OPENCLAW_E2E_OK`; card deleted |
| After (this PR, 126e5c3; later commits change tests only) | `Working ⏎ 🔎 Skill Search write and read a local text file shell printf ⏎ … ⏎ 🛠️ Exec ⏎ 📖 Read lines 1-10 from note.txt ⏎ 🛠️ Exec` | `OPENCLAW_E2E_OK`; card deleted |

**Slack stays plain (isolated formatter check).** Core progress lines from the real compositor, built with Slack's flags (no `toolIcons`) and rendered through Slack's real `formatSlackProgressDraftLine`, `buildSlackProgressTextBlocks`, and `buildSlackProgressCardBlocks`:

```
Slack flags:          draft "• Exec: running\n• Read: note.txt"; card "Exec — running\nRead — note.txt · running"; glyphs: none
control toolIcons:    draft "🛠️ Exec: running\n📖 Read: note.txt"; card unchanged (Slack cards ignore icon)
```

The existing Slack dispatch suite still asserts plain `Bash` / `Apply Patch` task titles.

**CI:** Everything is green on c6a2d40 except one test, `extensions/whatsapp/src/send.delivery-recovery.test.ts` ("preserves long styles and quotes only the first chunk"), in `checks-node-changed-extensions-bundle`; `openclaw/ci-gate` fails only because of it. This PR doesn't touch WhatsApp, and the same test fails the same way on clean `origin/main` 46635f6 (`expected [ …(3) ] to deeply equal [ …(5) ]`).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…claw#168032)

## What Problem This Solves

Discord progress drafts show tool-log rows without a per-tool glyph (`• Exec: running`), while Telegram shows `🛠️ Exec: running` since openclaw#167392. Discord already marks the 🧠 reasoning and 💬 commentary lanes, so its tool rows were the only unmarked lane.

## User Impact

Discord tool-log rows in progress drafts now start with the tool's text glyph (`🛠️ Exec`, `📖 Read`, `🩹 Apply Patch`). The 🧠 / 💬 lanes, plan rows, approval rows, and plain status rows are unchanged. No config changes. Slack and other channels keep plain rows.

## Why This Change Was Made

openclaw#167392 added the core opt-in (`toolIcons?: boolean` on `createChannelProgressDraftCompositor`, glyph table in `src/channels/progress-tool-glyphs.ts`) and left Discord as a follow-up. This PR sets `toolIcons: true` on every Discord compositor so all Discord paths render the same:

- live draft preview (`message-handler.draft-preview.ts`)
- retained progress continuation after handoff (`message-handler.progress-continuation.ts`)
- retained-card `edit` action rendering a progress snapshot (`runtime.messaging.messages.ts`)

No Discord-specific glyph code. Rows that already carry an explicit `icon` keep it.

## Tests

- `message-handler.draft-preview.rest.test.ts`: new regression through the real draft preview and Discord REST client: `🧠 _Planning the check_` / `💬 Looking at the workspace` / `🛠️ Exec: running` / `📖 Read: running`. Fails on main with `• Exec: running` / `• Read: running`.
- `message-bodies.test.ts`: a retained row's explicit icon (`🧪 Read`) wins over the tool glyph.
- `message-handler.process.draft-final.test.ts`: existing expectations updated to the glyph rows.

## Bounded cost

- One static `Record` lookup per core-built tool row on Discord (core opt-in from openclaw#167392).
- No new config keys, protocol fields, network calls, or extra Discord sends/edits; the draft text gains one glyph and a space per tool row, inside the existing per-message length bounds.
- Production: +3 lines. Tests: +65/−5. Docs: +3/−3. No extra Discord sends or edits in the runs above beyond the existing progress-draft cadence.

## Evidence

Isolated gateway (`HOME`/`OPENCLAW_STATE_DIR`/`OPENCLAW_CONFIG_PATH` under `/tmp`) with the real bundled Discord plugin against QA Lab's Crabline Discord provider server, `streaming.mode: "progress"`, `progress.toolProgress: true`. Rows below are the Discord REST bodies the plugin sent, from the Crabline provider recorder (`artifacts/crabline/discord-provider-server.jsonl`).

**Live model `openai/gpt-6-astra`** (`qa suite --provider-mode live-frontier --model openai/gpt-6-astra --channel-driver crabline --channel discord`), prompt asked for one exec then one read:

```
POST  "Working\n\n🛠️ Exec: running\n🛠️ Exec: running"
PATCH "Working\n\n🛠️ Exec: running\n🛠️ Exec"
PATCH "…\n\n🛠️ Exec\n🛠️ Exec\n🛠️ Exec: running"
PATCH "…\n\n🛠️ Exec\n🛠️ Exec\n🛠️ Exec\n📖 Read from glyph-proof.txt"
POST  final reply (separate message)
```

**Scripted model (`mock-openai`)**, commentary + one exec:

```
POST  "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D"
PATCH "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D\n🛠️ Exec: running"
PATCH "Working\n\n💬 SLACK-QA-COMMENTARY-200C8C6D\n🛠️ Exec"
POST  "SLACK-QA-COMMENTARY-DONE-200C8C6D"
```

The 💬 commentary lane keeps its prefix, and the final reply is one separate message, as before. Before this change, the same rows render as `• Exec: running` / `• Read: running` (the new REST regression fails on main with exactly that diff).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants