Skip to content

GPT-5.5 reasoning item schema error causes duplicate Discord messages via retry cascade #84484

Description

@alokit-bot

GPT-5.5 reasoning item schema error causes duplicate Discord messages via retry cascade

OpenClaw version

2026.5.18 (50a2481)

Environment

  • OS: Ubuntu 22.04 (Azure VM)
  • Node: v22.22.1
  • Channel: Discord
  • Default model: openai/gpt-5.5 (with fallback chain)

Description

When GPT-5.5 is the default model and a user sends a message on a Discord channel, OpenClaw often sends multiple near-identical responses (3-5 duplicates) to that channel. The root cause is a retry cascade triggered by an OpenAI API schema error, combined with the retry path not deduplicating by inbound Discord message_id.

Error chain

  1. User sends a Discord message
  2. OpenClaw processes it with GPT-5.5 → succeeds → sends response to Discord ✅
  3. On retry/reprocessing, the OpenAI API rejects the request with:
    400 Item 'msg_...' of type 'message' was provided without its required 'reasoning' item: 'rs_...'
    
    GPT-5.5 produces reasoning tokens, but they aren't properly preserved in session history for replay.
  4. This triggers EmbeddedAttemptSessionTakeoverError (multiple retries racing on the same session file)
  5. Some retries succeed → duplicate Discord messages sent
  6. Failed retries cascade through the fallback chain, which also fails:
    • o3: "Your organization must be verified to generate reasoning summaries"
    • o3-deep-research: "Deep research models require at least one of 'web_search_preview', 'mcp', or 'file_search' tools"
    • gpt-5.3-chat-latest: "Unsupported value: 'low' is not supported... Supported values are: 'medium'"

Impact on a single day (May 20, 2026)

  • 92 EmbeddedAttemptSessionTakeoverErrors
  • 81 FailoverErrors
  • 80 session takeover errors on one channel alone (#byok-relay-project)
  • User received 3-5 near-identical replies to each message

Log evidence

lane task error: lane=session:agent:main:discord:channel:1499540372618084512 durationMs=29918
error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released"
{
  "event": "embedded_run_failover_decision",
  "provider": "openai",
  "model": "gpt-5.5",
  "rawErrorPreview": "400 Item 'msg_04aba82edd478513006a0c2071cc24819bb493a308058de9d6' of type 'message' was provided without its required 'reasoning' item: 'rs_04aba82edd478513006a0c206cb3b4819baea439c0527527c0'.",
  "providerRuntimeFailureKind": "schema"
}

Expected behavior

  1. Reasoning items should be preserved in session history so replaying conversations with GPT-5.5 doesn't trigger schema errors
  2. Retries should deduplicate by inbound message_id — if a Discord message has already been successfully responded to, retries should not produce additional responses
  3. Fallback chain should not attempt models that require org verification or specific tools that aren't configured

Workaround

Changed default model to anthropic/claude-sonnet-4-6. GPT-5.5 moved to fallback list. No duplicate messages since the switch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions