Skip to content

fix(telegram): steered answers quote the wrong input - #178124

Merged
obviyus merged 13 commits into
openclaw:mainfrom
ChuLaiTheGreat:fix/telegram-consumed-input-reply-source-20261020
Nov 13, 2026
Merged

obviyus merged 13 commits into
openclaw:mainfrom
ChuLaiTheGreat:fix/telegram-consumed-input-reply-source-20261020

Conversation

@ChuLaiTheGreat

@ChuLaiTheGreat ChuLaiTheGreat commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Current CI repair — November 13

Head 148aa18a3ab3c9ea941916a7ab378a1162654702 adds the existing home-readonly.real-gateway.e2e.test.ts to the canonical real-Gateway inventory. It previously ran in the parallel bundled UI lane despite starting a real Gateway. The existing selector now routes it to the serial real-Gateway lane; the scenario, assertions and 120-second timeout are unchanged. This corrects a verified scheduling omission; a passing new CI run is still required to establish the timeout is resolved.

New-head CI run 43454717466 is action_required and has not run its jobs: upstream workflow approval is required. The available account has no upstream write/admin permission.

Previous run 43440680720 had two failing jobs:

  • Home reader timed out after 120 seconds with agents.list pending. The same scenario passed on scheduled main in job 131944718121, taking 117.5 seconds in the bundled lane.
  • The four native Talk after-cancel assertions also fail on scheduled main b4da3463d3a78dc7fd0e553dfe33e49bfa1e2e3c, job 131944723210, with the same expected completion versus fallback text. This is independently reproduced upstream, not evidence of passing Talk behavior.

Validation for this one-line change: git diff --check and manual inspection of canonical inventory consumers. Local ownership test did not run: the initial isolated environment failed Bun setup because curl was absent; the subsequent Node-only environment could not register before the retention lock timeout. No local test success or full CI success is claimed. Earlier proofs below retain their original commit scope.

Closes #178120.

What Problem This Solves

Telegram can quote the wrong input when an embedded run consumes another message while an earlier answer is buffered. Capture each assistant message’s consumed input synchronously, retain it through buffered delivery and native transcript persistence, and preserve its implicit reply classification through final threading and pending-final payload preparation.

User Impact

Answers retain the input they consumed. Implicit targets respect off / first / all; explicit quotes and quote suppression retain precedence. Legacy transcript JSON remains readable. The optional source fact needs no configuration or database migration.

Evidence

Telegram Test Server E2E (exact head 3662dc8280a9, this branch merged with main)

Real Gateway built from this head and from main 8ebe740925ca, Telegram Test Server DM driven by a userbot, scripted model, replyToMode: "all". The user sends Please answer STEERA. The model answers STEERA answer text and starts an exec tool (sleep 12). Six seconds later the user sends Please answer STEERB, which is steered into the same run, and the next model call answers STEERB answer text.

Reply main 8ebe740 this PR 3662dc8
STEERA answer text replies to the STEERA message replies to the STEERA message
STEERB answer text replies to the STEERA message (quote "Please answer STEERA") replies to the STEERB message
  • On this head the STEERB reply carries no automatic quote excerpt; on main the wrong-target reply quoted the STEERA text.
  • Merge with main resolved one conflict in src/agents/embedded-agent-subscribe.types.ts (both sides add optional subscribe params).

Current head: 92943dc42b1c90ab5c224a0ac63b5c7d424dd64c. Integrated main: 11091f0bf62f93465c03aae211a3ae185cde88ae.

Conflict and regression-budget update — 29 October

Main #185730 intentionally replaced restart reconstruction/replay with ordinary resumed input and deleted main-session-recovery. This update honors that deletion instead of restoring the old 5,000-line test or its removed dependencies. The contribution's now-obsolete “retries a persisted implicit-source final before transport enqueue” case is removed with that owner. It is not claimed to run on the replacement restart architecture. The three consumed-input subscriber cases, including actual transcript persistence/readback, and the six pending-final/threading/legacy-transcript cases remain byte-identical to the previous head. Their historical passing results retain their old heads.

The stream projection fixture now forwards the optional getUserTranscriptContexts fact in its legacy comparison object, matching the explicit production subscription. This is a one-line fixture-contract correction, not a claim to fix the reported theme-initialization failure.

The prior head's test-line gate reported net +274 test lines. The current contribution is net +241 LF bytes against the integrated main: 159 for consumed-input capture/persistence, 81 for implicit/explicit threading and legacy transcript cases, and one for the existing projection fixture. Following the documented test-line allocation policy, a separate config/test-lines-allocations/telegram-consumed-input-reply-source.txt grants exactly 241 lines for these regressions. The shared scalar and all pre-existing allocation records are unchanged. No assertion, coverage or timeout was weakened to satisfy this gate; the new native ratchet result awaits CI.

The other prior-head Bun check failed attempt-stream-prepare.test.ts → “projects only subscriber facts while preserving real stream reads and effects” with Theme not initialized. Call setTheme() first. The failing test source was byte-identical to integrated main before the optional-callback fixture correction. This has not been reproduced on a baseline locally, is not claimed inherited or fixed, and remains for upstream validation. No blind rerun was requested.

Current-tree static checks: syntax-only parsing of all 18 TypeScript/MJS contribution files using the existing Node 24.18.0 executable; contribution whitespace; relative-import path existence; exact preservation of the remaining regression bodies and upstream fixture except for the optional callback. Node 24.18.0 was used only as a parser, without importing or executing contribution source; it is below the current source-checkout runtime requirement and supplies no supported-runtime or SQLite qualification. No dependency installation, compiler/typecheck, lint/format runner, native ratchet, behavioral test, model/Gateway/Telegram scenario, or CI rerun was performed. Local autoreview is unavailable; direct source review only, without subagents. Current-head CI and maintainer validation remain pending.

Conflict resolution — 28 October

The branch now incorporates the integrated main while retaining the consumed-input reply-source correction. Upstream moved PrepareEmbeddedAttemptStreamInput into attempt-stream-prepare.types.ts; the optional transcript-context getter now lives on that owner. The stream implementation retains the complete upstream explicit-field subscription construction, with only the existing getter forwarding added. No duplicate local type is retained.

The pending-final fixture retains the complete upstream consolidated test body. Its six contribution cases (implicit first/all threading, explicit inline quote, and three old/new transcript cases) are byte-identical to the previous head. The two older standalone checks already covered by upstream's tables were not restored.

Static checks on this exact tree: Node 24.18.0 syntax-only parsing of all 18 contribution paths, git diff --check, exact comparison of the upstream stream/type owners except for the callback, and exact preservation checks for the upstream fixture and six contribution cases. The other contribution paths match Git's automatic merge output. The PATH-selected Node 26.8.2 failed TypeScript syntax-check setup; the explicitly selected existing Node 24.18.0 parsed all paths successfully. No contribution source was imported or executed.

Not rerun: compiler/typecheck, behavioral tests, lint, packaged survivor, Gateway/model/Telegram scenarios, or CI. The shared autoreview executable remains unavailable; this update received direct source review, without subagents. Current-head CI and maintainer validation remain pending. Historical evidence below retains its original heads and is not transferred to this tree.

Historical import correction — 27 October

Head 08a9bf18e915da011656e59624632c436a9d67b5 corrected the remaining test-only UserTranscriptContext import to its canonical attempt-llm-boundary.types.ts owner. This addressed the parent native test-type TS2459 diagnostic; the two production imports had been corrected on parent 54a02a08cae7141b5ac453c48f7e77176a0926c6. The canonical imports are retained by this merge.

That parent also had a distinct model-switch assertion failure in agent-command.live-model-switch.test.ts, involving supportsReasoningEffort: true. It remains separately recorded: this contribution has not changed that file or reproduced the failure locally, and does not claim to have fixed it or established inheritance.

Historical validation before the 25 October branch update

Historical head: 09517e7ab48747e2935ffbab41d3c90d2bde4202 had its earlier conflict with main 94dacc48dfb325197481e95cc0fe3fd863eec645 resolved. The pending-final test retains the entire upstream consolidation plus this contribution’s six regressions. The native database-worker inventory retains both the reply-source case and upstream update-repair cancellation case, once each. Independent review found no actionable resolution defect.

On this exact resulting tree, secretless Linux containers with Node 24.22.0 and dependencies installed from the new frozen lockfile pass:

  • 32 focused native cases: all three subscriber source cases, all 28 pending-final owning-file cases, and the real persisted implicit-source retry case. The other 194 restart-recovery cases are excluded by an explicit name filter, not claimed as executed.
  • Production core types and all three affected native test-type graphs: core-test-agents-root, core-test-agents-sessions, core-test-messaging.
  • Native type-aware core and test-inventory lint, formatting on all 17 contribution paths, and contribution whitespace checks.
node scripts/run-vitest.mjs src/agents/embedded-agent-subscribe.reply-source.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/auto-reply/reply/pending-final-delivery.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts -t 'retries a persisted implicit-source final before transport enqueue' --maxWorkers=1
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
node scripts/run-tsgo-core-test-shards.mjs --ci-graphs-json '["core-test-agents-root","core-test-agents-sessions","core-test-messaging"]' --concurrency 1

Parent eb3874c1 had separately passed 94 focused cases across capture/persistence, final recovery, payload production, transcript reading and reply threading, with one existing Windows-only case skipped on Linux. That is parent evidence, not 94 additional current-head cases. Earlier red/green proof establishes the implicit-source recovery regressions against the reviewed producer/threading implementation. The subscriber fixture persists captured assistant messages and reads their actual source IDs through the native database worker.

The shared autoreview executable is unavailable and was not run. Native compiler, lint, format and test budgets were not changed.

Packaged update and CI scope

The complete native published-package sqlite-volume survivor recipe passes in run 39504398170, job 118909878709, completed 20 October 2026 at 22:49 UTC. Candidate package source is 09517e7ab48747e2935ffbab41d3c90d2bde4202 (tree fb409e5571e51267017a43b478f9052f5ce886c3); the actual mounted E2E tooling is public PR #178801, 637db088c3fb0edcf516c74d63892becbbd7466e (tree 10e70ebae01184a134d2b01eefffebb37f3f5bdc, sole parent 5a0b5006). The native entry point is bash scripts/e2e/upgrade-survivor-docker.sh, installing the complete candidate tarball through the shipped updater from published [email protected].

  • Full native publishable package: 122,402,366 bytes, SHA-256 80bef2833f9ee9f8327a32f16d9ab6ec2d78ee084bb684802827d4c4f903799e. Complete registry source/version/integrity validation passes for all four required packages.
  • The update succeeds in 1,444.545 seconds against the unchanged 1,500-second command budget. Docker/lane budgets remain 2,280 seconds / 2,580,000 ms, with the original 12 GiB / four-CPU fixture, original assertions and volume quotas.
  • The real index is still oversized: 1,063,044 raw bytes, including 1,060,022 plugin-array bytes and 2,314 install-receipt bytes. The required projection is 14,353 bytes, preserving complete receipts and 76 plugin entries. This is a fresh run of the unchanged scenario, not a claim that the earlier 1,063,050-byte failed artifact was recovered.
  • All 49 named phase end states pass, including automatic migration, survival, Gateway history, Doctor idempotence, Gateway restart, post-restart history and final restarted survival. The synthetic volume retains 4,800 sessions, 23,890 events and 2,200 cron jobs. Gateway RPC verifies eight conversation samples across two agents before and after restart; their complete exported sample arrays and message digests are identical.
  • The actual changed Doctor-budget consumer runs: persisted totals are 4,803 sessions / 23,893 events / 2,203 cron jobs / nine enabled distinct plugin roots, yielding the native 717-second budget. Doctor idempotence completes in 276 seconds and the native assertions pass afterward. The three additional baseline records explain the difference from the volume-only counts above.

Selected redacted native terminal output (the full job log is linked above):

sqlite-volume sessions=4800 events=23890 cronJobs=2200
plugin-index-summary {"raw":1063044,"summary":14353,"installRecords":2314,"plugins":1060022,"diagnostics":2,"pluginCount":76}
SQLite volume idempotence doctor completed in 276s (budget 717s).
sqlite-volume Gateway RPC verified 8 conversations across 2 agents
Upgrade survivor Docker E2E passed [email protected] scenario=sqlite-volume candidate=2026.10.5 updateRestartMode=manual idempotence=276s startup=143s updateRestart=manuals healthz=1s readyz=1s status=13s.
PACKAGE_SUMMARY {"head": "09517e7ab48747e2935ffbab41d3c90d2bde4202", "tree": "fb409e5571e51267017a43b478f9052f5ce886c3", "exit": 0}

The job is terminal success, with native driver exit 0 and successful final phase receipts. The four explicitly inspected host-owned package/image/mount/registry containers settle at exit 0 without OOM or a remaining PID; no unavailable inner-container inspect receipt is invented. Exported summaries are tail-limited and redacted, so the conclusion also uses the complete phase entries, valid targeted Gateway/budget receipts and native terminal result. This is synthetic package compatibility and actual shipped CLI/Gateway execution; it provides no live model/Telegram/account proof, production deployment, Clarity-10.3 migration qualification or idle-RAM comparison.

The earlier 26fe6036 runtime-only success and 39491732163 partial updater success remain historical. That latter run failed at the full-index E2E reader (1,063,050 bytes versus 1 MiB), before final retention/restart/idempotence; its failure is preserved. Public PR #178801 repairs only the affected E2E readers, without changing the candidate package or weakening those checks.

The previous eb3874c1 CI had two UI assertion failures and an unrelated GitHub label HTTP 500. This merge includes upstream UI fixes for transcript metadata after reload (fe739f62) and native touch gestures (051bf6fa); its UI tree is exactly the integrated main’s tree. The historical 09517e7ab48747e2935ffbab41d3c90d2bde4202 check runs were observed terminal without a failure; skips and neutral checks remain distinct. This is not the CI result of the current head. Neither old signature is relabeled inherited or fixed solely from source identity, and no blind CI rerun is requested.

Remaining proof / review

Live Telegram Test Server proof remains unexecuted. The exact-head Gateway/model controls below use a trusted credential-resident relay and a synthetic Bot API; they do not supply a live Telegram lease or delivery proof. The complete package survivor, post-restart history retention and idempotence proof is supplied above. It does not replace the remaining authenticated Gateway/model/Telegram capture for consumed-input reply behavior. No deployment or release acceptance is claimed.

Ready for review.

Exact runtime follow-up — October 21

The unchanged head 09517e7ab48747e2935ffbab41d3c90d2bde4202 now has its own successful native qaRuntime build in run 39621479405. Frozen dependencies, the complete selected runtime build, and both native build/postbuild stamps are verified; both stamps identify this head with clean inputs. The actual build container exited 0 with no OOM and no remaining PID. The finite hosted build removed its own source/dependency/cache payloads after exporting the candidate runtime. This is runtime preparation, not a full publishable-package build, deployment, or maintainer contract decision.

The exact candidate runtime is now prepared for the isolated live recipe. Distinct consumed-input targets, explicit quotes, suppression, and off/first/all policies still need the real Gateway/model/Telegram readback; the earlier complete packaged survivor remains separately attributed.

Additional exact-head Gateway/model control — 22 October

On unchanged head 09517e7ab48747e2935ffbab41d3c90d2bde4202, a fresh secretless built Gateway admitted a second text input while the first primary-model request was held at the external transport. Both real primary-model responses completed. With replyToMode: all, the native Telegram adapter sent each exact final answer to its own input message, including the queued second turn. The fixture uses synthetic identities and a loopback Bot API; this does not prove live Telegram, same-attempt steering, or installed downstream behavior. All 58,307 tracked source blobs match the contribution, and both build stamps identify clean inputs at this head.

The broader recipe is not passing: a subsequent replyToMode: off turn was refused by the fixture transport's request budget after an auxiliary recap request consumed a slot. The auxiliary request was not forwarded to a provider; neither was that final primary request. No model fallback or retry was used. Quote suppression remains unverified by this new control; its existing native tests are separate evidence. Archive-layout and retired queue-option setup failures are preserved as setup failures, not product regressions. The original source/policy tests and actual Telegram acceptance remain distinct.

Quote-off model control — 22 October

A distinct fresh check now passes on unchanged head 09517e7ab48747e2935ffbab41d3c90d2bde4202: one synthetic webhook turn, one completed primary-model response (HTTP 200), and one final native sendMessage with neither reply_parameters nor reply_to_message_id under replyToMode: off. All 58,307 tracked source blobs and both clean build stamps match. The transport now classifies auxiliary requests before applying its primary-request budget; no auxiliary inference was forwarded. The previously completed overlapping turns were not repeated.

The native scenario, Gateway, and Docker container all finish successfully: one scenario, exit 0, terminal PID 0, no OOM, and container removed. This supplies the missing quote-off Gateway/model/adapter boundary, without changing contribution source or reclassifying the earlier failed broader recipe. Telegram transport and identities remain synthetic; live delivery, same-attempt steering, and the remaining live quote-policy matrix are still unverified. No client runtime, merge, or release changed.

Same-attempt steering boundary — October 22

The unchanged head 09517e7ab48747e2935ffbab41d3c90d2bde4202 now passes one additional isolated built-Gateway scenario with the selected real model and the native Telegram adapter. The Bot API and sender identities are synthetic. All 58,307 tracked source blobs and both clean native build stamps match this head.

Two fresh inputs are durably admitted while the first model response is held. The native controller records the second input as consumed with reason=active_run_injected; the trace contains one native run with one attempt. Both real model requests complete once. The model emits only RESULT-A and RESULT-B, with no explicit reply directives. The two final transport payloads refer respectively to input A and input B. This establishes same-attempt steering separately from the earlier followup and quote-off controls.

The Gateway and actual container both exit 0, with PID 0 and no OOM; the container is removed and the finite validation cycle closes successfully. The earlier setup attempt failed native configuration validation because the fixture supplied a retired debounce tuning key; it admitted no input and made no model request. Only that fixture option was removed. The passing run retains an initial startup-unavailable observation followed by native durable completion, without a manual resend. No contribution source, guard, assertion, timeout, or resource limit changed.

Limits: this is synthetic Bot API boundary evidence, not live Telegram or installed-candidate acceptance. It adds no new persisted-history assertion or fresh baseline regression result. The complete live quote-policy matrix remains open; earlier negative results and the separate upgrade-survivor evidence retain their original scope. No client deployment, merge, release, or maintainer approval is claimed.

Additional isolated reply-policy checks (exact head 09517e7)

Two fresh native Gateway/webhook scenarios add real-model evidence without repeating the accepted steering or implicit quote-off cases. All tracked source bytes and runtime build stamps match the contribution head. In first mode, the single final answer is implicitly attached to its consumed input. In a separate fresh turn with implicit replies off, the model emits an explicit reply directive to the earlier input; the native final payload retains that earlier target and strips the directive from visible text. Both selected-model requests complete once with HTTP 200. The scenario, both Gateway lifetimes, and actual Docker process terminate successfully; the container is removed and the validation cycle closes.

These are synthetic Bot API boundary checks, not live Telegram acceptance. The first check has one final payload and does not prove the multi-payload first-only limit. Existing buffered-source, same-attempt steering, quote-off, transcript/recovery and upgrade evidence keep their original scope. The complete live reply-policy matrix remains open. No contribution source, client runtime, maintainer approval, merge or release changed.

@clawsweeper

clawsweeper Bot commented Oct 20, 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 agents Agent runtime and tooling size: M labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR captures each assistant message’s consumed Telegram input and preserves its reply target through buffered delivery and transcript persistence.

Example: Telegram receives “Please answer STEERB” while the STEERA run is still active.

  • Before: STEERB answer text replies to STEERA and quotes its input.
  • After: STEERB answer text replies to STEERB.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, source-correct and proven through Telegram; exact-head CI completed with only independently reproduced upstream Talk failures.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied real Gateway and Telegram Test Server run exercises same-attempt steering and shows STEERB replying to its own input after the fix; the sole subsequent change is test scheduling, so that behavior proof remains applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Telegram answer to a steered input can quote an earlier input, making the conversation misleading.
Reason: Distinct replies should retain their consumed input under the existing steering and reply-policy contracts; this requires no new configuration or product direction.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a current-main Telegram reply-target bug, with sufficient behavior proof and no actionable introduced defect; the remaining CI failures also reproduce on main.

Priority: P2
Reviewed head: 148aa18a3ab3c9ea941916a7ab378a1162654702

Before merge

None.

Findings

None.

Agent review details

How this fits together

The embedded-agent subscriber receives model lifecycle events and consumed-input facts, then supplies buffered replies and persisted assistant delivery facts to shared threading and Telegram delivery.

flowchart LR
A[Telegram inputs] --> B[Consumed input registry]
B --> C[Assistant event subscriber]
C --> D[Buffered reply payloads]
C --> E[Assistant transcript]
E --> F[Final payload preparation]
D --> G[Shared reply threading]
F --> G
G --> H[Telegram delivery]
Loading

Technical review

Best possible solution:

Capture the consumed input at the existing synchronous assistant boundary and carry it through existing delivery facts while preserving explicit quotes and channel reply policy.

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

Current main retains the missing per-assistant source capture, and the supplied real Telegram baseline demonstrates the wrong target; this read-only review executed no product code.

Is this the best way to solve the issue?

The patch fixes the producer boundary before buffering can observe later steering, reuses existing transcript and threading owners, and resolves the earlier implicit-source finding.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Steered answer segmentation and final payloads keeps the original intent (6349e43: Deliver completed answers to successive steered inputs in order using subscriber-owned answer segments.)
  • Explicit versus implicit reply identity keeps the original intent (c67dc59: Preserve explicit routed reply identity and prevent incorrect delivery suppression across threads.)
  • Synchronous assistant-source capture keeps the original intent (af210e1: Bind assistant-source identity at event ingress to prevent duplicate commentary during long tool runs.)
  • Persisted assistant delivery facts keeps the original intent (32f056f: Persist parsed delivery facts at the assistant write boundary so runtime and stored messages stay consistent without reparsing history.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 6349e43 adds src/agents/embedded-agent-runner/run/payloads.ts:376 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6349e43d84b5; files: src/agents/embedded-agent-runner/run/payloads.ts)

PR surface

Source +104, Tests +243, Other +2. Total +349 across 20 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 14 125 21 +104
Tests 5 244 1 +243
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 20 371 22 +349

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test growth Production +104 net lines; behavioral tests +241 net lines The growth carries one consumed-input fact across existing event, buffering and persistence boundaries, with regressions for source identity, threading and legacy transcript compatibility.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #178120
Summary: This PR is the candidate fix for the same consumed-input reply-target failure; the linked issue was closed for inactivity, not because the defect was fixed.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on maintainer: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Same-run Telegram steering can attach an otherwise delivered answer to the wrong input, with a bounded trigger and no demonstrated outage.
  • 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.

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 execution lanes are retired.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-20T06:16:39.868Z sha dfeff13 :: needs real behavior proof before merge. :: [P2] Preserve implicit source identity through final reply threading
  • reviewed 2026-10-20T09:32:47.831Z sha a42bef5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T11:04:33.606Z sha 26fe603 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T21:24:35.416Z sha 09517e7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T23:01:49.843Z sha 09517e7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-13T15:33:08.006Z sha 3662dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-13T16:07:51.891Z sha 148aa18 :: blocked before merge. :: none

Reviewed November 13, 2026, 12:03 PM ET / 17:03 UTC (Revision 8).

@ChuLaiTheGreat
ChuLaiTheGreat marked this pull request as ready for review October 20, 2026 07:13
@ChuLaiTheGreat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the implicit-source recovery finding in a42bef5. The producer copies metadata and marks its source as implicit; shared threading preserves that fact, while explicit reply directives still win. Also fixed the reported lint errors.

Red/green proof: the two new recovery eligibility regressions fail on the prior implementation, then pass with the fix. Native green proof totals 80 tests, including the existing consumers, legacy transcript JSON and an actual SQLite persist/read-worker reload/pending-final retry action. Production core types, focused format/non-type-aware lint and fresh independent review pass. Commands and proof limits are in the updated PR body.

The real Gateway/model/Telegram Test Server run still needs team broker access: the readiness doctor found no authenticated Convex launcher. No live channel proof or full Gateway restart is claimed. Could the team run that remaining check using its broker-backed fixture? The canonical shared autoreview tool is also unavailable here; broader CI is running on this new head. PR remains ready for review.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@ChuLaiTheGreat

ChuLaiTheGreat commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Revision 3 evidence is ready at 26fe603; the updated body records the exact commands, outcomes and remaining limits.

The 3 subscriber cases now persist the actually captured assistant messages through SessionManager SQLite and reload sources 101/102 with the native worker plus latest-assistant projection. They pass in the canonical database-owner lane. The introduced payload import formatting is fixed; the focused total remains 80 distinct cases.

Latest-stable data compatibility also has a separate actual Gateway result: published 2026.10.5 created/reloaded synthetic history; supported doctor recovery completed; the documented build:runtime profile completed on clean exact 26fe with matching native stamps/build ID. Its compiled Gateway reads the old message, injects one new message, preserves both once/in order after restart, and stops cleanly twice. Native read-only probes confirm state 20→29 / agent 25→31, integrity OK and no foreign-key violations. This is doctor-assisted compiled-runtime history proof, not the packaged updater or a model/Telegram source-field turn.

The previous CI production-type failure is reproduced on its base alone with all 809 matching direct diagnostics. The latest CI's remaining UI assertion 367 is now reproduced on exact CI base 8ebf027 alone (same New session title). Its private synthetic frame record has 20/20 cached titles correct and one incorrect title among 37 post-connect frames. The exact tested merge 6270813a passes the same selected case once; all 6,293 ui/ source files are byte-identical. The full CI is still failed; no unrelated UI patch, ignore or blind rerun is claimed.

Failed preparation is retained: the full-package declaration compiler was OOM-killed, so the official packaged sqlite-volume update has no passing verdict. Early direct-TypeScript fixture failures are also disclosed rather than counted as compatibility success.

The remaining combined Gateway/model/Telegram Test Server proof still needs the team's authenticated Convex broker. Could maintainers run the broker-backed fixture or provide access privately? No lease, model call or live Telegram send was attempted. Shared autoreview is unavailable here. The PR remains open, non-draft and ready for review; no deployment or merge is claimed.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 20, 2026
ChuLaiTheGreat and others added 5 commits October 26, 2026 07:04
…ication

Integrate main without restoring retired restart reconstruction. Preserve
consumed-input capture and transcript/threading regressions; expose the
optional callback in the upstream projection fixture and allocate exactly
241 justified regression-test lines under the existing record policy.
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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 Nov 13, 2026
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed 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 Nov 13, 2026
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 13, 2026
@obviyus
obviyus merged commit 466a4b6 into openclaw:main Nov 13, 2026
119 of 125 checks passed
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
* fix(telegram): keep steered answers on their consumed inputs

* fix(agents): capture reply sources before native persistence

* fix: preserve implicit reply sources through recovery

* test: persist consumed reply sources through native SQLite

* fix(agents): import reply source context from its canonical type owner

* fix(agents): import reply source test context from canonical owner

* test(ci): route Home reader proof through real Gateway lane

---------

Co-authored-by: obviyus <[email protected]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
)

* fix(plugins): portable plugin-state keys for PostgreSQL

Use an exclusive SQL lower bound for Doctor pagination instead of a NUL-suffixed cursor. Reject new NUL keys in test-only plugin-state fixtures while retaining legacy SQLite adoption reads.

Add real PostgreSQL Doctor regression coverage and register it in conformance and database-worker lanes. Refs openclaw#184862 openclaw#188642.

* test: account for rebased plugin-state coverage

* test(clickclack): import legacy revocations before adoption

(cherry picked from commit 395cac7)

Release adaptation: Only exclusive SQL lower bound in kernel and Doctor pagination; preserve legacy SQLite keys and public validation. Regression exercises real Doctor paging and inspected executed SQL bindings; no NUL-key fixture policy, schema or unrelated tests.

Follow-up dispositions: 8253356 fix: preserve child results after source lifecycle changes (openclaw#202708); f3f89c7 fix: show saved child results when completion delivery fails (openclaw#202664); c45faa8 fix: align CI tests with admitted tool calls (openclaw#202655); 5c9389a fix: make channels add report required plugin install failures (openclaw#202091); 52b9188 fix: show hosted model details in `models list` without a Gateway (openclaw#202490); d248a76 fix: show an outcome when kept child chats return no answer (openclaw#202423); 5148804 fix(discord): check a queued message's access again when its turn starts (openclaw#202330); 2470d62 fix: let setup use account models with a fresh catalog (openclaw#202019); 9fa0b92 fix: let PostgreSQL Gateways start with plugin-backed secrets (openclaw#201063); c180824 fix(plugins): Talk and plugin-loading requests fail on PostgreSQL Gateways (openclaw#201976); cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 17c5fb0 fix(state): PostgreSQL state created before Template bootstrap deferral is refused as schema drift (openclaw#197425); b5c1277 fix: let resumed parents collect children stopped by restart (openclaw#201460); f920a7e chore(postgres): qualify cron completion during graceful shutdown (openclaw#201246); 1680f54 fix(openai): new ChatGPT subscription models missing until an OpenClaw release (openclaw#201130); 0d8820a fix(media): image descriptions use the ChatGPT OAuth route when OpenAI has no API key (openclaw#199299); ee3e16e test(agents): trim and fold low-value regression suites (openclaw#198916); b8029b4 test(agents): qualify PostgreSQL simple-completion acquisition (openclaw#200956); 703c82d fix(sessions): record queued input end causes and recover them across crashes (openclaw#200533); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); d565e17 fix(ci): retire deleted session fork test from inventory (openclaw#200611); 4cf12c6 chore(postgres): qualify prompt refresh and rebalance CI (openclaw#200488); d460273 fix(templates): release earlier Template-managed agents (openclaw#200303); ff75829 fix(update): --no-restart update fails when the Gateway restarts itself during Doctor's stop (openclaw#200181); 0b2ad60 chore(postgres): cover compaction watched-session prompts (openclaw#200117); b90c573 test: consolidate redundant coverage (198795 recut) (openclaw#198943); a042363 test: consolidate redundant coverage (198793, part 2) (openclaw#198936); 9bfad2b test: consolidate suites while retaining recovery owners (openclaw#198933); 4e9812c test: consolidate redundant coverage (198789, part 2) (openclaw#198932); 90814f5 fix(subagents): stops a finished sub-agent's chat being deleted before its parent reads the result; 799bc0b fix(ci): stabilize hourly fixtures and retire unused exports (openclaw#199851); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); a4cc2ad fix: undo cold-session compaction CPU and latency regressions (openclaw#199561); 55fec79 fix(agents): stop divergent mid-turn overflow recovery (openclaw#199636); 2c4413a fix: reduce Gateway stalls under filesystem pressure (openclaw#197510); 37d977f fix: output reducers are skipped in headless and Code Mode runs (openclaw#199434); c9ee264 fix(compaction): concurrent sessions wait for each other's summaries during compaction (openclaw#196550); 2471ddc feat: let agents review generated images before delivery (openclaw#198227); 21f7dc6 fix(github): publication fails with PostgreSQL session or state stores (openclaw#193749); 63d9e57 fix(ci): new PostgreSQL suites are omitted from conformance (openclaw#198390); 466a4b6 fix(telegram): steered answers quote the wrong input (openclaw#178124); 87b6f52 fix(delivery): resend routed Telegram finals after an ambiguous network failure (openclaw#192779); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); cff99b2 fix(agents): keep provider history append-only across runs (openclaw#197874); 8a328bf feat: add an opt-in usage-ranked tool index (openclaw#197128); 097e648 fix(ci): plan only executable infra tests (openclaw#197911); 76385fd fix(models): discovered models become "Unknown model" after restart or an ended sign-in (openclaw#197784); 89d4177 fix(plugin-state): guarded calls fail until Gateway restart after an unknown write outcome (openclaw#197790); baca36e fix(sessions): commit selected invitations with original messages (openclaw#184512); 699e538 fix(sessions): drain passive notices on sessions_send resumes; d6ded18 chore(ci): drop retired test-lines allocation records (2/3) (openclaw#197656); e0dd020 fix(agents): collect process results at suspended-run capacity; 4897740 feat(auth): preserve delegated OCE user profiles and permissions (openclaw#196856); 7197ce1 feat(templates): install bundled plugins through native management (openclaw#196349); 9c6ee9b feat: let Template automations start paused for onboarding (openclaw#196323); 79a6214 fix(message): retain local final replies in conversation history (openclaw#187795); caa978c feat(templates): open durable chat before verified setup (openclaw#196392); 78e73aa fix(sessions): cold PostgreSQL conversations fail after idle readers close (openclaw#189991); b6ed907 perf(sessions): persist active transcript facts for hydration (openclaw#193682); 1595dd2 feat(plugins): reauthorize accepted session work (openclaw#176886); b43ad0a fix(models): avoid reloading plugins on catalog refresh (openclaw#193903); 0947d02 fix(ci): avoid unrelated PostgreSQL runs and admit owned tests (openclaw#193870); 428ca7d feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag (openclaw#192335); c718583 fix(update): repair refuses forever after a verified update fails a later step (openclaw#193132); 3f64174 fix: deliver background replies after a reload retires the turn registry (openclaw#193130); 982f3b1 fix(imessage): report Automation failures after Gateway updates (openclaw#186117); 31b28e9 fix(agents): wait for a peer OAuth refresh before failing request auth (openclaw#192906); cf50d4a feat(storage): support read-only PostgreSQL standby inspection (openclaw#192645); 82fd4e6 fix(agents): retain stale session target refusal reasons (openclaw#192681); 8ac4e19 fix(worktrees): reserve capacity on PostgreSQL (openclaw#192537); 718b349 fix: reduce session startup stalls under storage contention; 08f4a19 refactor(skills): move Skill Workshop into its bundled plugin (openclaw#192471); 837402a fix(clawrouter): keep upstream credit failures off the shared key (openclaw#192575); f38495f fix(plugins): reject late routing from canceled runs (openclaw#192492); dc5d61a improve(sessions): reduce unnecessary maintenance query rows (openclaw#192023); c4bf0dc fix(sessions): avoid extra maintenance scans for embedded archives (openclaw#184507); e44b3d6 fix(team-reports): recover after database connection loss (openclaw#192020); 991fb33 fix(logbook): recover after database connection loss (openclaw#192011); e6d0d2e fix(test): include omitted PostgreSQL conformance suites (openclaw#191962); da5ff0f fix(codex): reject native hooks from a previous run (openclaw#191788); 09f0b0b feat(plugins): add skill usage runtime for plugins (openclaw#191661); 00b2ff4 fix: parent sessions miss child approvals with a custom session store (openclaw#189827); be44b10 fix: stop completed session writes retaining request data (openclaw#191197); d40aa7c fix(sessions): replay creation requests across Gateway restarts (openclaw#190862); d894035 fix: await Doctor shared-state repair preparation (openclaw#190875); b515cc7 feat: fork threaded conversations with Telegram support (openclaw#190783); def6349 feat(plugins): plugins can run a hidden forked turn of a session with their own tools (openclaw#190950); d983e34 feat(plugins): plugin commands can continue the agent with a replacement prompt, on every channel (openclaw#190908); ea3f0b8 fix(ci): provision Node test prerequisites and retain Baseten routing (openclaw#191050); 29503e1 fix(update): Gateway stays stopped after the updater process dies mid-update (openclaw#188497); fc8c2d0 fix(update): preserve unfinished handoff artifacts (openclaw#190571); 7c26e8c fix(ci): cover PostgreSQL managed update handoffs (openclaw#190336); 4913d41 fix(ci): prevent truncated PostgreSQL target listings (openclaw#189509); 8925f62 fix(gateway): start restored PostgreSQL homes on the first attempt (openclaw#190291); 177fe32 feat(models): preserve inference capabilities in opt-in catalog v3 (openclaw#189678); 7faf32d feat: retain repository disk authority through recovery (openclaw#189106); a658df3 feat(database): capture externally quiesced SQLite migrations; 0f9e7f7 feat(database): capture exact SQLite migration capsules; 4fb684e feat(backup): add PostgreSQL local companion checkpoints; c89a101 fix(doctor): migrate auth profiles on PostgreSQL stores (openclaw#189639); 799de09 fix(ci): split oversized workspace and setup files (openclaw#189356); 21ee847 fix(acp): keep completed run conversations resumable (openclaw#189273); fce0e56 perf(sessions): open cold history without restoring archives (schema 39) (openclaw#188397)

Validation: Baseline1 NUL-binding assertion failure/21passing; candidate22/22passes (188693-green.log). Real SQLite Doctor path and generated SQL proved; no native PostgreSQL server execution claimed.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 0895146d8c1493146f5c6461eee0b10c329bdd1e)
(cherry picked from commit f8ccaa70bc9773d6bbb569bc0e275eee0c544ead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

Telegram answers to steered inputs can quote the wrong source message

2 participants