Skip to content

github-copilot/gpt-5.5 still persists/replays thinkingSignature encrypted_content after #84367/#90682/#92941, causing channel/direct LLM request failed #95441

Description

@fanyangCS

Agent-generated report: This issue was generated and filed by Fan's OpenClaw assistant from local runtime evidence on the user's behalf. Concrete user/channel/session identifiers and secrets were intentionally redacted.

Summary

On OpenClaw 2026.6.8 (844f405), channel/direct sessions using github-copilot/gpt-5.5 can still fail with 400 invalid_encrypted_content even though the installed build includes the merged replay fixes #84367, #90682, #92941, and #71448.

The affected session JSONL files still persist assistant blocks containing thinkingSignature, textSignature, and nested encrypted_content / encryptedContent. Later turns in the same channel/direct session can replay stale encrypted reasoning/signature material and the provider rejects the request before model output.

User-visible symptom: channel ingress is healthy, but the turn ends as LLM request failed / no deliverable assistant reply.

Severity / recurrence risk

This appears to be a high-severity, structurally recurring reliability bug, not a one-off corrupted local transcript. The current runtime can continue to persist provider-private Responses reasoning/signature material in long-lived channel/direct sessions. As those sessions age, the stored encrypted/signature payloads can become unverifiable for the current provider/auth/model/session context and then poison every later replay of the same session.

Why this is likely to recur without a code-level fix:

  • The affected fields are still present in active session histories after the merged fixes listed below.
  • Long-lived Discord/Telegram/Feishu conversations reuse the same session history for many turns, so stale replay material accumulates naturally.
  • The failure happens before model output, producing user-visible LLM request failed / missing replies rather than a recoverable assistant response.
  • Manual transcript cleanup can temporarily restore a session, but if new turns persist new thinkingSignature / textSignature / encrypted_content material, the same class of failure can reappear later.
  • Gateway restart does not fix the root cause; it may simply reload and replay the persisted poisoned history again.

Suggested impact classification: P1 / user-facing reliability, with impact:message-loss and impact:session-state style consequences. This does not look like a security issue from the available evidence, but it can brick important long-running user/channel sessions until manual repair or a sanitized replay path is applied.

Environment

  • OpenClaw: 2026.6.8 (844f405)
  • Node: v22.22.2
  • OS: Linux x64
  • Provider/model: github-copilot/gpt-5.5
  • Surfaces observed:
    • Discord direct
    • Telegram direct
    • Feishu direct
    • Some Discord channel/thread sessions

Evidence that the installed build includes prior fixes

Local installed OpenClaw:

OpenClaw 2026.6.8 (844f405)

GitHub compare checks showed local commit 844f405 is after these merged PRs:

Installed dist contains the expected fix-related code paths, including:

  • isInvalidEncryptedContentError
  • stripResponsesRequestEncryptedContent
  • retry path log text: retrying without encrypted reasoning content
  • replay provenance metadata helpers
  • include: ["reasoning.encrypted_content"]
  • transcript policy hook for dropReasoningFromHistory

Relevant excerpt from installed dist (sanitized):

function isInvalidEncryptedContentError(error) {
  if (record.code === "invalid_encrypted_content" || record.code === "thinking_signature_invalid") return true;
  return typeof record.message === "string" &&
    (record.message.includes("invalid_encrypted_content") || record.message.includes("thinking_signature_invalid"));
}

async function createResponsesStreamWithEncryptedContentRetry(params) {
  try {
    return await params.client.responses.create(params.request, params.requestOptions);
  } catch (error) {
    const retryRequest = stripResponsesRequestEncryptedContent(params.request);
    if (!isInvalidEncryptedContentError(error) || retryRequest === params.request) throw error;
    log.warn(`[responses] retrying without encrypted reasoning content provider=${params.model.provider} api=${params.model.api} model=${params.model.id}`);
    return await params.client.responses.create(retryRequest, params.requestOptions);
  }
}

Evidence from affected session files

Affected .jsonl session files still contain persisted replay-only fields:

thinkingSignature
textSignature
encrypted_content
encryptedContent

Observed counts in active session files included non-zero occurrences of those fields after the merged fixes were present. The exact session IDs and channel/user IDs are omitted here because they are private.

The raw provider error pattern is:

OpenAI API error (400): 400 The encrypted content ... could not be verified.
Reason: Encrypted content could not be decrypted or parsed.
code=invalid_encrypted_content

One failed assistant turn stored only:

{"type":"text","text":"[assistant turn failed before producing content]"}

with stopReason: "error" and an errorMessage containing the invalid_encrypted_content rejection.

Expected behavior

OpenClaw should not persist or replay stale provider-private encrypted reasoning/signature material in channel/direct session history, or should always recover by retrying with sanitized history before surfacing LLM request failed.

In particular, channel/direct embedded runtime paths should be covered, not just native/OpenAI Responses paths.

Actual behavior

A later turn in the same channel/direct session fails before model output with a user-visible LLM request failed, even though the channel provider and gateway ingress are healthy.

Manual mitigation by removing stale thinkingSignature / textSignature / encrypted_content fields from the local session transcript can restore the session, but new turns may persist new signature/encrypted fields again.

Suspected gap

The existing fixes appear to cover some Responses/Codex replay paths, but not all of:

  • github-copilot/gpt-5.5
  • OpenClaw main agent embedded runtime
  • Discord/Telegram/Feishu direct/channel sessions
  • persisted .jsonl history containing thinkingSignature / textSignature

Possible robust fixes:

  1. Strip thinkingSignature / textSignature / encrypted_content at persistence time for Responses-family provider-private blocks, or mark them private/non-replayable.
  2. Strip these fields at prompt/replay construction for all channel/direct embedded runtime paths.
  3. On invalid_encrypted_content, retry with all reasoning/signature blocks removed, not just nested encrypted_content.
  4. Add a session-repair migration or lazy repair for existing polluted .jsonl files.
  5. Add regression tests for github-copilot/gpt-5.5 channel/direct session replay, not only native openai-chatgpt-responses paths.

Related issues / PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions