Skip to content

[AAASM-4807] 📝 (examples): Fix real-integration snippets to use existing SDK APIs#332

Merged
Chisanan232 merged 2 commits into
masterfrom
v0.0.1/AAASM-4807/fix_realintegration_snippets
Jul 17, 2026
Merged

[AAASM-4807] 📝 (examples): Fix real-integration snippets to use existing SDK APIs#332
Chisanan232 merged 2 commits into
masterfrom
v0.0.1/AAASM-4807/fix_realintegration_snippets

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

What changed

The sidecar-runtime scenario's snippets labeled "real integration" taught a
non-existent SDK API in both languages: ctx.client.call_tool("read_file", path=...)
(Python) and ctx.client.callTool(...) (Node). Neither exists — the Python
GatewayClient has no call_tool (its dispatch method is the async
dispatch_tool(tool_name, args: dict)), and the Node AssemblyContext has no
client at all (tool governance is withAssembly(tools, { gatewayClient })).

This corrects both snippets (in README.md and the node agent's comments) to the
actual published SDK surface, verified against the sibling python-sdk /
node-sdk sources:

  • Pythoninit_assembly() registers the agent and wires the framework
    adapter, 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": ...}).
  • NodewithAssembly(tools, { gatewayClient, agentId }) wraps each tool's
    execute() with a pre-execution check that throws PolicyViolationError on 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.js passes.
  • Each corrected API exists in the SDK sources: withAssembly /
    PolicyViolationError (node-sdk/src/index.ts), the { gatewayClient, agentId }
    options (node-sdk/src/wrappers/with-assembly.ts), init_assembly +
    AssemblyContext.client + async dispatch_tool (python-sdk/agent_assembly/).

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

Chisanan232 and others added 2 commits July 18, 2026 06:51
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>
@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code — PR review

Scope (AAASM-4807, MED): ✅ corrected the 'real integration' snippets that taught a non-existent ctx.client.call_tool/callTool in both SDKs → real ctx.client.dispatch_tool(name, {dict}) (python) and withAssembly(tools,{gatewayClient,agentId}) throwing PolicyViolationError (node), every symbol grep-verified against SDK sources.

  1. CI — ✅ all green (24). node --check passes.
  2. Scope/ready — ✅ two in-scope files only; offline shims untouched; disjoint from [AAASM-4804] 🐛 (examples): Fix broken node live-core driver (non-existent ctx.client.callTool) #333.
  3. Side effects — none (docs/comments only).
  4. FE — n/a.

Verdict: ready to merge pending Pioneer approval.

@Chisanan232
Chisanan232 merged commit 17a68e5 into master Jul 17, 2026
25 checks passed
@Chisanan232
Chisanan232 deleted the v0.0.1/AAASM-4807/fix_realintegration_snippets 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