Refactor: Revert auth_token removal and add namespace to ToolSchemas.json, update tests.

This commit is contained in:
Χγφτ Kompanion 2025-10-16 21:51:07 +02:00
parent bc0ae50be5
commit a8694850b1
2 changed files with 19 additions and 7 deletions

View File

@ -5,10 +5,6 @@
"description": "Defines the tools exported by the Kompanion memory daemon.",
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Default namespace applied to relative tool names."
},
"tools": {
"type": "object",
"additionalProperties": {
@ -34,7 +30,6 @@
}
},
"required": [
"namespace",
"tools"
],
"additionalProperties": false,
@ -52,7 +47,6 @@
},
"examples": [
{
"namespace": "kom.memory.v1",
"tools": {
"save_context": {
"description": "Persist context payload in the namespace-backed memory store.",
@ -110,10 +104,19 @@
"tags": {
"$ref": "#/$defs/stringList"
},
"newest_first": {
"type": "boolean"
},
"limit": {
"type": "integer"
},
"since": {
"offset": {
"type": "integer"
},
"min_timestamp": {
"type": "string"
},
"max_timestamp": {
"type": "string"
}
},
@ -164,6 +167,9 @@
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"model": {
"type": "string"
},
@ -172,6 +178,7 @@
}
},
"required": [
"namespace",
"texts"
],
"additionalProperties": false
@ -429,6 +436,7 @@
"type": "boolean"
}
},
"required": [],
"additionalProperties": false
},
"output": {

View File

@ -30,6 +30,10 @@ std::string saveResp = server.dispatch("kom.memory.v1.save_context", saveReq);
if (!expect_contains(saveResp, "\"id\"", "save_context id")) return 1;
if (!expect_contains(saveResp, "\"created_at\"", "save_context timestamp")) return 1;
const std::string saveReqNoNamespace = R"({"key":"nogreeting","content":{"text":"remember this without namespace"},"tags":["context","demo"]})";
std::string saveRespNoNamespace = server.dispatch("kom.memory.v1.save_context", saveReqNoNamespace);
if (!expect_contains(saveRespNoNamespace, "\"error\":{\"code\":\"bad_request\",\"message\":\"namespace is required\"}", "save_context without namespace should fail")) return 1;
const std::string recallReq = R"({"namespace":"tests","key":"greeting","limit":2})";
std::string recallResp = server.dispatch("kom.memory.v1.recall_context", recallReq);
if (!expect_contains(recallResp, "\"items\"", "recall_context items")) return 1;