openclaw - ✅(Solved) Fix [Bug]: [5.3 regression] lossless-claw: duplicate answers + "missing tool result in session history" synthetic errors [3 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77642Fetched 2026-05-06 06:23:35
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
4
Author
Timeline (top)
cross-referenced ×3labeled ×2commented ×1

Error Message

Relevant gateway log excerpt:

Fix Action

Fix / Workaround

  • Before upgrading to 5.2, this issue did not occur

  • FreshTailCount tuning (32→64) was tried as a mitigation but did not fully resolve the issue

  • The issue appears related to how lossless-claw interacts with OpenClaw 5.2/5.3's session transcript handling

  • Before upgrading to 5.2, this issue did not occur

  • FreshTailCount tuning (32→64) was tried as a mitigation but did not fully resolve the issue

  • The issue appears related to how lossless-claw interacts with OpenClaw 5.2/5.3's session transcript handling

PR fix notes

PR #78142: fix: reset websocket lineage after final answers

Description (problem / solution / changelog)

Summary

  • Prevent OpenAI WebSocket incremental lineage reuse when the previous response ended with a final_answer and the next suffix starts with a new user message.
  • Preserve incremental WebSocket sends for normal tool-result continuations and strict unphased response-chain suffixes.
  • Add a planner regression covering the stale-final-answer replay shape from #78055.

Why

#78055 shows a fresh second final answer replaying an already-completed task after a newer user request and unrelated tool calls. That points at stale previous_response_id lineage being reused across completed final-answer boundaries. This surgical guard forces a full-context send for the first request after a phased final answer, then allows incremental behavior to resume inside the new turn.

Related

  • Ties to #78055
  • Related context: #76905, #76888, #77642, #78060, #76990, #77445

Tests

  • git diff --check
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/agents/openai-ws-stream.test.ts --maxWorkers=1 ⚠️ blocked: new worktree had no node_modules / vitest
  • With temporary node_modules symlink from sibling checkout: node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openai-ws-stream.test.ts --maxWorkers=1 ⚠️ blocked by host disk full (ENOSPC: no space left on device, write; root volume had ~120MiB available)
  • Commit used --no-verify because the local hook tried to run missing oxfmt in this worktree.

Changed files

  • src/agents/openai-ws-request.ts (modified, +40/-8)
  • src/agents/openai-ws-stream.test.ts (modified, +33/-0)

PR #78146: fix: trace OpenAI WebSocket response lineage

Description (problem / solution / changelog)

Summary

  • Add redacted debug lineage to OpenAI WebSocket request planning: mode, previous_response_id, baseline/full/suffix lengths, and suffix item summaries without prompt/tool-result text.
  • Log per-request lineage before send, including context tail role/message id/parent id and latest user id when those ids are present.
  • Log completion lineage when a response.completed is accepted into the transcript, tying the generated request id to the accepted response id and replay item count.

Why

This provides safe trajectory evidence for duplicate/stale final-answer replay investigations where the failure appears to involve the OpenAI-Codex WebSocket incremental / previous_response_id path.

References/ties: openclaw/openclaw#78055, openclaw/openclaw#76905, openclaw/openclaw#76888, openclaw/openclaw#77642, openclaw/openclaw#78060, openclaw/openclaw#76990, openclaw/openclaw#77445, openclaw/openclaw#67777, openclaw/openclaw#39032.

Tests

  • node scripts/test-projects.mjs src/agents/openai-ws-stream.test.ts
  • pnpm exec oxfmt --check src/agents/openai-ws-request.ts src/agents/openai-ws-stream.ts src/agents/openai-ws-stream.test.ts
  • git diff --check

Notes

  • pnpm tsgo:test:src was attempted, but the process was SIGKILLed in this local worktree before emitting diagnostics.

Changed files

  • src/agents/openai-ws-request.ts (modified, +106/-2)
  • src/agents/openai-ws-stream.test.ts (modified, +77/-0)
  • src/agents/openai-ws-stream.ts (modified, +97/-0)

PR #78147: test: guard websocket stale final turn lineage

Description (problem / solution / changelog)

Summary

  • add a regression/protective test for the #78055 stale-final replay shape: final answer A completes, user asks B, WS sends an incremental B suffix, then a stale response.completed carrying turn A metadata arrives before the real turn B completion
  • add lineage validation for OpenAI WS terminal events when native OpenAI turn metadata is echoed, ignoring stale response.completed / response.failed events instead of finalizing the active turn
  • type ResponseObject.metadata so tests and runtime can inspect echoed Responses metadata

Why

This ties directly to #78055 and the duplicate/stale final-answer after tool-chain report. It also overlaps the incremental / previous_response_id surfaces discussed around #76905, #76888, #77642, #78060, and the broader runtime/finalization issues in #76990 / #77445.

Verification

  • ./node_modules/.bin/tsc --noEmit --pretty false --project tsconfig.core.projects.json
  • vitest run src/agents/openai-ws-stream.test.ts -t "stale completed" --maxWorkers=1 --no-fileParallelism --reporter=dot started, the targeted test emitted a passing dot, but the local process was SIGKILLed afterward on this Mac with /System/Volumes/Data at 100% / ~121MiB free. Treat full test run as not completed locally.

Fixes #78055. Refs #76905, #76888, #77642, #78060, #76990, #77445.

Changed files

  • src/agents/openai-ws-connection.ts (modified, +1/-0)
  • src/agents/openai-ws-stream.test.ts (modified, +85/-0)
  • src/agents/openai-ws-stream.ts (modified, +37/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Bug Description

After upgrading to OpenClaw 5.2 (persists in 5.3.1), there are two related issues:

Issue 1: Duplicate answers

When the user asks a follow-up question, my answer to the new question also contains a repeat of the previous answer. For example:

  • User asks: "What's the weather today?"
  • I answer: "It's sunny today, 25°C."
  • User asks: "And tomorrow?"
  • I answer: "It's sunny today, 25°C. Tomorrow it will be cloudy, 23°C."

The previous answer is repeated within the current answer, as part of the same message.

Issue 2: "missing tool result in session history" synthetic error

Every command executed in the session produces this error in the gateway logs:

Steps to reproduce

The LCM falls back to live context instead of using compacted summaries on every turn.

Impact

  1. Answers are noisy and repetitive due to the duplicate content
  2. Session transcript is polluted with synthetic error records on every tool use

Expected Behavior

  • Each answer should only contain the answer to the current question, not repeat previous answers
  • No synthetic error records should be inserted into the transcript

Notes

  • Before upgrading to 5.2, this issue did not occur
  • FreshTailCount tuning (32→64) was tried as a mitigation but did not fully resolve the issue
  • The issue appears related to how lossless-claw interacts with OpenClaw 5.2/5.3's session transcript handling

Expected behavior

The LCM falls back to live context instead of using compacted summaries on every turn.

Impact

  1. Answers are noisy and repetitive due to the duplicate content
  2. Session transcript is polluted with synthetic error records on every tool use

Expected Behavior

  • Each answer should only contain the answer to the current question, not repeat previous answers
  • No synthetic error records should be inserted into the transcript

Notes

  • Before upgrading to 5.2, this issue did not occur
  • FreshTailCount tuning (32→64) was tried as a mitigation but did not fully resolve the issue
  • The issue appears related to how lossless-claw interacts with OpenClaw 5.2/5.3's session transcript handling

Actual behavior

Environment

  • OpenClaw version: 5.3.1 (upgraded from 5.2)
  • Plugin: lossless-claw (enabled)
  • Channel: Telegram
  • Model: minimax-cn/MiniMax-M2.7-highspeed

Logs

Relevant gateway log excerpt:

OpenClaw version

2026.5.3-1

Operating system

macos15.4

Install method

No response

Model

minimax 2.7-highspeed

Provider / routing chain

minimax- telegram

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by adjusting the interaction between lossless-claw and OpenClaw's session transcript handling, potentially through configuration changes or updates to the lossless-claw plugin.

Guidance

  • Investigate the lossless-claw plugin configuration to see if there are settings that control how previous answers are handled or if there's an option to prevent the repetition of previous answers.
  • Review the OpenClaw 5.2 and 5.3.1 release notes for any changes related to session transcript handling that might be causing the fallback to live context instead of using compacted summaries.
  • Consider reaching out to the developers or community of lossless-claw for guidance on how to properly integrate it with OpenClaw 5.2/5.3, given the observed issues.
  • If possible, test the system with a different plugin or configuration to isolate if the issue is specifically with the lossless-claw plugin or a broader OpenClaw issue.

Notes

The provided information suggests a compatibility issue between the lossless-claw plugin and OpenClaw versions 5.2 and 5.3.1, but without more specific details on the plugin's configuration options or the exact changes in OpenClaw's session handling, it's challenging to provide a precise fix.

Recommendation

Apply workaround: Given the potential for this being a compatibility issue, applying a workaround such as adjusting the plugin configuration or temporarily using a different plugin might be the most straightforward path to resolving the issue until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The LCM falls back to live context instead of using compacted summaries on every turn.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: [5.3 regression] lossless-claw: duplicate answers + "missing tool result in session history" synthetic errors [3 pull requests, 1 comments, 2 participants]