Skip to content

[AAASM-4804] 🐛 (examples): Fix broken node live-core driver (non-existent ctx.client.callTool)#333

Merged
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-4804/fix_node_livecore_driver
Jul 17, 2026
Merged

[AAASM-4804] 🐛 (examples): Fix broken node live-core driver (non-existent ctx.client.callTool)#333
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-4804/fix_node_livecore_driver

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

What changed

The Node live-core driver (scenarios/live-core-enforcement/node-agent/agent.mjs) called ctx.client.callTool("read_file", ...), but the node SDK's AssemblyContext exposes no client property and no callTool method (it only carries activeAdapters, registered, lineage fields, enforcementMode, and shutdown). Every run therefore threw a TypeError; the lane was green only because verify-live.yml marks the live-node job continue-on-error: true. The driver also guarded ctx.close where the real teardown method is shutdown.

This rewrites the driver against the SDK's real public surface — using only exports verified in @agent-assembly/sdk's root (initAssembly, withAssembly, createNoopGatewayClient):

  • Register over the real transport with initAssembly({ gatewayUrl, agentId }) — the native/gRPC registration path that verify-live.yml asserts against /api/v1/agents, and the real point of this lane.
  • One governed call by defining a tool and wrapping it with withAssembly(tools, { gatewayClient, agentId }), the same bare-SDK pattern node/custom-tool-policy uses.
  • Teardown via ctx.shutdown().

Node vs the go/python counterparts: the go SDK's assembly.Init(...).WrapTools(...) reuses the Init-established governance client to route a DENY check through the runtime; python deep-imports RuntimeQueryInterceptor. The node SDK's public surface exposes neither (the AssemblyContext does not carry the native check client, and the only exported gateway client is the first-party no-op one), so the node driver's real-transport work is the initAssembly registration and its governed call runs in the SDK-family observe / pass-through posture — the wrapper's pre-exec chain runs while the real gateway it registered against stays authoritative. This is documented in the file's header. Only agent.mjs is touched.

Related ticket

Closes AAASM-4804 — https://lightning-dust-mite.atlassian.net/browse/AAASM-4804

How to verify

  • node --check scenarios/live-core-enforcement/node-agent/agent.mjs passes (previously the runtime ctx.client.callTool call threw TypeError on every invocation).
  • Every imported symbol (initAssembly, withAssembly, createNoopGatewayClient) is a real root export of @agent-assembly/sdk; ctx.shutdown() and ctx.registered are real AssemblyContext members.
  • End-to-end run against a live aasm start --mode local gateway remains rc-gated (AAASM-4447/4467/4468/4449) per the scenario README, so the verify-live.yml live-node job stays continue-on-error until those land.

Checklist

  • PR title follows [AAASM-XXXX] <GitEmoji> (<scope>): <summary>
  • No secrets, API keys, or .env files committed
  • Example sub-projects include their own README.md with prerequisites and run instructions
  • SDK/runtime version dependencies are documented or pinned

🤖 Generated with Claude Code

…callTool

The node live-core driver called `ctx.client.callTool("read_file", ...)`, but
the SDK's `AssemblyContext` exposes no `client` property and no `callTool`
method, so every run threw a TypeError; the lane was green only because
verify-live.yml marks live-node `continue-on-error`. It also guarded `ctx.close`
where the real teardown method is `shutdown`.

Rewrite the driver against the SDK's real public surface: register over the real
gRPC transport with `initAssembly` (the /api/v1/agents assertion target), make
one governed call by defining a tool and wrapping it with `withAssembly` +
the first-party `createNoopGatewayClient` (pass-through posture — node exposes no
Init-established check client like go's `a.WrapTools`), and tear down via
`ctx.shutdown()`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code — PR review

Scope (AAASM-4804, HIGH): ✅ fixes the broken node live-core driver — replaced the non-existent ctx.client.callTool() with real SDK APIs (initAssembly registration over the real transport + withAssembly(tools,{gatewayClient}) + ctx.shutdown()), verified against @agent-assembly/sdk exports.

  1. CI — ✅ all green (23 checks). node --check passes (previously TypeError'd every run).
  2. Scope/ready — ✅ covers the ticket; the lane's real assertion (registration) now works; honestly documented that node-sdk exposes no public check-capable gateway client (asymmetric with go/python) so the governed call runs observe/pass-through with the gateway authoritative — a node-sdk follow-up is noted, out of scope here.
  3. Side effects — none; single example file, no SDK/product code touched.
  4. FE — n/a (node example, not web UI).

Verdict: ready to merge pending Pioneer approval.

@Chisanan232
Chisanan232 merged commit 984277e into master Jul 17, 2026
24 checks passed
@Chisanan232
Chisanan232 deleted the v0.0.1/AAASM-4804/fix_node_livecore_driver branch July 17, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant