Skip to content

describe_type and set_config ignore oneOf allowed values (entity_query entity_type list never reaches the agent) #41

Closed

Description

@d34dman

Problem

describe_type and get_config do not report the allowed values of a config key whose schema lists them as oneOf of {const, title}. set_config does not check a value against them either. The form UI already renders oneOf as a select (see #6), so the editor and the agent tools disagree about what a key allows.

describeConfigKey() only copies enum (libs/flowdrop/src/lib/commands/executor.ts:210), and validateConfigValue() only checks enum (executor.ts:402). Neither reads oneOf.

Where it shows

fddo's Entity Query node (entity_query) builds its entity_type choices from Drupal's entity type manager, one oneOf entry per content entity type:

"entity_type": {
  "type": "string",
  "title": "Entity Type",
  "description": "The entity type to query (node, taxonomy_term, user, etc.)",
  "oneOf": [{"const": "ai_file", "title": "AI File"}, {"const": "block_content", "title": "Content block"}, …],
  "default": "node"
}

What an agent receives from describe_type for that key is only type, title, description and default. The model sees "node, taxonomy_term, user, etc." and has to guess the rest. A guessed value such as a bundle name (article) is stored without a warning.

Expected

  • describe_type / get_config report the allowed values of a oneOf of consts, with their titles. Either add them to enum (plus the labels), or add a separate field.
  • validateConfigValue() treats a oneOf of consts like enum: a value outside it produces the same allowedValues warning, and a CONFIG_VALIDATION_ERROR in strict mode.

Notes

  • Found 2026-09-25 while preparing the DrupalCon Rotterdam talk "Why Your AI Agent Hallucinates". Verified against the live node-type API on a fddo 2.x dev site and fdnpm main at eb5e61b9.
  • Related, fddo side, not this library: in entity_query and entity_save, bundle is free text, and so is entity_save's entity_type. An agent has no list to choose from for either.

Activity

  1. d34dman commented on Oct 14, 2026

    @d34dman
    CollaboratorAuthor

    Fixed in 2.10.0 (5c073b86). describe_type lists the oneOf/anyOf const values as allowed values, and set_config validates against them, so the entity_query entity type list now reaches the agent. FlowDrop for Drupal picks this up in 2.7.0, which requires ^2.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions