-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bedrock Mantle (openai-responses) cumulatively duplicates reply text with reasoning enabled (GPT-5.x) #91959
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
When using a Bedrock Mantle model through the
openai-responsesAPI with reasoning/thinking enabled, the assistant's reply text is cumulatively duplicated: the final visible text contains the same answer repeated many times, each repetition a progressively longer prefix-superset of the previous one. Short replies are usually fine; the bug shows up on longer / structured answers and is dramatically amplified by reasoning.This appears to live in the core OpenAI-Responses stream consumer, not in a specific provider plugin (reproduced with two different models routed through the same
openai-responsespath).Environment
2026.6.5amazon-bedrock-mantle(@openclaw/[email protected])openai-responsesopenai.gpt-5.5,openai.gpt-5.4(both via Mantle)Reproduction
Run one agent turn that elicits a longer, structured answer, with reasoning on:
Then inspect
meta.finalAssistantVisibleText: measure its length and count how many times the first ~60 characters of the answer occur.Observed results (same prompt unless noted)
replayInvalid=false--thinking off)replayInvalid=trueThe duplicated segments are clearly cumulative: e.g. snapshot 1 ends mid-sentence, snapshot 2 repeats from the start and ends slightly later, etc. — i.e. each is a prefix-superset of the prior, consistent with multiple
response.output_item.done(typemessage) events each carrying a from-the-start snapshot being concatenated downstream rather than de-duplicated to the final item.Reasoning-off is not a complete workaround
Setting the model entry to
reasoning: false(or passing explicit--thinking off) greatly reduces the problem, but does not fully eliminate it:So the frequency/severity scales with answer length and structure; reasoning amplifies it but is not the sole trigger.
Notable
thinkingDefault: "off"is not sufficient when the model entry hasreasoning: true— the run still duplicated (observed 5×). Only the model entryreasoning: false, or an explicit--thinking off, reliably suppressed reasoning.openai-responsesstream-consumption path rather than the model or the Mantle plugin.Expected behavior
The final assistant text should contain the answer exactly once. The Responses stream consumer should treat successive
response.output_item.done(typemessage) events as cumulative snapshots of the same item (replace/last-wins) rather than concatenating them.