Skip to content

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

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

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