Skip to content

fix(channels): long progress titles exceed the configured line budget - #168312

Merged
obviyus merged 1 commit into
mainfrom
fix/progress-line-chars
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/progress-line-chars

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes progress drafts exceeding maxLineChars when a prepared tool title contains a long path. Telegram showed a 232-character Read row even with a 40-character limit; Slack's detailed cards also rendered the unbounded label.

User Impact

Long prepared tool titles now use the configured line budget and a middle ellipsis, retaining the filename and failure status. No configuration, defaults, SDK contracts, or persisted state change.

Why This Change Was Made

Compact prepared titles in the shared channel line builder, reserving space for the surrounding row text before any renderer consumes the label. Telegram and Slack both consume that label directly. Discord and Mattermost already compact the compositor's complete text; they now receive the same bounded title. Authored commentary and ordinary tool rows retain their existing rendering.

Checked #150671: its authored-preamble completion metadata and quiet Slack behavior are unchanged; this only bounds named tool titles.

Evidence

Current-main baseline: aff6117e93512a393d101785148b141d3b271c33. Built candidate: 1e51409eaabc047a1bdef85a60c885087d71bb4f. All channel observations below are real Telegram Test Server TDLib timelines from isolated built Gateways.

Run Draft message ID Observed Read row Length
Baseline, limit 40 75744 📖 Read from /tmp/deep/…/file.txt failed (full path, no actual ellipsis) 232
Candidate repeat 1, limit 40 75948 📖 Read from…p/deep/file.txt failed 34
Candidate repeat 2, limit 40 76036 📖 Read from…p/deep/file.txt failed 34
Candidate default limit 120 76077 📖 Read from…/deep/deep/deep/deep/deep/deep/deep/deep/deep/deep/file.txt failed 78

The baseline overflow persisted through five edits (31.1–39.5 seconds). Both candidate repeats preserved the bounded row through five edits, delivered FINAL_LONGLINES_OK separately, then deleted the draft. Counts are Unicode code points; the corresponding UTF-16 lengths are 233, 35, 35, and 79.

The limit-40 controls were byte-for-byte unchanged across baseline and both repeats: 💬 I am going to carefully inspect…, 💬 Second I am going to carefully…, and ordinary 🛠️ Exec / running / blocked rows.

A separate real-provider run (openai/gpt-5-mini, low reasoning) read the same long path: draft 76123 showed a 35-character running row and a 34-character failed row, final 76124 delivered F3_LIVE_DONE, then the draft was deleted.

  • Regression fails on the baseline for both the default limit and 40; passes on the candidate.
  • Focused checks: node scripts/run-vitest.mjs src/channels/streaming.test.ts extensions/telegram/src/progress-draft-preview.test.ts extensions/slack/src/progress-blocks.test.ts extensions/slack/src/progress-blocks.card.test.ts — 78 tests passed, 122.47 seconds total; new core cases take milliseconds.
  • pnpm build and focused formatting passed in the isolated Linux build container. The pre-existing advisory Control UI gzip-budget warning also appears on the baseline build.
  • Exact-head ClawSweeper review: ready, no findings.
  • CI, final attempt: all selected checks completed, zero cancelled. Only checks-ui-e2e (1/2) and its aggregate openclaw/ci-gate fail. The two dashboard pin-click cases also fail on independent PR feat(doctor): show actionable Node lifecycle advice #59414, job 114161791045, with the same chat-gutter-stack pointer interception. This diff does not touch the Control UI or its mocked-Gateway dashboard fixture. The initial 16 fail-fast cancellations were covered by one maintainer-authorized replay; no code was repushed.

Two-way door: reverting restores the previous rendering. Blast radius is prepared named-tool titles in channel progress previews; no delivery, routing, provider, or storage behavior changes.

@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 in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS labels Oct 10, 2026
@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 07:25
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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

This PR bounds prepared tool titles to the configured progress-line budget while retaining path suffixes and status.

Example: Telegram displays a Read operation with a long path and maxLineChars set to 40.

  • Before: The supplied baseline shows a 232-character failed Read row.
  • After: The candidate displays “📖 Read from…p/deep/file.txt failed” in 34 Unicode code points.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused contract repair with relevant regression coverage and supplied shipped-entry-point evidence; pending CI does not lower patch quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied Test Server observations exercise the changed shared builder through isolated built Gateways and real Telegram drafts on the reviewed head, showing bounded long-path titles, retained failure status, unchanged controls, separate final delivery, and draft cleanup.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Long prepared tool titles make channel progress rows exceed the user's configured width and wrap excessively.
Reason: This restores an existing documented presentation contract with a narrow shared-owner change and relevant regression coverage.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current progress-title overflow without introducing a concrete defect. The earlier dashboard CI concern is independently confirmed outside this change; remaining checks are still running.

Priority: P2
Reviewed head: 1e51409eaabc047a1bdef85a60c885087d71bb4f

Before merge

None.

Findings

None.

Agent review details

How this fits together

Prepared agent activity enters the shared channel line builder, which produces structured labels, details, and status for channel progress renderers.

flowchart TD
  A[Prepared agent activity] --> B[Shared channel line builder]
  C[Channel progress configuration] --> B
  B --> D[Progress compositor]
  D --> E[Telegram preview]
  D --> F[Slack progress card]
  D --> G[Other channel previews]
Loading

Technical review

Best possible solution:

Keep title compaction in the shared channel builder so structured renderers receive the same bounded prepared title.

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

Current-main source exposes the unbounded prepared label to Telegram and Slack, and the supplied baseline Telegram observations demonstrate the overflow; this review ran no target code.

Is this the best way to solve the issue?

The focused repair uses the existing shared owner and compaction algorithm, preserving title suffixes and status without adding configuration or a competing rendering path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Configurable progress-line compaction keeps the original intent (7754722: Provide a configurable line budget, reduce preview reflow, and preserve useful command/path suffixes.)
  • Prepared tool titles and outcomes keeps the original intent (5c906f9: Share prepared activity across consumers while preserving meaningful titles, failures, and approvals.)
  • Entry-backed channel line construction keeps the original intent (b1f980f: Consolidate auto-reply and channel logic without intended changes to user-facing contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced repair: The pinned introduced diff bounds prepared named-tool labels using the existing compactor, subtracts surrounding rendered text, and rebuilds the structured line text. (src/channels/streaming.ts:430, 1e51409eaabc)
  • Current main still needs the repair: Current main returns the prepared line without bounding its title; Telegram consumes the structured label directly rather than compacting the complete row. (src/channels/streaming.ts:421, 699636375966)
  • Existing product contract: The original truncation commit introduced the configurable 120-character budget and suffix-preserving compaction. Some old local blobs were unavailable; GitHub's commit patch independently verifies this contract. (src/plugin-sdk/channel-streaming.ts, 77547226ce24)
  • Real Telegram behavior evidence: The PR body records isolated built-Gateway Test Server observations on the reviewed head: baseline overflow, two bounded candidate repeats, the default budget, unchanged controls, separate final delivery, draft deletion, and a real-provider run. (1e51409eaabc)
  • Independent CI failure attribution: GitHub annotations show the same two dashboard tests failing because the details gutter intercepts Pin to dashboard clicks on this PR and feat(doctor): show actionable Node lifecycle advice #59414. The latter changes Doctor code, not channel progress rendering, corroborating the author's explanation. (ui/src/e2e/session-dashboard.e2e.test.ts:495, e7a1375b1fe4)
  • Matching failure on the reviewed head: The reviewed head's annotations contain the matching dashboard click failures. Full job-log retrieval was blocked by the network allowlist; the annotations expose the relevant failure traces. (ui/src/e2e/session-dashboard.e2e.test.ts:571, 1e51409eaabc)

PR surface

Source +12, Tests +22, Docs +2. Total +36 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 13 1 +12
Tests 1 22 0 +22
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 37 1 +36

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Prepared titles bypass an existing presentation budget and cause progress-row overflow without affecting delivery or stored data.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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. Prepared-title compaction directly changes Telegram progress text, and the supplied Test Server observations exercise that change.

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-10T07:29:59.782Z sha 1e51409 :: needs changes before merge. :: none

Reviewed October 10, 2026, 3:36 AM ET / 07:36 UTC (Revision 2).

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

The dashboard failure is independently reproduced on #59414 (e7a1375b1fe47d186e74e2a2e7696cbab8c22b70): CI run 38034336859, checks-ui-e2e (1/2).

Both that run and this PR's first CI attempt fail the same two cases in ui/src/e2e/session-dashboard.e2e.test.ts:

  • shows a bounded visible outcome when a Canvas dashboard pin fails
  • pins an inline MCP App using only its session-bound view identity

Both time out clicking Pin to dashboard because the chat-gutter-stack chat-gutter-stack--details subtree intercepts pointer events. This PR changes only the channel prepared-title builder, its regression tests, and progress-draft documentation; it changes no UI layout, dashboard, click handling, or UI test fixture. The Control UI uses its mocked Gateway in this test, not a Telegram/Slack progress renderer.

The initial run has 16 fail-fast cancellations; openclaw/ci-gate reports that root UI failure and the resulting cancellations. The changed channels test shard passed, as did core production typechecking before its job was cancelled during the next graph. A single maintainer-authorized failed-job replay is in progress to let cancelled checks finish; no code was repushed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: the only red job is checks-ui-e2e (1/2), where two session-dashboard pin cases time out because chat-gutter-stack intercepts the Pin to dashboard click. The same two cases fail the same way on unrelated PR #59414 (doctor-only changes): https://github.com/openclaw/openclaw/actions/runs/38034336859/job/114161791045. This PR doesn't touch ui/; main push runs skip this lane, so the failure is inherited, not caused here. All other selected jobs completed green after one failed-job replay, and ClawSweeper is ready on this exact head.

@obviyus
obviyus merged commit 7738181 into main Oct 10, 2026
248 of 270 checks passed
@obviyus
obviyus deleted the fix/progress-line-chars branch October 10, 2026 07:42
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 7738181. Long tool titles now respect maxLineChars in progress drafts; Test Server before/after evidence is in the PR body.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…openclaw#168312)

Prepared progress-draft tool titles (for example 'Read from <long path>') were copied into the line label untruncated, so maxLineChars (default 120) never applied to them: a Telegram draft row stayed at 232 characters with maxLineChars=40 while commentary lines in the same draft were cut. The shared line builder now fits titled tool labels into the remaining line budget with the existing middle-ellipsis path compaction, so every channel using it benefits. Found by our Telegram Test Server bug hunt.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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