Single live protocol-tool state. * * This is not an implementation of durable remote conversation storage. It is * only an in-memory binding from protocol tool-call IDs to the current sampled * KV frontier. If it does not match, DS4 falls back to the same prefix and * disk-cache machinery used by chat/completions, or returns a clear error for * tool-result-only requests that have no replay
| 7943 | ts->state = DSML_TOOL_DONE; |
| 7944 | return true; |
| 7945 | } |
| 7946 | if (raw_partial_any(raw, raw_len, ts->parse_pos, ts->tool_calls_end, ts->invoke_start)) return true; |
| 7947 | if (raw_full_lit(raw, raw_len, ts->parse_pos, ts->invoke_start)) { |
| 7948 | size_t before_pos = ts->parse_pos; |
| 7949 | dsml_tool_stream_state before_state = ts->state; |
| 7950 | if (!openai_tool_start_invoke(fd, s, r, id, ts, raw, raw_len)) return false; |
| 7951 | if (ts->parse_pos == before_pos && ts->state == before_state) return true; |
| 7952 | continue; |
| 7953 | } |
| 7954 | return openai_tool_stream_fail(ts); |
| 7955 | } |
| 7956 |
no test coverage detected