v0.7.0: image input, model registry, prefix-cache savings
Images - vision gate: text-only models get a note instead of image parts and no view_image tool; unknown models retry once without images on HTTP 400 - paste: Ctrl+V and /attach paste read the clipboard (wl-paste, xclip, pngpaste/osascript, Win32 PNG or CF_DIB converted to PNG); pasting image file paths attaches them - MCP image content is stored in the session and sent with the tool result - attach: rel path validation, base64 decode, /retry keeps images Model registry - built-in src/models_builtin.json embedded at build time, merged with <config>/models.json and cached GET /models metadata (context, vision, pricing); most specific rule wins per field - /model labels, /status source, --list-models [provider] Cache and cost - stable request prefix (frozen tools, notes as messages), DeepSeek prefix completion, OpenAI/Anthropic cache hints, /cost and hit rate in the status
This commit is contained in:
+4
-1
@@ -288,7 +288,10 @@ int cst_agent_store_info(const char *workspace, const char *id,
|
||||
cJSON *o = cJSON_Parse(line);
|
||||
const cJSON *r = cJSON_GetObjectItemCaseSensitive(o, "role");
|
||||
const cJSON *c = cJSON_GetObjectItemCaseSensitive(o, "content");
|
||||
if (cJSON_IsString(r) && strcmp(r->valuestring, "user") == 0 &&
|
||||
const cJSON *k = cJSON_GetObjectItemCaseSensitive(
|
||||
cJSON_GetObjectItemCaseSensitive(o, "meta"), "kind");
|
||||
int note = cJSON_IsString(k) && strcmp(k->valuestring, "note") == 0;
|
||||
if (cJSON_IsString(r) && strcmp(r->valuestring, "user") == 0 && !note &&
|
||||
cJSON_IsString(c) && c->valuestring[0]) {
|
||||
clip_line(info->first_user, sizeof(info->first_user), c->valuestring);
|
||||
have_first = 1;
|
||||
|
||||
Reference in New Issue
Block a user