Skip to content

feat(discord): show per-tool glyphs on progress draft tool rows - #168032

Merged
obviyus merged 2 commits into
mainfrom
discord-tool-glyphs
Oct 10, 2026
Merged

obviyus merged 2 commits into
mainfrom
discord-tool-glyphs

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

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 fix(channels): Telegram progress drafts lost per-tool emoji on tool rows #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).

@clawsweeper

clawsweeper Bot commented Oct 10, 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: discord Channel integration: discord size: S labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Discord’s editable progress messages add tool-specific emoji to tool-log rows using the existing shared renderer.

Example: A Discord request runs Exec and Read with tool progress enabled.

  • Before: The draft shows “• Exec: running” and “• Read: running”.
  • After: The draft shows “🛠️ Exec: running” and “📖 Read: running”.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused implementation is worth merging and has relevant production-boundary observations; one added test is redundant.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The recorded isolated-Gateway run exercises the bundled Discord plugin through its production REST client against the authorized Crabline boundary and shows emoji-prefixed Exec/Read rows, preserved commentary, and separate final delivery. This is transport-boundary output, not actual Discord-client screenshot proof; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes
User problem: Discord tool-log rows lack the visual markers that distinguish tool activity from reasoning and commentary.
Reason: This changes an established presentation preference. The repository-authorized author supplies the direction, and the small adapter change provides a proportionate readability benefit.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, maintainer-directed presentation change that current main does not provide. No actionable correctness or security defect was found.

Priority: P3
Reviewed head: 5ef544c4b2caad884a69734146f28a5c80595d86

Before merge

None.

Findings

None.

Tests

  • Low-value test extensions/discord/src/actions/message-bodies.test.ts: keeps a retained row's explicit icon over the tool glyph: Remove this redundant case: it supplies an already-rendered snapshot icon, bypasses the changed glyph producer, and repeats explicit-icon preservation already covered by the shared compositor.
Agent review details

How this fits together

OpenClaw turns agent activity into progress text through a shared renderer. Discord sends and edits that text in live drafts and retained messages while delegated work continues.

flowchart TD
A[Agent activity] --> B[Shared progress renderer]
C[Discord progress settings] --> B
D[Shared tool glyph table] --> B
B --> E[Live draft]
B --> F[Retained progress message]
E --> G[Discord message transport]
F --> G
Loading

Technical review

Best possible solution:

Keep Discord’s presentation choice in its adapters and reuse the shared glyph producer.

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

Not applicable as a bug: plain Discord rows are the existing presentation choice. Current-main source and existing compositor tests establish the before-state.

Is this the best way to solve the issue?

Yes. Enabling the existing shared option at Discord’s three compositor call sites is the narrowest implementation and avoids duplicated glyph logic.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced production change: The pinned introduced diff enables toolIcons at all three Discord compositor call sites without adding a renderer, configuration key, dependency, or transport operation. (extensions/discord/src/monitor/message-handler.draft-preview.ts:128, 5ef544c4b2ca)
  • Current main still uses plain rows: Fetched main does not enable toolIcons in Discord’s live progress compositor. The merged shared-renderer PR explicitly left Discord as a follow-up, so it does not supersede this PR. (extensions/discord/src/monitor/message-handler.draft-preview.ts:119, e39552c18106)
  • Shared presentation owner: The existing shared line builder supplies glyphs only when toolIcons is enabled and excludes plan and approval rows. Snapshot rendering preserves explicit icons rather than regenerating them. (src/channels/streaming.ts:288, 5ef544c4b2ca)
  • Prior design and direction: fix(channels): Telegram progress drafts lost per-tool emoji on tool rows #167392 established the shared per-channel opt-in and explicitly reserved Discord for a maintainer decision. The supplied repository state identifies this PR’s author as MEMBER; despite REST reporting CONTRIBUTOR, the permission endpoint independently confirms write access.
  • After-change production boundary observations: The complete PR body records an isolated Gateway running the bundled Discord plugin against the Crabline provider server. Recorded POST/PATCH bodies contain “🛠️ Exec: running” and “📖 Read from glyph-proof.txt”; a separate scripted run preserves the commentary prefix and separate final delivery. Captured body source identity: 5c67e95361bee5edbc4b65daecc3434c592b69f4c4b6256316e8b1babdc3db37. (5ef544c4b2ca)
  • Supplemental regression coverage: The new preview test checks serialized message text through the production controller and RequestClient, including unchanged reasoning/commentary lanes. The body reports its base-fail/head-pass result; reviewer execution was prohibited. The downloaded screenshots were inspected and belong to earlier related PRs, so they were not credited as proof of this change. (extensions/discord/src/monitor/message-handler.draft-preview.rest.test.ts:216, 5ef544c4b2ca)

Likely related people:

  • Ayaan Zaidi: Raw commit 24a03ac adds extensions/discord/src/actions/runtime.messaging.messages.ts:145 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 24a03acf58c4; files: extensions/discord/src/actions/runtime.messaging.messages.ts)

PR surface

Source +3, Tests +60, Docs 0. Total +63 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 3 0 +3
Tests 3 65 5 +60
Docs 2 3 3 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 71 8 +63

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This improves optional tool-log readability without changing execution, configuration, routing, or final delivery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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.

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 (1 earlier review cycle)
  • reviewed 2026-10-10T00:08:06.585Z sha 97ccada :: needs maintainer review before merge. :: none

Reviewed October 9, 2026, 8:15 PM ET / October 10, 2026, 00:15 UTC (Revision 2).

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus marked this pull request as ready for review October 10, 2026 00:11
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 10, 2026
@obviyus
obviyus merged commit cb9bdcd into main Oct 10, 2026
199 of 207 checks passed
@obviyus
obviyus deleted the discord-tool-glyphs branch October 10, 2026 00:26
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

channel: discord Channel integration: discord docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

1 participant