feat(tools): support the LLM Prompt node on explicit user request - #42
feat(tools): support the LLM Prompt node on explicit user request#42David Scheier (dshire) wants to merge 5 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Pull request overview
Adds explicit opt-in support for Cognigy’s LLM Prompt node (llmPromptV2) across the plugin’s tool surface, while preserving the AI Agent node as the only default. This introduces flowId-based addressing for tool CRUD in flows that have no /v2.0/aiagents resource (LLM Prompt–driven flows), and hardens LLM selection for that mode.
Changes:
- Add
llmPromptV2to the node registry and extend tool/handler logic to support LLM Prompt–parented tool nodes. - Allow tool operations to target flows via
aiAgentIdorflowId, with explicit restrictions for unsupported tool descriptors under LLM Prompt. - Add a dedicated test suite for llmPrompt provisioning, placeholder cleanup, connected-LLM preference, rollback, and
flowIdtool management.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tools/nodeRegistry.ts | Registers llmPromptV2 as an explicit-request-only node type with required prompt config. |
| src/tools/handlers.ts | Implements create_ai_agent llmPrompt mode, flowId tool addressing, and LLM Prompt tool parenting/cleanup logic. |
| src/tools/definitions.ts | Updates tool contracts and steering language for explicit-request-only behavior and flowId addressing. |
| src/schemas/tools.ts | Extends schemas for agentNodeType/systemPrompt and adds flowId to relevant tool operations. |
| src/instructions.ts | Adds always-on rule enforcing AI Agent default and LLM Prompt explicit opt-in only. |
| src/tests/tools.test.ts | Updates expected error messaging for tool listing requirements. |
| src/tests/llmPromptNode.test.ts | Adds comprehensive test coverage for llmPrompt mode and flowId tool CRUD. |
| plugin/skills/troubleshooting/SKILL.md | Documents empty-response causes including endpoint propagation and connectionless LLMs in llmPrompt flows. |
| plugin/skills/tools-setup/SKILL.md | Documents tool CRUD via flowId for llmPrompt flows. |
| plugin/skills/flow-nodes/SKILL.md | Documents llmPrompt node exception, config reference, and explicit-request-only rules. |
| plugin/skills/agent-creation/SKILL.md | Documents creating agents via llmPrompt only on explicit user request and how to iterate thereafter. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db22d32341
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Adds llmPromptV2 support across the tool surface, verified against the
live chart API. The AI Agent node stays the only default — every
LLM-facing description states the node is used solely when the user
explicitly asks for an LLM Prompt node, never offered or fallen back to.
- nodeRegistry: llmPrompt entry (type llmPromptV2, requires config.prompt)
- create_ai_agent { agentNodeType: "llmPrompt", systemPrompt }: provisions
project + flow + llmPromptV2 node + REST endpoint with NO agent resource;
auto-assigns a connected, non-embedding LLM (a connectionless LLM fails
silently under the node's default "continue" error handling); removes the
backend's placeholder unlock_account tool (llmPromptDefault is not
deletable)
- create_tool / update_tool / delete_resource / list_resources accept
flowId as the addressing alternative for LLM Prompt flows; tools parent
on aiAgentJob when present, else llmPromptV2 (llmPromptTool /
llmPromptMCPTool children; knowledge/send_email rejected there); the
shared resolve descriptors (aiAgentToolAnswer, aiAgentJobCallMCPTool)
work in both branches
- manage_flow_nodes: llmPromptTool joins the appendChild rewrite set;
creating an llmPromptV2 cleans up its placeholder tool
- skills: flow-nodes carve-out + full config reference, tools-setup flowId
addressing, agent-creation explicit-only section, troubleshooting notes
on endpoint propagation/session caching and connectionless LLMs
- instructions: always-on hard rule (explicit request only)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
db22d32 to
ebc05b3
Compare
- share one placeholder-tool cleanup helper across create_ai_agent (both node types) and manage_flow_nodes create; scope it to the parent node, read the chart with the flow locale, keep the node-list fallback - report the real failed step in createLlmPromptAgent rollback - rollback hints and backup-gate text address flowId-only flows - map llmPromptMCPTool back to toolType mcp on duplicate-tool reuse - render llmPromptV2 as an agent node in flow diagrams - add schema tests for agentNodeType/systemPrompt and flowId addressing
- warn when the auto-assigned LLM has no connection (llmConnected: false) - require systemPrompt/description in llmPrompt mode; reject systemPrompt elsewhere - update_tool refuses knowledge/send_email config on LLM Prompt tool nodes - create_tool takes parentNodeId, refuses to guess between several tool parents, scopes the duplicate-toolId check to the chosen parent, and list_resources tools carry parentNodeId - reject aiAgentId and flowId passed together - share project/flow/endpoint provisioning, rollback and LLM selection between the AI Agent and LLM Prompt create paths - derive the LLM Prompt tool-type rejection from the descriptor map - list_resources description mentions flowId for tools
- create_ai_agent: a blank systemPrompt no longer beats description; the aiAgentJob path now reports llmConnected: false with a warning when the auto-assigned LLM has no connection - create_tool: prefer the aiAgentJob node over llmPromptV2 as documented; with several aiAgentJob nodes pick the one bound to the addressed agent, refuse only when the preferred type is still ambiguous - reject aiAgentId + flowId at the schema level so the backup gate is not consumed by a call that cannot run; document "never pass both" - removePlaceholderTools: bail without a parent id, compare parent as string or object - delete_resource: refuse to delete the auto-created *Default branches - report step "node" only after the entry node lookup succeeded - keep the always-on LLM Prompt rule in instructions.ts terse
…t refs - pickDefaultLlm no longer falls back to embedding models; an embedding-only project now yields llmStatus "unknown" plus the LLM setup guidance instead of wiring a model that cannot answer. - Add nodeParentId() to read a node's parent from every API shape (parentId, parent_id, string parent, object parent._id/id) and use it in create_tool duplicate detection, list_resources tool listing, the placeholder cleanup and manage_flow_nodes create. - Regression tests for embedding-only projects on both create paths, object-parent duplicate reuse, and parentNodeId normalization.
Summary
llmPromptV2) across the tool surface — creating, reading, updating, and deleting the node, plus full tool support (llmPromptTool/llmPromptMCPTool) under it, all verified against the live chart APIcreate_tool/update_tool/delete_resource/list_resourcesnow acceptflowIdas the addressing alternative toaiAgentId(which is unchanged for normal agents)errorHandling: "continue"with an empty message, which presents as an empty agent responseChanges
src/tools/nodeRegistry.tsllmPromptregistry entry (typellmPromptV2,@cognigy/basic-nodes, requiresconfig.prompt) with explicit-request-only steering in its summarysrc/tools/handlers.tscreate_ai_agent { agentNodeType: "llmPrompt", systemPrompt }provisions project + flow + llmPromptV2 node + REST endpoint without an/v2.0/aiagentsresource; removes the backend's placeholderunlock_accounttool; tool handlers resolve flows viaaiAgentIdorflowIdand parent tools onaiAgentJobfirst, elsellmPromptV2;knowledge/send_emailrejected under LLM Prompt (descriptors don't exist there);llmPromptTooljoins the appendChild→append rewrite set;manage_flow_nodes createof an llmPromptV2 cleans up its placeholder toolsrc/schemas/tools.tsagentNodeType/systemPrompton create_ai_agent (with a refine rejectingknowledgeStoreReferenceIdin llmPrompt mode);aiAgentId-or-flowIdrefines on create_tool/update_tool;flowIdon delete_resource/list_resourcessrc/tools/definitions.tssrc/instructions.tsplugin/skills/flow-nodes/SKILL.mdplugin/skills/tools-setup/SKILL.mdplugin/skills/agent-creation/SKILL.mdplugin/skills/troubleshooting/SKILL.mdsrc/__tests__/llmPromptNode.test.tsHard-won details from live verification (Meridian (Test) tenant, all scratch resources deleted): the backend auto-creates a non-deletable
llmPromptDefaultbranch plus a placeholderunlock_accounttool under every newllmPromptV2; the resolve descriptors are shared (aiAgentToolAnswer,aiAgentJobCallMCPTool—llmPromptCallMCPTooldoes not exist); end-to-end flow answered as prompted over the REST endpoint after the connected-LLM fix.No breaking changes:
aiAgentIdremains required-by-refine whenflowIdis absent, so existing callers are unaffected.Test plan
Automated — CI runs tests and Prettier checks on every PR via
.github/workflows/pr.yml.🤖 Generated with Claude Code