Skip to content

Skills: drop the node_type workaround once the DIAL Core fix is released #140

Description

@andrii-novikov

Name and Version

aidial-client 0.16.1

What is the problem this feature will solve?

The read side (#136) ships a client-side workaround for a DIAL Core bug in the skill file listing. That bug is now fixed upstream, so the workaround is dead weight — but it cannot be removed yet, because the fix is not in a released Core.

The bug (epam/ai-dial-core#1912, closed): a non-recursive listing of a skill's files reported its subfolders with nodeType: "ITEM" — the same value as the files beside them — so only the trailing / on url distinguished them.

GET /v2/metadata/skills/{bucket}/{path}/files/     # recursive=false
{
  "items": [
    { "name": "SKILL.md", "url": ".../files/SKILL.md", "nodeType": "ITEM" },
    { "name": "agents",   "url": ".../files/agents/",  "nodeType": "ITEM" }   // a directory
  ]
}

The workaround, in aidial_client/types/metadata.py: a field validator on SkillFileItem and SkillFileMetadata that derives node_type from url, so callers of this library never see the discrepancy.

The fix: epam/ai-dial-core#1914, commit 73d28e48ComplexResourceService.listFiles now builds folder entries as ResourceFolderMetadata rather than ResourceItemMetadata.

Why this is not done yet: the fix landed on development roughly four minutes after Core 0.47.1 was cut, so it is in no release. Removing the workaround now would break anyone running a released Core — subfolders would silently come back as ITEM again.

What is the feature you are proposing to solve the problem?

Once a DIAL Core release contains 73d28e48, remove the workaround and let node_type pass through exactly as Core sends it.

Steps

  1. aidial_client/types/metadata.py — delete _node_type_from_url and both PYDANTIC_V2 / v1 validator pairs on SkillFileItem and SkillFileMetadata. Drop the now-unused Any / validator / field_validator imports.
  2. Update the docstrings on SkillItem and SkillFileItem that describe the derivation.
  3. README.md — drop the note in the skills file-listing section explaining that node_type is corrected; state that a non-recursive listing distinguishes folders with node_type == "FOLDER".
  4. tests/resources/skills/ — remove the two tests covering the derivation, and update the captured non-recursive fixture so its directory entries carry "nodeType": "FOLDER".

Note on the fixture: the post-fix nodeType values were derived by reading the Core patch, not captured from a running Core. Re-capture a real non-recursive listing against a Core that contains the fix before relying on them. The folder branch copies no timestamps, so directory entries should still have no updatedAt.

Preconditions

  • A DIAL Core release containing 73d28e48 exists.
  • The client's minimum supported Core version is at or above that release, or the project accepts that older deployments lose correct node_type on this one listing.

What alternatives have you considered?

Keep the workaround indefinitely. Rejected. It is a permanent tax on a bug that no longer exists, and it makes the client rewrite data the server sends correctly — which is worse than a no-op, because it hides Core's real response from anyone debugging against it.

Remove it now, before a Core release contains the fix. Rejected. aidial-client is published to PyPI and its users run whatever Core their deployment provides. Breaking them for a fix they cannot yet have is a bad trade for deleting ~25 lines.

Replace the validator with a derived is_folder accessor that leaves node_type untouched and answers node_type == "FOLDER" or url.endswith("/"). Rejected for this issue: it would be correct against both old and new Core, but it adds public API surface to solve a problem that is disappearing on its own, and it was not what the review asked for. Worth revisiting only if the Core fix turns out not to ship.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions