Skip to content

[Bug]: Copilot Responses replays connection-bound encrypted reasoning #42

Open

Description

@ooiuuii

Summary

GitHub Copilot's OpenAI-compatible Responses endpoint rotates its backend connection token between requests, but Hermes replays encrypted_content reasoning items from prior Copilot turns. Those ciphertext blobs are connection-bound, so a later turn can be rejected even though Hermes already strips Copilot's connection-bound message item IDs.

Environment

  • Hermes Agent main at a7a696ba5
  • Provider: copilot
  • API mode: codex_responses
  • Reproduced through the final ResponsesApiTransport.preflight_kwargs() boundary

Reproduction

from agent.transports.codex import ResponsesApiTransport

transport = ResponsesApiTransport()
messages = [{
    role: assistant,
    content: done,
    codex_reasoning_items: [{
        type: reasoning,
        id: rs_1,
        encrypted_content: copilot-connection-bound-ciphertext,
        _issuer_kind: github_responses,
        summary: [{type: summary_text, text: summary}],
    }],
}]
kwargs = transport.build_kwargs(model=gpt-5.5, messages=messages, tools=[], is_github_responses=True)
preflight = transport.preflight_kwargs(kwargs, is_github_responses=True)
print(preflight[input])

Observed final input:

[{'type': 'reasoning', 'encrypted_content': 'copilot-connection-bound-ciphertext',
  'summary': [{'type': 'summary_text', 'text': 'summary'}]},
 {'role': 'assistant', 'content': 'done'}]

Expected behavior

The Copilot provider boundary should never send prior-turn encrypted_content. The visible assistant message should remain replayable, while connection-bound reasoning ciphertext is omitted before the request.

Root cause

_chat_messages_to_responses_input() removes IDs from Copilot message items but applies no equivalent Copilot guard to codex_reasoning_items. _preflight_codex_input_items() also preserves encrypted reasoning regardless of is_github_responses, so request overrides can reintroduce the same payload after conversion.

Proposed fix

  • Omit encrypted reasoning replay while converting GitHub/Copilot Responses history.
  • Enforce the same rule again in the final preflight boundary so request overrides cannot bypass it.
  • Keep non-Copilot Responses replay unchanged.

Duplicate search

Searched open and closed Hermes issues/PRs for copilot encrypted_content, invalid_encrypted_content copilot, connection-bound encrypted reasoning, and GitHub Responses reasoning replay. No matching report or patch was found.

Activity

  1. GottZ commented on Jul 27, 2026

    @GottZ

    This was generated by AI during triage.

    Summary

    One PR addresses #42. NousResearch/hermes-agent#70486 removes Copilot connection-bound encrypted reasoning both during history conversion and at final preflight, while preserving visible assistant content and non-GitHub reasoning replay.

    Related pull requests

    • fix(copilot): drop connection-bound reasoning replay hermes-agent#70486 best fix — (+92/-10) — fixes: The diff directly addresses both reported ingress paths by skipping cached reasoning for GitHub Responses and dropping reasoning reintroduced through request overrides at preflight; regression tests cover both guards and confirm non-GitHub replay remains unchanged.

    Suggested consolidation

    Merge NousResearch/hermes-agent#70486 — it is the only PR in the complex and directly fixes the reported root cause at both the conversion and final preflight boundaries, with focused regression coverage; there are no duplicate PRs to close.

    Complex graph

    flowchart LR
        classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
        classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
        classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
        classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
        classDef best stroke-width:3px,stroke:#b45309
        classDef target stroke-width:3px,stroke:#4338ca
        I70481(["issue NousResearch/hermes-labs-plugins#42 (open)"])
        P70486["PR NousResearch/hermes-agent#70486 (open)"]
        P70486 -->|best fix| I70481
        class I70481 open
        class I70481 target
        class P70486 open
        class P70486 best
        click I70481 "https://github.com/NousResearch/hermes-labs-plugins/issues/42"
        click P70486 "https://github.com/NousResearch/hermes-agent/pull/70486"
    
    Loading

    Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).

    Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 7 kB of PR diffs, 5 kB of issue/PR text, 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  2. GottZ commented on Jul 30, 2026

    @GottZ

    This was generated by AI during triage.

    Delta since our previous triage comment

    Since the previous comment, @teknium1’s keep_open review independently confirmed that current main still replays same-issuer GitHub encrypted reasoning during conversion and preserves it at preflight. The review also confirms that NousResearch/hermes-agent#70486 addresses both boundaries without a blocking correctness or design-fit concern, strengthening the existing assessment rather than changing it.

    Changed pull requests

    Suggested consolidation

    The recommendation remains unchanged: merge NousResearch/hermes-agent#70486; there are still no duplicate PRs to close.

    Complex graph unchanged since our previous triage comment.

    Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 7 kB of PR diffs, 5 kB of issue/PR text, <1 kB of discussion (1 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  3. teknium1 commented on Oct 26, 2026

    @teknium1
    Contributor

    Moving this to NousResearch/hermes-labs-plugins: GitHub Copilot left core in 0591b66 (#144788) and now lives in the github-copilot labs plugin, including its Responses replay settings.

    Thanks @ooiuuii for the connection-binding diagnosis. The plugin turns off item-id replay but still lets same-issuer encrypted reasoning replay (responses.py L17-L30); core only drops blobs from a different issuer/model. If the fix needs a new generic ProviderProfile field (e.g. "don't replay encrypted reasoning"), that small core hook is welcome as a core PR; the Copilot setting belongs in the plugin.

  4. added
    github-copilot
    bug
    on Oct 26, 2026
  5. paulorha commented on Nov 27, 2026

    @paulorha
    Contributor

    Status: the Copilot classifier from #78 landed via #99 and is in core's catalog pin, so this rejection now gets its own verdict. Current core still runs credential recovery first and then its older, broader replay cleanup, though. NousResearch/hermes-agent#154361 is the remaining core change: on this verdict it drops only the rejected encrypted item and retries before any credential recovery, with replay left enabled.

    I'd keep this open until a release with both is verified. If you still hit it, the Hermes and plugin versions plus the redacted HTTP status and message would help (no credentials or ciphertext, please).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggithub-copilot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions