server: fix prompt re-use with `--reasoning-tokens none` (#2353)

This commit is contained in:
Joel Farthing 2026-08-25 02:40:30 -05:00 committed by GitHub
parent 97370e3f27
commit d206417cb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1094,7 +1094,7 @@ bool server_prompt_cache::load(server_prompt& prompt, const server_tokens& token
tokens_new_ex = tokens_new.get_tokens_exclude_think(ctx, think_tokens); tokens_new_ex = tokens_new.get_tokens_exclude_think(ctx, think_tokens);
} }
else { else {
prompt_tokens = std::move(prompt.tokens); prompt_tokens = prompt.tokens.clone();
tokens_new_ex = tokens_new.clone(); tokens_new_ex = tokens_new.clone();
} }
const auto lcp_best = prompt_tokens.get_common_prefix(ctx, tokens_new_ex); const auto lcp_best = prompt_tokens.get_common_prefix(ctx, tokens_new_ex);
@ -1111,7 +1111,7 @@ bool server_prompt_cache::load(server_prompt& prompt, const server_tokens& token
tokens = it->tokens.get_tokens_exclude_think(ctx, think_tokens); tokens = it->tokens.get_tokens_exclude_think(ctx, think_tokens);
} }
else { else {
tokens = std::move(it->tokens); tokens = it->tokens.clone();
} }
const auto lcp_cur = tokens.get_common_prefix(ctx, tokens_new_ex); const auto lcp_cur = tokens.get_common_prefix(ctx, tokens_new_ex);
const float f_keep_cur = float(lcp_cur.first) / tokens.size(); const float f_keep_cur = float(lcp_cur.first) / tokens.size();