Skip to content

feat(tools): support the LLM Prompt node on explicit user request - #42

Open
David Scheier (dshire) wants to merge 5 commits into
mainfrom
feat/llm-prompt-node
Open

feat(tools): support the LLM Prompt node on explicit user request#42
David Scheier (dshire) wants to merge 5 commits into
mainfrom
feat/llm-prompt-node

Conversation

@dshire

Copy link
Copy Markdown
Member

Summary

  • Add support for Cognigy's LLM Prompt node (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 API
  • The AI Agent node stays the only default: every LLM-facing description (tool definitions, always-on instructions, skills) states the LLM Prompt node is used solely when the user explicitly asks for it by name — never offered, never suggested, never a fallback
  • Flows driven by an LLM Prompt node have no agent resource, so create_tool / update_tool / delete_resource / list_resources now accept flowId as the addressing alternative to aiAgentId (which is unchanged for normal agents)
  • Harden LLM auto-assignment for the new mode: prefer a connected, non-embedding model — a connectionless LLM fails silently under the node's default errorHandling: "continue" with an empty message, which presents as an empty agent response

Changes

File / Component Description
src/tools/nodeRegistry.ts New llmPrompt registry entry (type llmPromptV2, @cognigy/basic-nodes, requires config.prompt) with explicit-request-only steering in its summary
src/tools/handlers.ts create_ai_agent { agentNodeType: "llmPrompt", systemPrompt } provisions project + flow + llmPromptV2 node + REST endpoint without an /v2.0/aiagents resource; removes the backend's placeholder unlock_account tool; tool handlers resolve flows via aiAgentId or flowId and parent tools on aiAgentJob first, else llmPromptV2; knowledge/send_email rejected under LLM Prompt (descriptors don't exist there); llmPromptTool joins the appendChild→append rewrite set; manage_flow_nodes create of an llmPromptV2 cleans up its placeholder tool
src/schemas/tools.ts agentNodeType/systemPrompt on create_ai_agent (with a refine rejecting knowledgeStoreReferenceId in llmPrompt mode); aiAgentId-or-flowId refines on create_tool/update_tool; flowId on delete_resource/list_resources
src/tools/definitions.ts LLM-facing contract updates with defensive steering language ("ONLY when the user explicitly asked… never offer, suggest, or fall back")
src/instructions.ts One always-on hard rule: AI Agent node is always the default; llmPrompt only on explicit request; flowId addressing for those flows
plugin/skills/flow-nodes/SKILL.md LLM Prompt exception to the "no top-level nodes" rule + full config reference (verified against a live node), incl. the freeform-prompt caveat: persona, job, and guardrails all live in one prompt
plugin/skills/tools-setup/SKILL.md flowId addressing section for tools under an LLM Prompt node
plugin/skills/agent-creation/SKILL.md Explicit-request-only section for building an agent on an LLM Prompt node
plugin/skills/troubleshooting/SKILL.md Two verified empty-response causes: endpoint-config propagation + per-session caching right after creation, and connectionless LLMs failing silently
src/__tests__/llmPromptNode.test.ts New suite (16 tests): llmPrompt provisioning, placeholder cleanup, connected-LLM preference, rollback, flowId-addressed tool CRUD, parent preference when both node types exist, registry create + cleanup

Hard-won details from live verification (Meridian (Test) tenant, all scratch resources deleted): the backend auto-creates a non-deletable llmPromptDefault branch plus a placeholder unlock_account tool under every new llmPromptV2; the resolve descriptors are shared (aiAgentToolAnswer, aiAgentJobCallMCPToolllmPromptCallMCPTool does not exist); end-to-end flow answered as prompted over the REST endpoint after the connected-LLM fix.

No breaking changes: aiAgentId remains required-by-refine when flowId is 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

Copilot AI lite review requested due to automatic review settings September 2, 2026 09:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T09:29:46.097809Z db22d32 PR opened
ℹ️ About Codex in GitHub

Your 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 llmPromptV2 to the node registry and extend tool/handler logic to support LLM Prompt–parented tool nodes.
  • Allow tool operations to target flows via aiAgentId or flowId, 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 flowId tool 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.

Comment thread src/schemas/tools.ts Outdated
Comment thread src/tools/handlers.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/tools/handlers.ts Outdated
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>
- 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.
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.

2 participants