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

Function agent_kv_read_text

ds4_agent.c:3688–3699  ·  view source on GitHub ↗

Agent sessions deliberately use a different policy from ds4-server: * * - sysprompt.kv is a fixed bootstrap checkpoint for the current tool/system * prompt. Because its name is fixed, the current rendered text is compared * with the text stored in the file before loading. A mismatch simply rebuilds * and overwrites the file. * - conversation sessions are explicit saves only. Their s

Source from the content-addressed store, hash-verified

3686 static const char fullwidth_marker[] = "|DSML|";
3687 static const char ascii_marker[] = "|DSML|";
3688 static const char missing_open[] = "<DSML|";
3689 static const char missing_close[] = "</DSML|";
3690 return agent_tail_matches(d->tail, d->len,
3691 fullwidth_marker, sizeof(fullwidth_marker) - 1) ||
3692 agent_tail_matches(d->tail, d->len,
3693 ascii_marker, sizeof(ascii_marker) - 1) ||
3694 agent_tail_matches(d->tail, d->len,
3695 missing_open, sizeof(missing_open) - 1) ||
3696 agent_tail_matches(d->tail, d->len,
3697 missing_close, sizeof(missing_close) - 1);
3698}
3699
3700static void agent_stream_note_thinking_dsml_byte(agent_stream_renderer *sr,
3701 char c) {
3702 if (!sr->in_think || sr->dsml_in_think) return;

Callers 3

agent_kv_load_pathFunction · 0.85

Calls 1

xmallocFunction · 0.70

Tested by

no test coverage detected