[AAASM-4807] 📝 (examples): Fix real-integration snippets to use existing SDK APIs#332
Merged
Chisanan232 merged 2 commits intoJul 17, 2026
Merged
Conversation
The Python and Node real-integration snippets taught a non-existent
ctx.client.call_tool / callTool API. Correct them to the published SDK
surface: Python's async dispatch_tool(name, args_dict) plus the runtime
interceptor path, and Node's withAssembly(tools, { gatewayClient }) with a
governed tool.execute() that throws PolicyViolationError on deny. Also stop
claiming the offline stand-in mirrors the exact SDK method names.
Refs AAASM-4807
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The node-agent header and shim comments taught ctx.client.callTool, which
the Node SDK does not expose. Correct the real-integration block to the
published withAssembly(tools, { gatewayClient }) + tool.execute() surface
(deny throws PolicyViolationError), and relabel the offline shim as a
teaching stand-in rather than the exact SDK surface. Comment-only; no
runtime behavior change.
Refs AAASM-4807
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Contributor
Author
🤖 Claude Code — PR reviewScope (AAASM-4807, MED): ✅ corrected the 'real integration' snippets that taught a 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
sidecar-runtimescenario's snippets labeled "real integration" taught anon-existent SDK API in both languages:
ctx.client.call_tool("read_file", path=...)(Python) and
ctx.client.callTool(...)(Node). Neither exists — the PythonGatewayClienthas nocall_tool(its dispatch method is the asyncdispatch_tool(tool_name, args: dict)), and the NodeAssemblyContexthas noclientat all (tool governance iswithAssembly(tools, { gatewayClient })).This corrects both snippets (in
README.mdand the node agent's comments) to theactual published SDK surface, verified against the sibling
python-sdk/node-sdksources:init_assembly()registers the agent and wires the frameworkadapter, which governs each call via the runtime interceptor (
check_tool_start);the direct client path is the async
ctx.client.dispatch_tool("read_file", {"path": ...}).withAssembly(tools, { gatewayClient, agentId })wraps each tool'sexecute()with a pre-execution check that throwsPolicyViolationErroron deny.The offline stand-in shims are left functionally untouched, but their comments no
longer claim to mirror the exact SDK method names — they are relabeled as
teaching stand-ins pointing at the real API.
Related ticket
Closes AAASM-4807
Jira: https://lightning-dust-mite.atlassian.net/browse/AAASM-4807
How to verify
node --check scenarios/sidecar-runtime/examples/node-agent/agent.jspasses.withAssembly/PolicyViolationError(node-sdk/src/index.ts), the{ gatewayClient, agentId }options (
node-sdk/src/wrappers/with-assembly.ts),init_assembly+AssemblyContext.client+ asyncdispatch_tool(python-sdk/agent_assembly/).Checklist
[AAASM-XXXX] <GitEmoji> (<scope>): <summary>.envfiles committedREADME.mdwith prerequisites and run instructions