fix(telegram): restore DM draft streaming#39398
Conversation
|
🤖 We're reviewing this PR with Aisle We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛ Progress:
Latest run failed. Keeping previous successful results. Trace ID: Last updated on: 2026-03-08T02:48:45Z |
fa25774 to
b6ad588
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa25774233
ℹ️ 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".
| maxChars: draftMaxChars, | ||
| thread: threadSpec, | ||
| previewTransport: useMessagePreviewTransportForDm ? "message" : "auto", | ||
| previewTransport: useMessagePreviewTransportForDmReasoning ? "message" : "auto", |
There was a problem hiding this comment.
Clear DM draft when final fallback bypasses materialize
Switching the DM answer lane to previewTransport: "auto" means answers now use draft transport when sendMessageDraft is available, but finals with inline buttons/media/error/oversized text cannot take the materialize path (canMaterializeDraftFinal returns false in createLaneTextDeliverer) and instead fall back to sendPayload; in that path no draft-clear call is issued, and the later clear() cleanup only removes message previews, not draft IDs. In DM chats this leaves stale answer text in the Telegram draft/input area after the real final message is sent, which is a user-visible regression introduced by enabling draft transport for the answer lane.
Useful? React with 👍 / 👎.
|
Landed via temp rebase onto main.
RUN v4.0.18 /Users/obviyus/Developer/clawdbot ✓ src/telegram/draft-stream.test.ts (27 tests) 63ms Test Files 3 passed (3) |
Greptile SummaryThis PR surgically narrows the DM preview transport workaround originally introduced in #33453. The previous fix forced Key changes:
The production Safety assessment: This PR is safe to merge. It replaces an over-broad workaround with a more precise, targeted fix backed by a direct regression test that validates the draft materialization behavior. Confidence Score: 4/5
Last reviewed commit: b6ad588 |
|
🤖 We're reviewing this PR with Aisle We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛ Progress:
Latest run failed. Keeping previous successful results. Trace ID: Last updated on: 2026-03-08T02:56:35Z |
* main: (290 commits) test: stabilize exec resolver timeout fixture chore: add changelog and format fix for openclaw#39414 fix(chat): preserve sender labels in dashboard history docs: clean up latest changelog sections docs: dedupe changelog contributor attribution fix(ci): resolve current gate regressions refactor(voice-call): share tts deep merge fix: land openclaw#39337 by @goodspeed-apps for acpx MCP bootstrap fix(ci): resolve type regressions on main fix: document discord agentComponents schema parity (openclaw#39378) (thanks @gambletan) (openclaw#39378) fix(discord): validate agentComponents config test: cover daemon probe auth seam refactor: preserve explicit mock voice-call values refactor: register gateway service adapters refactor: reuse shared gateway probe auth refactor: split daemon status gathering refactor: centralize strict numeric parsing refactor: normalize voice-call runtime defaults fix(ci): pin multi-arch docker base digests docs: add changelog for Telegram DM draft restore (openclaw#39398) ...
(cherry picked from commit 722c5e5)
…r live test fixes (#1795) * Changelog: credit openclaw#39328 to @vincentkoc (cherry picked from commit 2ec478c) * Changelog: move openclaw#39328 credit to section end (cherry picked from commit 5b30c9d) * Pi Runner: gate parallel_tool_calls to compatible APIs (openclaw#39356) * Pi Runner: gate parallel_tool_calls payload injection * Pi Runner: cover parallel_tool_calls alias precedence * Changelog: note parallel_tool_calls compatibility fix * Update CHANGELOG.md * Pi Runner: clarify null parallel_tool_calls override logging (cherry picked from commit daecd2d) # Conflicts: # CHANGELOG.md # src/agents/pi-embedded-runner-extraparams.test.ts # src/agents/pi-embedded-runner/extra-params.ts * docs: add changelog for Telegram DM draft restore (openclaw#39398) (cherry picked from commit 722c5e5) * fix: document discord agentComponents schema parity (openclaw#39378) (thanks @gambletan) (openclaw#39378) Co-authored-by: Shadow <[email protected]> (cherry picked from commit 9c8e34d) * fix: land openclaw#39337 by @goodspeed-apps for acpx MCP bootstrap Co-authored-by: Goodspeed App Studio <[email protected]> (cherry picked from commit 5659d7f) # Conflicts: # extensions/acpx/openclaw.plugin.json # extensions/acpx/src/config.test.ts # extensions/acpx/src/config.ts # extensions/acpx/src/runtime-internals/test-fixtures.ts # extensions/acpx/src/runtime.test.ts # extensions/acpx/src/runtime.ts # extensions/acpx/src/service.ts * docs: clean up latest changelog sections (cherry picked from commit c743fd9) * fix: land contributor PR openclaw#39516 from @Imhermes1 macOS app/chat/browser/cron/permissions fixes. Co-authored-by: ImHermes1 <[email protected]> (cherry picked from commit d15b6af) # Conflicts: # CHANGELOG.md # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeBrowserProxy.swift # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeModeCoordinator.swift # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeRuntime.swift # apps/macos/Sources/RemoteClaw/PermissionsSettings.swift # apps/macos/Tests/RemoteClawIPCTests/MacNodeBrowserProxyTests.swift # apps/shared/RemoteClawKit/Sources/RemoteClawChatUI/ChatView.swift # apps/shared/RemoteClawKit/Sources/RemoteClawKit/BrowserCommands.swift # apps/shared/RemoteClawKit/Tests/RemoteClawKitTests/ChatComposerPasteSupportTests.swift * fix: stage docker live tests from mounted source (cherry picked from commit 21df014) * fix: add minimal process shim for acpx mcp-agent-command The upstream process.ts depends on gutted runtime-api, so provide a minimal spawnAndCollect implementation that satisfies the import. --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: gambletan <[email protected]> Co-authored-by: Shadow <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Summary
Restore native
sendMessageDraftpreview transport for Telegram DM answer streaming.Keep DM reasoning on message transport, and add a regression test proving draft materialization does not send a duplicate final message.
Testing
pnpm test -- src/telegram/draft-stream.test.ts src/telegram/lane-delivery.test.ts src/telegram/bot-message-dispatch.test.ts