Skip to content

coldbox-cache-integration skill recommends setEventCacheableEntry() with wrong arguments, causing runtime error #6

@edyionescu

Description

@edyionescu

What are the steps to reproduce this issue?

  1. Install the coldbox-cache-integration skill and ask an AI agent how to cache an event
  2. The agent reads section 6 of the skill ("Event Output Caching") and recommends calling event.setEventCacheableEntry() with named arguments:
 function index( event, rc, prc ) {
     event.setEventCacheableEntry(
         // Cache this event's output for 60 min, idle 30 min
         provider   : "template",
         timeout    : 60,
         lastAccess : 30
     );
     prc.welcomeMessage = "Welcome to ColdBox!";
     event.setView( "main/index" );
 }
  1. Enable event caching in config/ColdBox.cfc: coldbox.eventCaching = true
  2. Reinit the app: coldbox reinit
  3. Visit http://127.0.0.1:<port>

What happens?

The following error is thrown:

Required argument cacheEntry is missing for function setEventCacheableEntry

Stacktrace:

handlers\Main.bx:9
coldbox\system\web\Controller.cfc:1249
...
Application.bx:92

What were you expecting to happen?

Two problems with the skill's recommendation:

  1. Wrong arguments. The actual signature of setEventCacheableEntry takes a single required struct, not the named arguments shown in the skill.
function setEventCacheableEntry( required struct cacheEntry )
  1. Not a public API. setEventCacheableEntry() is called internally by the framework, but it doesn't seem to be intended to be called from handler actions.

The skill should be updated to show the annotation-based approach.

Any other comments?

The skill caused Claude to incorrectly dismiss the annotation syntax as "old ColdBox v3-era syntax" and replace it with the broken setEventCacheableEntry() call:

According to section 6, the correct API is event.setEventCacheableEntry() — not the cache="true" cacheTimeout="30" attributes you have on the function signature. Those action-level attributes (cache="true") are the old ColdBox v3-era syntax. The modern approach is to call event.setEventCacheableEntry() inside your action.

What versions are you using?

Operating System: Windows 11 Pro 25H2
Package Version: ColdBox 8.1.0+34, coldbox-cli 8.13.0+31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions