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

Function log_context_memory

ds4_server.c:11445–11460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11443#endif
11444
11445static int kv_cache_try_load_text(server *s, server_slot *slot,
11446 const char *prompt_text,
11447 ds4_tokens *effective_prompt,
11448 char **loaded_path_out,
11449 uint8_t *loaded_ext_flags_out,
11450 bool responses_protocol) {
11451 if (!s || !slot) return 0;
11452 if (loaded_path_out) *loaded_path_out = NULL;
11453 if (loaded_ext_flags_out) *loaded_ext_flags_out = 0;
11454 ds4_kvstore_load_result lr = {0};
11455 ds4_kvstore_trailer_hooks hooks = kv_cache_tool_map_hooks(s, NULL);
11456 pthread_mutex_lock(&s->inference_mu);
11457 /* Disk payloads intentionally carry no image identity. If this slot held
11458 * vision state, discard it before restoring a text-only checkpoint so the
11459 * next sync does not reject the fresh payload as a stale image match. */
11460 if (ds4_session_has_vision_state(slot->session)) {
11461 ds4_session_invalidate(slot->session);
11462 }
11463 pthread_mutex_lock(&s->kv_mu);

Callers 1

mainFunction · 0.70

Calls 3

server_logFunction · 0.85
ds4_backend_nameFunction · 0.85

Tested by

no test coverage detected