mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 01:17:04 +08:00
Slash-menu references are stored inline in the plain-string prompt as
{{#<kind>:<id>[|<label>]#}} tokens (kind: skill/file/tool/cli_tool/knowledge/
human/node_output/output). Mentions are pointers into the Agent config lists;
label is a plain-text fallback only — the backend re-resolves by id. The colon
form is invisible to the legacy template parsers, so no syntax collision.
- services/agent/prompt_mentions.py: parse/expand/scrub + per-surface allowlists
+ soul/node-job resolvers (tool ids accept provider|provider_id|plugin_id
qualified aliases).
- composer_validator: enforce §2.4 allowlists at save/validate
(mention_kind_not_allowed, mention_limit_exceeded as stable message codes).
- runtime: both run-request builders expand mentions to canonical names before
sending to the agent backend; node_output expands to its reference name only
(the value stays in the Workflow context block, per design §4.2); a final
scrub pass guarantees no {{#…#}} marker ever reaches the model, while legacy
{{#context#}} / {{#a.b#}} forms pass through untouched.
Design: Confluence 490012681 §2/§4. No DB changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>