Copy the kept call's ask id from its request header into the call's _meta as mesh/ask

Every tool call and seat verb the tool runner serves hands the bundle the ask id the kept call set
in the header x-ask (stdio.AskHeader) under _meta mesh/ask (stdio.MetaAsk), beside mesh/call; a call
whose header carries none names none.

Builds: design 47 H2 §775, H-A-351
This commit is contained in:
2026-11-21 23:14:53 +01:00
parent f7269d9812
commit 2365e41811
9 changed files with 87 additions and 27 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
# A tools bundle that says who the runtime said called it (novox/hq issue 365): MCP over stdio, no SDK. Its tool
# and its seat verb answer the caller the call's `_meta` named — "" when it named none —, the id of the call in flight
# it named (novox/hq ADR 0597 §7), and the arguments as given.
# it named (novox/hq ADR 0597 §7), the ask id it named under mesh/ask — null when it named none (design 47 H2 §775, H-A-351) —,
# and the arguments as given.
import json, sys
def say(m):
@@ -19,7 +20,7 @@ for line in sys.stdin:
say({"id": rid, "result": {"tools": TOOLS}})
elif m == "tools/call":
meta = p.get("_meta") or {}
said = {"caller": meta.get("mesh/caller", ""), "call": meta.get("mesh/call", ""), "arguments": p.get("arguments") or {}}
said = {"caller": meta.get("mesh/caller", ""), "call": meta.get("mesh/call", ""), "ask": meta.get("mesh/ask"), "arguments": p.get("arguments") or {}}
say({"id": rid, "result": {"content": [{"type": "text", "text": json.dumps(said)}]}})
elif rid is not None:
say({"id": rid, "result": {}})