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

Function agent_prompt_queue_take_all

ds4_agent.c:8470–8485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8468 return 0;
8469}
8470
8471/* ============================================================================
8472 * Model Worker Thread
8473 * ============================================================================
8474 */
8475
8476/* DSML structure is a machine-readable grammar, so once the model has clearly
8477 * started a tool stanza we decode grammar bytes greedily. Parameter values are
8478 * different: they can be shell commands, code, file contents, or edit bodies,
8479 * and should keep the configured sampling behavior. The only exception is a
8480 * parameter closing tag once it is clearly DSML syntax, not ordinary text such
8481 * as HTML/XML/code containing "</".
8482 *
8483 * This helper is intentionally derived only from the current streaming parser
8484 * state. The state object is local to one assistant round, so malformed output,
8485 * EOS, Ctrl+C, or the next turn cannot accidentally leave sampling greedy. */
8486static bool agent_stream_wants_greedy_sampling(const agent_stream_renderer *sr) {
8487 if (!sr || !sr->parser) return false;
8488 if (sr->parser->state == AGENT_DSML_ERROR ||

Callers 2

run_agentFunction · 0.85

Calls 3

agent_prompt_queue_popFunction · 0.85
agent_buf_putsFunction · 0.85
agent_buf_takeFunction · 0.85

Tested by

no test coverage detected