Skip to content

Canonicalize blank reasoning blocks#519

Open
JordiPosthumus wants to merge 1 commit into
antirez:mainfrom
JordiPosthumus:fix/blank-reasoning-cache-main
Open

Canonicalize blank reasoning blocks#519
JordiPosthumus wants to merge 1 commit into
antirez:mainfrom
JordiPosthumus:fix/blank-reasoning-cache-main

Conversation

@JordiPosthumus

Copy link
Copy Markdown

Summary

  • render whitespace-only assistant reasoning as an empty reasoning block
  • keep non-empty reasoning content unchanged
  • add a server unit test covering blank reasoning in tool-context prompt replay

Why

A replayed assistant turn can carry an empty reasoning block as whitespace, for example <think> </think>, while the live KV prefix may contain <think></think>. That difference is semantically empty but changes the rendered prompt bytes/tokens and can cause a live KV cache token mismatch.

Tests

  • make ds4_test && ./ds4_test --server && make ds4-server

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant