a2a: GetTask/CancelTask as client tools, and a spec-shaped GetTask
The plugin registers a2a_get_task (read) and a2a_cancel_task
(destructive) for a local model that uses A2A as a tool source; both
share the endpoint or card and return the raw task/error JSON.
The server's GetTask result was wrapped as {"task": ...}; the spec's
result is the Task itself. Fixed, and the test checks the shape.
The website's tool-count regex missed digits, so a2a_get_task and
a2a_cancel_task were not counted; [a-z0-9_]+ now reports 25.
test_a2a drives both tools through the mock transport and checks the
session observations. Full make check green.
This commit is contained in:
1 parent
f4077687fa
commit
544399a3bf
12 files changed
+226
-31
No files matched your search
@@ -12,3 +12,6 @@ plugins/*/*.so
|
||||
tests/test_*
|
||||
!tests/test_*.c
|
||||
!tests/test_*.sh
|
||||
|
||||
# python bytecode from the test helpers
|
||||
__pycache__/
|
||||
@@ -30,11 +30,14 @@ Text, text/plain `raw` (base64) und String-`data`-Teile werden gelesen; ein
|
||||
`url`- oder binaerer Teil wird mit `ContentTypeNotSupported` (-32005) abgelehnt,
|
||||
nicht abgerufen. Push an Webhooks und Multiturn ueber `contextId` stehen.
|
||||
|
||||
Offen: die Fortsetzung eines unterbrochenen Tasks (`INPUT_REQUIRED`), die
|
||||
Push-Config-CRUD-Methoden und `GetTask`/`CancelTask` auf der Client-Seite.
|
||||
Der Client registriert `a2a_get_task` und `a2a_cancel_task` (read/destructive)
|
||||
fuer ein lokales Modell, das ihn als Werkzeugquelle nutzt; der Server liefert
|
||||
`GetTask` als Task-Objekt (nicht als `{"task":...}`).
|
||||
|
||||
Naechster Schritt: Client-Polling (GetTask) oder ein pausierbarer Turn fuer
|
||||
INPUT_REQUIRED.
|
||||
Offen: die Fortsetzung eines unterbrochenen Tasks (`INPUT_REQUIRED`) und die
|
||||
Push-Config-CRUD-Methoden. URL- und binaere Teile bleiben bewusst abgelehnt.
|
||||
|
||||
Naechster Schritt: ein pausierbarer Turn fuer INPUT_REQUIRED.
|
||||
|
||||
### 2. `~/.local/lib` enthaelt Fremdlast
|
||||
|
||||
@@ -79,8 +82,9 @@ Naechster Schritt: entscheiden, ob die npm-Reste weg duerfen. Kein Code.
|
||||
Artefakt-Text live) und findet den Endpunkt ueber `SPLINTER_A2A_CARD`;
|
||||
`src/a2aserver.c` serviert `SendMessage`, `SendStreamingMessage` (SSE),
|
||||
`GetTask`, `ListTasks`, Multiturn ueber `contextId`, text/plain-`raw`- und
|
||||
String-`data`-Teile, Webhook-Push und die Agent Card mit Bearer-Token; die
|
||||
Karte meldet `streaming:true` und `pushNotifications:true`. `tests/test_a2a.sh` prueft Task, Message, Token, Fehler,
|
||||
String-`data`-Teile, Webhook-Push, `a2a_get_task`/`a2a_cancel_task` als
|
||||
Client-Werkzeuge und die Agent Card mit Bearer-Token; die Karte meldet
|
||||
`streaming:true` und `pushNotifications:true`. `tests/test_a2a.sh` prueft Task, Message, Token, Fehler,
|
||||
Streaming und Discovery, `tests/test_a2a_ui.sh` den Streaming-Pfad,
|
||||
`tests/test_a2a_server.sh` den Server und den Client gegen den Server
|
||||
(Discovery, blockierend und streamend), `tests/test_a2a_context.sh` die
|
||||
|
||||
+6
-4
@@ -314,8 +314,10 @@ The endpoint can be configured directly (`SPLINTER_A2A_URL`) or discovered:
|
||||
The discovered URL is kept for the session.
|
||||
|
||||
Not implemented yet on the client side, and named so nobody assumes otherwise:
|
||||
file/structured-data parts, push notifications, and `GetTask`/`CancelTask`
|
||||
(the client sends and streams; it does not poll or cancel).
|
||||
file/structured-data parts and push notifications (the client sends and streams). With a local
|
||||
transport, the plugin also registers `a2a_get_task` and `a2a_cancel_task`
|
||||
(read/destructive); both use the same endpoint or card and return the raw
|
||||
task/error JSON.
|
||||
`tests/fake_a2a.py` and `tests/test_a2a.sh` pin the blocking wire shape, both
|
||||
result forms, the bearer token, a JSON-RPC error, streaming and discovery;
|
||||
`tests/test_a2a_ui.sh` drives the streaming path through tmux.
|
||||
@@ -333,8 +335,8 @@ named by `contextId` (or a fresh one, whose id comes back in the task), stores
|
||||
the completed Task and returns it;
|
||||
`SendStreamingMessage` runs the same turn and writes SSE `artifactUpdate` events
|
||||
as the transport produces text (a non-streaming transport sends its whole answer
|
||||
as one artifact), followed by a completed `statusUpdate`; `GetTask` returns a
|
||||
stored task and `ListTasks` lists them (optionally by `contextId`); `GET /.well-known/agent-card.json` serves a card with the `JSONRPC`
|
||||
as one artifact), followed by a completed `statusUpdate`; `GetTask` returns the
|
||||
stored Task itself and `ListTasks` lists them (optionally by `contextId`); `GET /.well-known/agent-card.json` serves a card with the `JSONRPC`
|
||||
interface. One request at a time, one connection at a time.
|
||||
|
||||
A `taskPushNotificationConfig` in the `SendMessage`/`SendStreamingMessage`
|
||||
|
||||
@@ -932,6 +932,121 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static const char *
|
||||
arg_id(const char *args, struct sp_buf *keep)
|
||||
{
|
||||
mcp_json *v;
|
||||
const char *sv;
|
||||
const char *id = NULL;
|
||||
|
||||
if (args == NULL || args[0] != '{' || (v = mcp_parse(args)) == NULL)
|
||||
return NULL;
|
||||
sv = mcp_arg_string(v, "id");
|
||||
if (sv != NULL && *sv != '\0' && sp_buf_puts(keep, sv) == 0)
|
||||
id = keep->p;
|
||||
mcp_json_free(v);
|
||||
return id;
|
||||
}
|
||||
|
||||
/* one JSON-RPC call whose result is a Task or an error; the raw answer is text */
|
||||
static int
|
||||
rpc(struct a2a_cfg *c, const char *method, const char *id, struct sp_buf *out,
|
||||
struct sp_buf *err)
|
||||
{
|
||||
struct sp_buf body, raw;
|
||||
char rid[96], *nl;
|
||||
long http;
|
||||
|
||||
if (discover(c, err) != 0)
|
||||
return -1;
|
||||
if (c->url[0] == '\0') {
|
||||
sp_buf_puts(err, "a2a: neither SPLINTER_A2A_URL nor "
|
||||
"SPLINTER_A2A_CARD is set");
|
||||
return -1;
|
||||
}
|
||||
make_id(rid, sizeof(rid), "rpc");
|
||||
if (sp_buf_init(&body) != 0 || sp_buf_init(&raw) != 0)
|
||||
return -1;
|
||||
if (sp_buf_printf(&body, "{\"jsonrpc\":\"2.0\",\"id\":\"%s\","
|
||||
"\"method\":\"%s\",\"params\":{\"id\":\"", rid, method) != 0 ||
|
||||
sp_json_escape(&body, id) != 0 ||
|
||||
sp_buf_puts(&body, "\"}}") != 0 ||
|
||||
post(c, body.p, &raw, err) != 0)
|
||||
goto fail;
|
||||
if (raw.len < 2 || (nl = strrchr(raw.p, '\n')) == NULL) {
|
||||
sp_buf_puts(err, "a2a: unparseable response (no HTTP status)");
|
||||
goto fail;
|
||||
}
|
||||
http = strtol(nl + 1, NULL, 10);
|
||||
*nl = '\0';
|
||||
if (http < 200 || http > 299) {
|
||||
sp_buf_printf(err, "a2a: HTTP %ld: %.200s", http,
|
||||
raw.p != NULL ? raw.p : "");
|
||||
goto fail;
|
||||
}
|
||||
sp_buf_puts(out, raw.p);
|
||||
sp_buf_free(&body);
|
||||
sp_buf_free(&raw);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
sp_buf_free(&body);
|
||||
sp_buf_free(&raw);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
tool_get_task(const char *args, struct sp_buf *out, void *ctx)
|
||||
{
|
||||
struct a2a_cfg *c = ctx;
|
||||
struct sp_buf keep, err;
|
||||
const char *id;
|
||||
int rc;
|
||||
|
||||
if (sp_buf_init(&keep) != 0 || sp_buf_init(&err) != 0)
|
||||
return -1;
|
||||
id = arg_id(args, &keep);
|
||||
if (id == NULL || *id == '\0') {
|
||||
sp_buf_free(&keep);
|
||||
sp_buf_free(&err);
|
||||
return sp_buf_puts(out, "error: 'id' is required");
|
||||
}
|
||||
rc = rpc(c, "GetTask", id, out, &err);
|
||||
if (rc != 0) {
|
||||
sp_buf_puts(out, "error: ");
|
||||
sp_buf_puts(out, err.p != NULL ? err.p : "request failed");
|
||||
}
|
||||
sp_buf_free(&keep);
|
||||
sp_buf_free(&err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
tool_cancel_task(const char *args, struct sp_buf *out, void *ctx)
|
||||
{
|
||||
struct a2a_cfg *c = ctx;
|
||||
struct sp_buf keep, err;
|
||||
const char *id;
|
||||
int rc;
|
||||
|
||||
if (sp_buf_init(&keep) != 0 || sp_buf_init(&err) != 0)
|
||||
return -1;
|
||||
id = arg_id(args, &keep);
|
||||
if (id == NULL || *id == '\0') {
|
||||
sp_buf_free(&keep);
|
||||
sp_buf_free(&err);
|
||||
return sp_buf_puts(out, "error: 'id' is required");
|
||||
}
|
||||
rc = rpc(c, "CancelTask", id, out, &err);
|
||||
if (rc != 0) {
|
||||
sp_buf_puts(out, "error: ");
|
||||
sp_buf_puts(out, err.p != NULL ? err.p : "request failed");
|
||||
}
|
||||
sp_buf_free(&keep);
|
||||
sp_buf_free(&err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
a2a_send(void *ctx, const struct sp_conv *conv, struct sp_reply *out,
|
||||
struct sp_buf *err)
|
||||
@@ -1024,6 +1139,30 @@ a2a_init(struct sp_host *h)
|
||||
cfg.timeout = strtol(to, NULL, 10);
|
||||
cfg.full = full != NULL && strcmp(full, "0") != 0;
|
||||
|
||||
{
|
||||
static struct sp_tool t_get, t_cancel;
|
||||
|
||||
memset(&t_get, 0, sizeof(t_get));
|
||||
t_get.name = "a2a_get_task";
|
||||
t_get.description = "Poll an A2A task by id; returns the task JSON.";
|
||||
t_get.params = "{\"type\":\"object\",\"properties\":{"
|
||||
"\"id\":{\"type\":\"string\"}},\"required\":[\"id\"]}";
|
||||
t_get.auth = SP_AUTH_READ;
|
||||
t_get.run = tool_get_task;
|
||||
t_get.ctx = &cfg;
|
||||
(void)sp_host_add_tool(h, &t_get);
|
||||
|
||||
memset(&t_cancel, 0, sizeof(t_cancel));
|
||||
t_cancel.name = "a2a_cancel_task";
|
||||
t_cancel.description = "Cancel an A2A task by id; a completed task "
|
||||
"answers TaskNotCancelable.";
|
||||
t_cancel.params = t_get.params;
|
||||
t_cancel.auth = SP_AUTH_DESTRUCTIVE;
|
||||
t_cancel.run = tool_cancel_task;
|
||||
t_cancel.ctx = &cfg;
|
||||
(void)sp_host_add_tool(h, &t_cancel);
|
||||
}
|
||||
|
||||
memset(&tr, 0, sizeof(tr));
|
||||
tr.send = a2a_send;
|
||||
tr.send_stream = a2a_stream;
|
||||
|
||||
+2
-1
@@ -1016,7 +1016,8 @@ send_out:
|
||||
mcp_json_free(v);
|
||||
return;
|
||||
}
|
||||
task_json(&out, t);
|
||||
/* GetTask's result is the Task itself, not {"task": ...} */
|
||||
task_obj(&out, t);
|
||||
rpc_result(fd, id, out.p != NULL ? out.p : "{}");
|
||||
sp_buf_free(&out);
|
||||
} else if (strcmp(method, "ListTasks") == 0) {
|
||||
|
||||
@@ -53,8 +53,8 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
|
||||
<h1>splinter<span>_</span></h1>
|
||||
<p class="lead">An agent harness you own: chat in the terminal, tools with authorization classes, plugins, any model that speaks OpenAI — built by us so we can change it, instead of getting used to how somebody else's client behaves.</p>
|
||||
|
||||
<p class="meta"><b>24853</b> lines of C99/POSIX ·
|
||||
<b>23</b> tools · <b>32</b> test programs ·
|
||||
<p class="meta"><b>24993</b> lines of C99/POSIX ·
|
||||
<b>25</b> tools · <b>32</b> test programs ·
|
||||
<b>16</b> plugins · <b>42</b> palettes · BSD-3-Clause</p>
|
||||
|
||||
<h2>What it is</h2>
|
||||
@@ -187,7 +187,7 @@ in the header before anybody reads its prose.</p>
|
||||
<p>As a client splinter fetches an MCP server's tools. As a server it offers its
|
||||
own:</p>
|
||||
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
|
||||
splinter: MCP server on 0.0.0.0:8098 (23 tools, read only)</pre>
|
||||
splinter: MCP server on 0.0.0.0:8098 (25 tools, read only)</pre>
|
||||
<p>Another agent gets <code>initialize</code>, <code>tools/list</code> and
|
||||
<code>tools/call</code>. Read tools are served; mutating and destructive ones only
|
||||
with <code>--autonomous</code> — a foreign agent does not run shell commands
|
||||
|
||||
+3
-3
@@ -53,8 +53,8 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
|
||||
<h1>splinter<span>_</span></h1>
|
||||
<p class="lead">Ein Agent-Harness, das dir gehoert: Chat im Terminal, Werkzeuge mit Autorisierungsklassen, Plugins, jedes Modell das OpenAI spricht — von uns gebaut, damit wir es umbauen koennen, statt uns an das Verhalten eines fremden Clients zu gewoehnen.</p>
|
||||
|
||||
<p class="meta"><b>24853</b> Zeilen C99/POSIX ·
|
||||
<b>23</b> Werkzeuge · <b>32</b> Test-Programme ·
|
||||
<p class="meta"><b>24993</b> Zeilen C99/POSIX ·
|
||||
<b>25</b> Werkzeuge · <b>32</b> Test-Programme ·
|
||||
<b>16</b> Plugins · <b>42</b> Farbschemata · BSD-3-Clause</p>
|
||||
|
||||
<h2>Was es ist</h2>
|
||||
@@ -188,7 +188,7 @@ ist in der Kopfzeile sichtbar, bevor jemand seinen Text liest.</p>
|
||||
<p>Als Client holt splinter die Werkzeuge eines MCP-Servers. Als Server stellt es
|
||||
seine eigenen hin:</p>
|
||||
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
|
||||
splinter: MCP server on 0.0.0.0:8098 (23 tools, read only)</pre>
|
||||
splinter: MCP server on 0.0.0.0:8098 (25 tools, read only)</pre>
|
||||
<p>Ein anderer Agent bekommt <code>initialize</code>, <code>tools/list</code> und
|
||||
<code>tools/call</code>. Lesende Werkzeuge werden bedient, mutierende und
|
||||
destruktive nur mit <code>--autonomous</code> — ein fremder Agent fuehrt hier
|
||||
|
||||
@@ -53,8 +53,8 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
|
||||
<h1>splinter<span>_</span></h1>
|
||||
<p class="lead">Um harness de agente que e seu: chat no terminal, ferramentas com classes de autorizacao, plugins, qualquer modelo que fale OpenAI - escrito por nos para poder mudar-lo, em vez de nos acostumar com o comportamento de um cliente alheio.</p>
|
||||
|
||||
<p class="meta"><b>24853</b> linhas C99/POSIX ·
|
||||
<b>23</b> ferramentas · <b>32</b> programas de teste ·
|
||||
<p class="meta"><b>24993</b> linhas C99/POSIX ·
|
||||
<b>25</b> ferramentas · <b>32</b> programas de teste ·
|
||||
<b>16</b> plugins · <b>42</b> paletas · BSD-3-Clause</p>
|
||||
|
||||
<h2>O que e</h2>
|
||||
@@ -80,7 +80,7 @@ transcript na ordem em que acontecem.</p>
|
||||
entrar na frente com um gate: permitir, negar com motivo, ou nao opinar.</p>
|
||||
|
||||
<h2>Ferramentas</h2>
|
||||
<p>23 ferramentas: <code>read</code>, <code>write</code>, <code>edit</code>,
|
||||
<p>25 ferramentas: <code>read</code>, <code>write</code>, <code>edit</code>,
|
||||
<code>search</code>, <code>list</code>, <code>run</code>, <code>folder_history</code>,
|
||||
<code>delegate</code>, <code>delegate_parallel</code>, as de leitura do sistema e as de
|
||||
skills, memoria e pesquisa na web.</p>
|
||||
@@ -133,7 +133,7 @@ poe suas proprias chaves.</p>
|
||||
|
||||
<h2>As duas direcoes: MCP</h2>
|
||||
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
|
||||
splinter: MCP server on 0.0.0.0:8098 (23 tools, read only)</pre>
|
||||
splinter: MCP server on 0.0.0.0:8098 (25 tools, read only)</pre>
|
||||
<p>Como cliente busca ferramentas; como servidor oferece as suas. Mutar so com
|
||||
<code>--autonomous</code>.</p>
|
||||
|
||||
|
||||
+29
-9
@@ -32,6 +32,14 @@ class H(http.server.BaseHTTPRequestHandler):
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
def reply(self, obj, ctype="application/json"):
|
||||
b = json.dumps(obj).encode()
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", ctype)
|
||||
self.send_header("Content-Length", str(len(b)))
|
||||
self.end_headers()
|
||||
self.wfile.write(b)
|
||||
|
||||
def do_GET(self):
|
||||
port = self.server.server_address[1]
|
||||
if self.path.endswith("old-card.json"):
|
||||
@@ -51,6 +59,7 @@ class H(http.server.BaseHTTPRequestHandler):
|
||||
self.wfile.write(b)
|
||||
|
||||
def do_POST(self):
|
||||
global last_task
|
||||
n = int(self.headers.get("Content-Length", 0))
|
||||
raw = self.rfile.read(n)
|
||||
with open(LOG, "a") as f:
|
||||
@@ -65,6 +74,15 @@ class H(http.server.BaseHTTPRequestHandler):
|
||||
pass
|
||||
rid = req.get("id")
|
||||
ctype = "text/event-stream" if stream else "application/json"
|
||||
method = req.get("method", "")
|
||||
if method == "GetTask":
|
||||
task = last_task if last_task is not None else task_obj(
|
||||
"TASK_STATE_COMPLETED", "a2a sagt hallo", "und tschuess")
|
||||
return self.reply({"jsonrpc": "2.0", "id": rid, "result": task})
|
||||
if method == "CancelTask":
|
||||
return self.reply({"jsonrpc": "2.0", "id": rid,
|
||||
"error": {"code": -32002,
|
||||
"message": "TaskNotCancelable"}})
|
||||
want_auth = "auth" in text
|
||||
if want_auth and self.headers.get("Authorization") != "Bearer tok":
|
||||
if stream:
|
||||
@@ -90,15 +108,16 @@ class H(http.server.BaseHTTPRequestHandler):
|
||||
b = json.dumps({"jsonrpc": "2.0", "id": rid,
|
||||
"result": {"message": msg}}).encode()
|
||||
elif "raw" in text:
|
||||
body = {"jsonrpc": "2.0", "id": rid, "result": {"task": {
|
||||
"id": "task-1", "contextId": "ctx-1",
|
||||
"status": {"state": "TASK_STATE_COMPLETED",
|
||||
"message": {"messageId": "m5",
|
||||
"role": "ROLE_AGENT",
|
||||
"parts": [{"text": "text teil"}]}},
|
||||
"artifacts": [{"artifactId": "a3", "parts": [
|
||||
{"raw": "aGFsbG8=", "mediaType": "text/plain"},
|
||||
{"data": "struktur"}]}]}}}
|
||||
task = {"id": "task-1", "contextId": "ctx-1",
|
||||
"status": {"state": "TASK_STATE_COMPLETED",
|
||||
"message": {"messageId": "m5",
|
||||
"role": "ROLE_AGENT",
|
||||
"parts": [{"text": "text teil"}]}},
|
||||
"artifacts": [{"artifactId": "a3", "parts": [
|
||||
{"raw": "aGFsbG8=", "mediaType": "text/plain"},
|
||||
{"data": "struktur"}]}]}
|
||||
last_task = task
|
||||
body = {"jsonrpc": "2.0", "id": rid, "result": {"task": task}}
|
||||
b = json.dumps(body).encode()
|
||||
elif stream and "streamstatus" in text:
|
||||
b = (event(rid, {"task": task_obj("TASK_STATE_WORKING")}) +
|
||||
@@ -135,6 +154,7 @@ class H(http.server.BaseHTTPRequestHandler):
|
||||
else:
|
||||
task = task_obj("TASK_STATE_COMPLETED", "a2a sagt hallo",
|
||||
"und tschuess")
|
||||
last_task = task
|
||||
if stream:
|
||||
b = event(rid, {"task": task}).encode()
|
||||
else:
|
||||
|
||||
@@ -109,5 +109,29 @@ out=$(discovered "old-card.json" "hallo" 2>&1)
|
||||
echo "$out" | grep -q 'a2a sagt hallo'
|
||||
check test $? -eq 0
|
||||
|
||||
# ---- the plugin's GetTask/CancelTask tools against the same agent ----
|
||||
mkdir -p "$D/home"
|
||||
printf 'tool a2a_get_task {"id":"task-1"}\nanswer done\n' > "$D/tool-get.txt"
|
||||
out=$(HOME="$D/home" SPLINTER_A2A_URL="http://127.0.0.1:$P/rpc" \
|
||||
SPLINTER_A2A_TIMEOUT=20 ./splinter --no-config \
|
||||
--plugin plugins/a2a/a2a.so --script "$D/tool-get.txt" \
|
||||
-p "tool" --autonomous 2>&1)
|
||||
echo "$out" | grep -q '^done'
|
||||
check test $? -eq 0
|
||||
sess=$(ls -t "$D/home/.splinter"/sess-*.jsonl 2>/dev/null | head -1)
|
||||
check test -n "$sess"
|
||||
check grep -q 'TASK_STATE_COMPLETED' "$sess"
|
||||
|
||||
printf 'tool a2a_cancel_task {"id":"task-1"}\nanswer done\n' \
|
||||
> "$D/tool-cancel.txt"
|
||||
out=$(HOME="$D/home" SPLINTER_A2A_URL="http://127.0.0.1:$P/rpc" \
|
||||
SPLINTER_A2A_TIMEOUT=20 ./splinter --no-config \
|
||||
--plugin plugins/a2a/a2a.so --script "$D/tool-cancel.txt" \
|
||||
-p "tool" --autonomous 2>&1)
|
||||
echo "$out" | grep -q '^done'
|
||||
check test $? -eq 0
|
||||
sess=$(ls -t "$D/home/.splinter"/sess-*.jsonl 2>/dev/null | head -1)
|
||||
check grep -q -- '-32002' "$sess"
|
||||
|
||||
if [ "$fails" -eq 0 ]; then echo "test_a2a: ok"; exit 0; fi
|
||||
exit 1
|
||||
@@ -77,6 +77,8 @@ id=$(printf '%s' "$resp" | python3 -c \
|
||||
resp2=$(post "$P" "{\"jsonrpc\":\"2.0\",\"id\":\"2\",\"method\":\"GetTask\",\"params\":{\"id\":\"$id\"}}")
|
||||
echo "$resp2" | grep -q 'hallo von splinter'
|
||||
check test $? -eq 0
|
||||
echo "$resp2" | grep -q '"result":{"id":"task-'
|
||||
check test $? -eq 0
|
||||
|
||||
# streaming: SSE with an artifact and a completed status
|
||||
resp3=$(post "$P" "{\"jsonrpc\":\"2.0\",\"id\":\"3\",\"method\":\"SendStreamingMessage\",\"params\":{\"message\":{\"messageId\":\"m\",\"role\":\"ROLE_USER\",\"parts\":[{\"text\":\"hallo\"}]}}}")
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ def counts():
|
||||
tools = set()
|
||||
for p in (list((ROOT / "src").glob("*.c")) +
|
||||
list((ROOT / "plugins").glob("*/*.c"))):
|
||||
tools.update(re.findall(r'\.name = "([a-z_]+)"',
|
||||
tools.update(re.findall(r'\.name = "([a-z0-9_]+)"',
|
||||
p.read_text(encoding="utf-8")))
|
||||
return {
|
||||
"N_LINES": (_c_lines(ROOT / "src") + _c_lines(ROOT / "include") +
|
||||
|
||||
Reference in new issue
Block a user