Skip to content

[Bug] DeepSeek V4 Flash remote auto-compaction needs v2.11+ reproduction #1128

Closed

Description

@c040340

Area

Responses remote compaction / DeepSeek compatibility

Current status

This issue originally reported a deterministic remote auto-compaction failure with:

deepseek/deepseek-v4-flash

on OpenCodex 2.10.1 and 2.10.2.

The reported error was:

Error running remote compact task: stream disconnected before completion:
stream closed before response.completed

That report was valid for the 2.10.x transport behavior.

However, the transport premise changed in v2.11.0.

Commit:

0b8e608c

removed the DeepSeek-specific bounded-JSON forcing after live Responses probes showed that deepseek-v4-flash now emits proper terminal events.

Current OpenCodex therefore keeps the real SSE path instead of copying the old 2.10.x bounded-JSON policy into remote compaction.

This issue now tracks whether remote auto-compaction still fails on the current transport behavior.

Historical behavior on 2.10.x

On 2.10.1 / 2.10.2, the regular Responses path applied a DeepSeek-specific transport policy while the remote compact path did not.

That meant a regular turn could receive a synthesized terminal response while the compact path could end without the response.completed event required by Codex's remote-compaction collector.

The original reproduction therefore failed consistently during remote auto-compaction.

Manual /compact succeeded on the same:

  • session;
  • model;
  • context.

That isolated the historical failure to the remote-compaction path rather than the model's ability to summarize or the context size.

What changed in v2.11.0

Live Responses probing subsequently showed that deepseek-v4-flash now produces valid SSE terminal events itself.

The DeepSeek-specific bounded-JSON force was therefore retired rather than propagated to additional paths.

Current expected terminal behavior includes one of:

response.completed
response.incomplete
response.failed

as appropriate for the request outcome.

Because the upstream contract changed, copying the old bounded-JSON policy into:

compact.ts
collaboration.ts
encrypted-payload.ts

is no longer the correct proposed implementation.

Draft PR #1167 pursued that older approach and was closed without merge after the transport change made it obsolete.

Current reproduction needed

Please retest against:

OpenCodex v2.11.0+

or current dev.

Use:

  • built-in deepseek provider;
  • deepseek-v4-flash;
  • Codex Desktop/App;
  • remote auto-compaction, not only manual /compact.

A session should be allowed to reach the automatic compaction threshold naturally or through a deterministic test configuration.

Expected behavior

Remote auto-compaction should complete successfully on deepseek-v4-flash.

The compact request should produce a valid terminal event sequence and Codex should receive a completed compact result instead of:

stream closed before response.completed

If the failure still reproduces

Capture the terminal event sequence from the remote compact request itself.

We need to know whether the upstream/adapter emits:

response.completed
response.incomplete
response.failed
[DONE]

and in what order.

Please include:

  1. exact OpenCodex version or commit;
  2. Codex Desktop/App version;
  3. provider and model;
  4. confirmation that the failure is from remote auto-compaction;
  5. the compact request's terminal SSE event sequence;
  6. the exact resulting OpenCodex/Codex error.

Credentials and prompt contents can be removed.

The terminal event sequence is the important evidence.

How to interpret the result

Auto-compaction succeeds on v2.11+

The historical 2.10.x failure no longer reproduces and this issue can be closed as resolved by the transport change introduced in:

0b8e608c

Auto-compaction still fails and no terminal event is emitted

That would establish a current provider/adapter terminal-event problem.

A valid terminal event is emitted but Codex still reports the stream closed

That would establish a current remote-compaction relay/collection bug rather than the historical bounded-JSON policy gap.

Those cases should be debugged from the current event trace rather than restoring the obsolete 2.10.x transport workaround.

Relationship to other DeepSeek issues

This issue is specifically about:

remote auto-compaction

and should remain separate from ordinary Responses request failures.

A normal /v1/responses failure and a remote-compaction failure travel through different code paths and can have different causes.

Acceptance / closure criteria

Close this issue if a current v2.11+ reproduction confirms that remote auto-compaction succeeds with deepseek-v4-flash.

Keep it open if the failure still reproduces, but update the issue with the current terminal-event trace and investigate it as a current compact-path defect.

Checks

Activity

  1. github-actions commented on Aug 6, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    bugSomething isn't working
    streamingSSE, WebSocket, terminal stream frames
    on Aug 6, 2026
  3. c040340 commented on Aug 6, 2026

    @c040340
    Author

    Additional data point that isolates the failure to the remote-compact path:

    Manual /compact succeeds on the same session, same model (deepseek-v4-flash), same context — while auto-compaction fails every time with the error above.

    This rules out the two explanations that would otherwise be natural here:

    • it is not "the model cannot produce a summary" — it summarises fine on demand;
    • it is not context size — the same context compacts successfully via the manual command.

    The summarisation only works when the request leaves through the regular turn path in core.ts, where providerModelResponsesUpstreamStreaming forces the bounded-JSON upstream and a real terminal event is synthesized. The remote compact task path is the one that never consults that policy, and it is the only one that fails.

    Note also that raising model_auto_compact_token_limit is not a usable workaround — it does not fix compaction, it just defers it until the context is unmanageable.

  4. awillheartwu commented on Aug 6, 2026

    @awillheartwu

    same here,compact failed

  5. Ingwannu commented on Aug 8, 2026

    @Ingwannu
    Owner

    This report was valid for 2.10.1/2.10.2, but the transport premise changed in v2.11.0. Commit 0b8e608c (included in v2.11.0) retired the DeepSeek-specific bounded-JSON force after live Responses probes showed deepseek-v4-flash now emits a real response.completed / response.incomplete / response.failed terminal. Current dev therefore keeps true SSE instead of copying the old force into compact/collaboration paths; draft PR #1167 was closed without merge because that approach became obsolete.\n\nPlease retest remote auto-compaction on v2.11.0. If it still fails, attach the terminal event sequence from the compact request on that version; that would be a current compact relay bug rather than the missing 2.10.x bounded-JSON policy. Leaving this open pending that current-version control.

  6. added
    needs-infoWaiting on reporter for a concrete spec or reproduction
    on Aug 9, 2026
  7. changed the title [-][Bug]: Remote compaction always fails on deepseek-v4-flash - the #1026 bounded-JSON policy is not applied on the compact path[/-] [+][Bug] DeepSeek V4 Flash remote auto-compaction needs v2.11+ reproduction[/+] on Aug 9, 2026
  8. Wibias commented on Aug 10, 2026

    @Wibias
    Contributor

    Since this is now obsolete, please open a new issue if you still encounter this issue.

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

    bugSomething isn't workingneeds-infoWaiting on reporter for a concrete spec or reproductionstreamingSSE, WebSocket, terminal stream frames

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions