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

Function tool_memory_prune_locked

ds4_server.c:7874–7880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7872
7873 const char *close = strstr(raw + st->emit_pos, "</think>");
7874 const char *tool = r->has_tools ?
7875 find_any_tool_start(raw + st->emit_pos) : NULL;
7876 const bool tool_before_close = tool && (!close || tool < close);
7877 const bool complete_tool =
7878 tool_before_close && find_any_tool_end(tool) != NULL;
7879 size_t limit;
7880 if (tool_before_close) {
7881 limit = trim_tool_separator_ws(raw, st->emit_pos,
7882 (size_t)(tool - raw));
7883 } else if (close) {

Callers 1

tool_memory_put_lockedFunction · 0.85

Calls 3

tool_memory_max_entriesFunction · 0.85
tool_memory_max_bytesFunction · 0.85

Tested by

no test coverage detected