Skip to content

McpServer.cfc uses DirectoryCreate() with two arguments, which is incompatible with Adobe ColdFusion #2618

Closed

Description

@zainforbjs

Describe the bug
In vendor/wheels/public/mcp/McpServer.cfc, DirectoryCreate() is called with two arguments. This works in Lucee, but Adobe ColdFusion only supports the single-argument form of DirectoryCreate().

To Reproduce
Steps to reproduce the behavior:

  1. Run a wheels application.
  2. Go to vendor/wheels/public/mcp/McpServer.cfc.
  3. Observe directoryCreate(local.fullTargetDir, true) at line 115

Expected behavior
Framework code should be compatible with both Lucee and Adobe Coldfusion.

Screenshots
Image

Desktop:

  • OS: Any

Activity

  1. wheels-bot commented on May 12, 2026

    @wheels-bot
    Contributor

    Wheels Bot — Triage

    Classified as bug.

    Suspected layer

    controller — see .ai/wheels/cross-engine-compatibility.md for canonical patterns (this is a Lucee-vs-Adobe-CF compatibility issue in an HTTP request handler under vendor/wheels/public/mcp/).

    Fix sketch

    Edit vendor/wheels/public/mcp/McpServer.cfc line 1115 to drop the two-argument form of directoryCreate(). The call site wants "create the target directory and any missing parents" — on Lucee that's expressed via the second createPath=true argument, but Adobe CF rejects it. The portable shape is to walk the path manually (loop over parents, directoryCreate(parent) if \!directoryExists(parent)) or call directoryCreate(local.fullTargetDir) after ensuring parents exist. Confirm there are no other directoryCreate(..., true) call sites in vendor/wheels/** while in the area (a quick grep at fix time).

    Confidence: `medium`

    Cross-engine concern (Lucee vs Adobe CF behavior differs) — auto-downgrade rule fires, capping confidence at medium even though the file/line are identified and the fix is small.

    <!-- wheels-bot:triage:2618 -->
    <!-- wheels-bot:triage-class:bug -->

  2. bpamiri commented on May 13, 2026

    @bpamiri
    Collaborator

    Thanks for the careful report, @zainforbjs — this was fixed earlier today as part of #2616, which addressed both BrowserTest.cfc (the call site flagged in #2614) and this McpServer.cfc call site in a single change. The fix is on develop as of commit 7cdb036.

    The call site you cited now reads:

    if (!directoryExists(local.fullTargetDir)) {
        // Adobe CF rejects directoryCreate(path, true) — see #2614. Use mkdirs() instead.
        local.created = createObject("java", "java.io.File").init(local.fullTargetDir).mkdirs();
        if (!local.created && !directoryExists(local.fullTargetDir)) {
            throw(type="Wheels.Mcp.TestDir", message="Could not create test directory '#local.fullTargetDir#'.");
        }
    }

    Routing through java.io.File.mkdirs() is the canonical workaround used elsewhere in the framework (e.g. services/packages/ManifestCache.cfc::$ensureDir) and behaves identically on Lucee, Adobe CF, and BoxLang.

    I also re-grepped vendor/wheels/** for any other two-argument directoryCreate() call sites and found none — only the three references in comments / regression spec labels that document the fix. Closing as resolved; please reopen if you hit a related case the audit missed.

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