| 11443 | #endif |
| 11444 | |
| 11445 | static 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); |
no test coverage detected