MCPcopy Create free account
hub / github.com/antirez/ds4 / remember_thinking_checkpoint

Function remember_thinking_checkpoint

ds4_server.c:9801–9814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9799 byte_prefix_match(req->prompt_text, prompt_len,
9800 slot->responses_live.visible_text,
9801 slot->responses_live.visible_len);
9802 if (ok) visible_len = slot->responses_live.visible_len;
9803 pthread_mutex_unlock(&s->tool_mu);
9804 if (!ok) return 0;
9805
9806 const ds4_tokens *live_tokens = ds4_session_tokens(slot->session);
9807 if (!live_tokens || live_tokens->len != live_pos) return 0;
9808
9809 build_prompt_from_exact_prefix_and_text_suffix(
9810 s->engine, live_tokens, req->prompt_text + visible_len,
9811 effective_prompt);
9812 return live_tokens->len;
9813}
9814
9815/* Tool-less thinking continuation.
9816 *
9817 * Chat/completions and Anthropic do not have a previous_response_id object that

Callers 1

generate_jobFunction · 0.85

Calls 5

thinking_live_rememberFunction · 0.85
server_logFunction · 0.85
ds4_session_posFunction · 0.85
trace_eventFunction · 0.85

Tested by

no test coverage detected