[AAASM-4804] 🐛 (examples): Fix broken node live-core driver (non-existent ctx.client.callTool)#333
Merged
Conversation
…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>
|
Contributor
Author
🤖 Claude Code — PR reviewScope (AAASM-4804, HIGH): ✅ fixes the broken node live-core driver — replaced the non-existent
Verdict: ready to merge pending Pioneer approval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
The Node live-core driver (
scenarios/live-core-enforcement/node-agent/agent.mjs) calledctx.client.callTool("read_file", ...), but the node SDK'sAssemblyContextexposes noclientproperty and nocallToolmethod (it only carriesactiveAdapters,registered, lineage fields,enforcementMode, andshutdown). Every run therefore threw aTypeError; the lane was green only becauseverify-live.ymlmarks thelive-nodejobcontinue-on-error: true. The driver also guardedctx.closewhere the real teardown method isshutdown.This rewrites the driver against the SDK's real public surface — using only exports verified in
@agent-assembly/sdk's root (initAssembly,withAssembly,createNoopGatewayClient):initAssembly({ gatewayUrl, agentId })— the native/gRPC registration path thatverify-live.ymlasserts against/api/v1/agents, and the real point of this lane.withAssembly(tools, { gatewayClient, agentId }), the same bare-SDK patternnode/custom-tool-policyuses.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-importsRuntimeQueryInterceptor. The node SDK's public surface exposes neither (theAssemblyContextdoes 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 theinitAssemblyregistration 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. Onlyagent.mjsis 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.mjspasses (previously the runtimectx.client.callToolcall threwTypeErroron every invocation).initAssembly,withAssembly,createNoopGatewayClient) is a real root export of@agent-assembly/sdk;ctx.shutdown()andctx.registeredare realAssemblyContextmembers.aasm start --mode localgateway remains rc-gated (AAASM-4447/4467/4468/4449) per the scenario README, so theverify-live.ymllive-nodejob stayscontinue-on-erroruntil those land.Checklist
[AAASM-XXXX] <GitEmoji> (<scope>): <summary>.envfiles committedREADME.mdwith prerequisites and run instructions🤖 Generated with Claude Code