You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a long-running ds4-agent session on Metal using DeepSeek V4 Flash Vision-Exp, automatic context compaction generated its durable summary successfully but failed while rebuilding the compacted context:
COMPACTING rebuilding context: old=85462 summary+tail=13924 tail=10000
ds4-agent: metal prefill failed
COMPACTING soft limit before user turn: summarizing durable task state
The previous transcript is restored after the failure, but the agent remains above the compaction threshold, so another user turn can trigger the same failure again.
What I expected
Compaction should preserve or omit multimodal observations atomically, rebuild a valid compacted context, and continue processing the pending user turn.
Steps to reproduce
Build ds4-agent from current main and run it on an Apple Silicon Mac with the Metal backend, a DeepSeek V4 Flash Vision-Exp model, and the DeepSeek V4 vision encoder.
Run a long coding session that includes one or more view_image observations.
Continue until the transcript reaches the automatic compaction threshold (about 85k tokens with the default 100k context).
Submit another user turn so automatic compaction runs.
Observe that summary generation completes, but the compacted-context Metal prefill fails.
Additional context
Commit: 819cef0 (local build; the vision encoder is configured to load by default, with inference code otherwise matching this commit).
Hardware: Apple Silicon Mac with 128 GB unified memory.
The rebuilt prompt contains only 13,924 tokens, so this is not a context-length overflow.
The retained tail was exactly the 10,000-token budget. Code inspection suggests that when no later user-turn boundary exists, the raw cutoff can land inside a DeepSeek image token block, while only fully retained image spans/embeddings are carried into the rebuilt transcript. That would leave a partial image block and cause Vision-Exp prefill to reject the prompt.
If available, the lower-level stderr line immediately before ds4-agent: metal prefill failed would help distinguish a malformed image block from a Metal command-buffer failure.
What happened
In a long-running
ds4-agentsession on Metal using DeepSeek V4 Flash Vision-Exp, automatic context compaction generated its durable summary successfully but failed while rebuilding the compacted context:The previous transcript is restored after the failure, but the agent remains above the compaction threshold, so another user turn can trigger the same failure again.
What I expected
Compaction should preserve or omit multimodal observations atomically, rebuild a valid compacted context, and continue processing the pending user turn.
Steps to reproduce
ds4-agentfrom currentmainand run it on an Apple Silicon Mac with the Metal backend, a DeepSeek V4 Flash Vision-Exp model, and the DeepSeek V4 vision encoder.view_imageobservations.Additional context
819cef0(local build; the vision encoder is configured to load by default, with inference code otherwise matching this commit).DeepSeek-V4-Flash-Vision-Exp-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8.gguf.DeepSeek-V4-Flash-Vision-Encoder.gguf.ds4-agent: metal prefill failedwould help distinguish a malformed image block from a Metal command-buffer failure.