Skip to content

fix(telegram): keep raw command progress rows within line budget - #168464

Merged
obviyus merged 1 commit into
mainfrom
fix/telegram-raw-command-line-budget
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/telegram-raw-command-line-budget

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #130144

What Problem This Solves

Telegram raw-command progress rows exceed progress.maxLineChars because the tool icon, label, separators, and status are added outside the detail's allowance.

User Impact

The complete Telegram progress row now respects the configured line budget, including running and blocked raw commands. No new configuration, SDK change, or separate command limit is introduced.

Why This Change Was Made

Reserve the fixed row text before shortening overflowing detail with the existing compactor. Preserve already-fitting rows and their formatting. Oversized prepared labels also go through the existing compactor.

This stays in Telegram's structured renderer: Discord and Mattermost use the shared whole-row text formatter, while Slack has its own independent native/card rendering path.

Checked #126480: its Slack compact commentary behavior and documentation are unchanged.

Evidence

  • Telegram Test Server, maxLineChars: 40, raw command text, raw tool detail: two baseline recordings reached 53 code points; both candidate recordings peaked at 36 for tool rows, with zero over-budget rows. Entire progress rows, including commentary, peaked at 38.
  • Status-only control is unchanged: Exec rows remain 15 code points, Read remains 34, and the overall maximum remains 38.
  • The Read control is byte-for-byte unchanged: 📖 Read from…p/deep/file.txt failed.
  • Real OpenAI gpt-5-mini run on the built candidate: two successful streamed provider responses, an actual exec turn, bounded progress rows, and the requested final reply observed by TDLib.
  • Focused renderer regression: four cases fail on the baseline for over-budget output; all eight cases pass on the candidate, covering HTML and rich-message transports, completed/running commands, prepared labels, and the fitting Read control. pnpm test extensions/telegram/src/progress-draft-preview.test.ts --maxWorkers=1: 7.36s wrapper wall time, 5.89s Vitest duration.
  • pnpm build and targeted Oxfmt check pass in Linux isolation. Test messages are removed with receipt-validated TDLib read-back; leases, temporary credentials, and listeners are cleaned up.
  • Hosted CI is blocked by the unrelated session-accessor-boundary guard: dispatch-from-config.test-support.ts has six legacy reads against a zero baseline. This head and main fail with the same file, count, and message. The diff does not touch that file, its imports, or the guard.
  • Fail-fast cancelled two jobs: check-test-types (the affected extensions-test graph already passed) and QA Smoke CI (profile 4/4) (all nine scenarios, including the six Telegram scenarios, already passed before cancellation). The focused Telegram test shard, production types, extension lint, and channel-boundary checks passed.

Merge danger: two-way door; reverting fully restores the previous renderer. Blast radius is Telegram structured progress rows; no persisted state, transport delivery policy, or other channel is changed.

@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

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram size: S labels Oct 10, 2026
@obviyus
obviyus marked this pull request as ready for review October 10, 2026 13:46
@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:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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: 👀 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

This PR includes Telegram tool icons, labels, separators, and statuses in the existing progress-line character budget.

Example: A raw Exec progress row uses maxLineChars: 40.

  • Before: The detail receives the full allowance, then the renderer adds the label and running status outside it.
  • After: The renderer reserves those characters before compacting the detail.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation and meaningful renderer regressions support correctness, but the claimed live Telegram results are not inspectable.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Telegram progress rows can exceed the operator's configured character limit.
Reason: This focused repair restores the existing budget contract without adding settings, changing defaults, or expanding the SDK; Related is appropriate for the broader linked issue.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a current Telegram line-budget defect, and source review found no introduced correctness or security bug.

Priority: P2
Reviewed head: 9f50ea282bdb68b59259db11bee9fb20da142b7c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Publish inspectable Telegram Test Server before/after evidence showing complete raw-command rows within the configured budget and the fitting Read control unchanged.
Agent review details

How this fits together

The shared progress compositor supplies structured activity rows; Telegram renders them into HTML or rich-message previews using the account's configured line budget.

flowchart LR
  A[Tool activity] --> B[Shared progress compositor]
  B --> C[Telegram row renderer]
  D[Account line budget] --> C
  C --> E[HTML or rich preview]
  E --> F[Telegram draft stream]
Loading

Technical review

Best possible solution:

Keep complete-row budgeting in Telegram's structured renderer while preserving the existing configuration and shared compactor.

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

Yes at source level: current main grants detail the entire configured budget and then adds visible row text; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The repair belongs in this Telegram adapter because it adds the surrounding text; it does not resolve the linked issue's separate command-suffix preservation request.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Structured Telegram row assembly changes intended behavior with a stated reason (8d465d7: The progress-headline work split Telegram rendering into its own owner while preserving structured tool rows.)
  • Shared content for HTML and rich rendering keeps the original intent (3fb2ef2: Unify progress-card snapshots and native rendering instead of maintaining competing presentation state.)
  • Prepared activity visibility keeps the original intent (5c906f9: Keep routine polling quiet while preserving failures, approvals, and prepared activity facts.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit aff6117 adds extensions/telegram/src/progress-draft-preview.ts:69 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: aff6117e9351; files: extensions/telegram/src/progress-draft-preview.ts)
  • Peter Steinberger: Raw commit 8d465d7 adds extensions/telegram/src/progress-draft-preview.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8d465d71b5f7; files: extensions/telegram/src/progress-draft-preview.ts)

PR surface

Source +19, Tests +63, Docs +2. Total +84 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 26 7 +19
Tests 1 63 0 +63
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 91 7 +84

Labels

Label changes:

  • add P2: Overlong progress rows impair Telegram readability, while final replies and message delivery remain unaffected.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • add proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Telegram Test Server can observe the changed progress-row clipping in HTML and rich-message output.

Label justifications:

  • P2: Overlong progress rows impair Telegram readability, while final replies and message delivery remain unaffected.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Telegram Test Server can observe the changed progress-row clipping in HTML and rich-message output.

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.

Reviewed October 10, 2026, 9:51 AM ET / 13:51 UTC.

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: the only red job is check-source-contracts, which reports six legacy sessionAccessorRead calls in src/auto-reply/reply/dispatch-from-config.test-support.ts. The same check fails identically on main (https://github.com/openclaw/openclaw/actions/runs/38056049112/job/114224856770), and this PR only touches the Telegram progress renderer, its test and docs. The two cancelled jobs had already passed their affected parts (extensions-test types; QA Smoke Telegram scenarios). ClawSweeper is ready on this exact head.

@obviyus
obviyus merged commit 7635272 into main Oct 10, 2026
181 of 188 checks passed
@obviyus
obviyus deleted the fix/telegram-raw-command-line-budget branch October 10, 2026 13:56
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 7635272. Raw command progress rows on Telegram now respect maxLineChars; 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
…nclaw#168464)

Telegram progress rows for raw commands exceeded progress.maxLineChars (53 code points at a limit of 40), because the renderer gave the compacted command detail the whole line budget and then added the tool icon, label and status around it. The detail now gets only the remaining budget, so the complete row fits; fitting rows and the existing clipping policy are unchanged. Found by our Telegram Test Server bug hunt; related openclaw#130144.

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

channel: telegram Channel integration: telegram docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. 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. 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