G C-1 (TS): a bundle reads its tool runner's capability words once and names a word not stated

mesh/capabilities answered {words}, an unknown call read as none, the node from MESH_NODE; the finding writer's bundle
transport requires finding-calls; a runtime refusal keeps its code.

Builds: design 47 G §576, §622, §488
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 21:47:03 +01:00
parent 58bbc26219
commit 36974cddf9
5 changed files with 77 additions and 5 deletions
+2 -2
View File
@@ -230,11 +230,11 @@ function startSession(): Session {
continue; // not framed; nobody to answer
}
// The runtime's answer to something this bundle asked.
const reply = request as unknown as { id?: string; method?: string; result?: unknown; error?: { message?: string } };
const reply = request as unknown as { id?: string; method?: string; result?: unknown; error?: { message?: string; code?: number } };
if (reply.method === undefined && typeof reply.id === "string" && awaiting.has(reply.id)) {
const waiting = awaiting.get(reply.id)!;
awaiting.delete(reply.id);
if (reply.error) waiting.reject(new Error(reply.error.message ?? "the runtime refused"));
if (reply.error) waiting.reject(Object.assign(new Error(reply.error.message ?? "the runtime refused"), { code: reply.error.code }));
else waiting.resolve(reply.result);
continue;
}