Skip to content

add node-embedded custom tools - #77

Draft
MuJiongan wants to merge 1 commit into
mainfrom
emdash/node-create-tool-wehgy
Draft

add node-embedded custom tools#77
MuJiongan wants to merge 1 commit into
mainfrom
emdash/node-create-tool-wehgy

Conversation

@MuJiongan

Copy link
Copy Markdown
Owner

Summary

  • add a NodeTool base class that automatically registers lowercase custom tool classes embedded in each node's Python source
  • dispatch custom tools through the existing quoted-name interfaces: ctx.agent(tools=["lookup_order"]) and ctx.tools.lookup_order(...)
  • keep registries node-local so concurrently executing nodes cannot collide
  • restore embedded tools from frozen node source when continuing an agent conversation
  • document the contract and add coverage for validation, isolation, subprocess execution, tracing, and continuations

Why

The orchestrator needs to define task-specific tools within a node without adding another node field or database schema. Embedding the declaration in the existing Python source keeps workflow snapshots and import/export behavior unchanged, while node-local registration avoids process-global tool collisions.

Impact

A node can now declare a lowercase NodeTool subclass alongside run(inputs, ctx). Its class name becomes the tool name automatically. Schemas, signatures, casing, and collisions with native or MCP tools are validated when the node source loads.

Validation

  • python -m compileall -q app tests
  • full backend test suite: 339 passed
  • git diff --check

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