Custom Cache Detection Prompts let you override the default cache-detection context for a specific recorded step. When set, Cyberdesk still compares the cached state (Desktop #1) with the current state (Desktop #2), but your instructions become the rules the model should use for whether the recorded action would still replay successfully.Documentation Index
Fetch the complete documentation index at: https://docs.cyberdesk.io/llms.txt
Use this file to discover all available pages before exploring further.
For an introduction to trajectories and how they work, see Trajectories 101. This page focuses specifically on custom cache detection prompts that give you full control over trajectory validation.
The Problem
During trajectory replay, the system compares current screen states against cached screenshots to determine if it can safely reuse recorded actions. However, the default cache detection logic might not always know:- Which UI elements are critical vs. cosmetic for a specific step
- What minor differences are acceptable (e.g., timestamps, dynamic content)
- Special conditions that should invalidate the cache
- Context about why a particular screen state was captured
- Reject valid matches due to irrelevant differences (false negatives)
- Accept invalid matches by missing critical changes (false positives)
- Require human review to understand failures
The Solution
Custom Cache Detection Prompts give you full control over the validation logic. When you set a custom prompt:- Default-context override: Your prompt replaces the standard workflow and step context Cyberdesk normally uses for cache detection
- Step-specific: Each eligible recorded trajectory step can have its own custom prompt
- Human-written: Provide exact validation criteria that automated systems can’t infer
- Direct Control: You define exactly what constitutes a cache hit vs miss for that recorded action
How It Works
During Cache Detection
When comparing screen states with a custom prompt:- Capture: System takes a screenshot of the current state (Desktop #2)
- Load Cache: Retrieves the cached screenshot from the trajectory (Desktop #1)
- Prompt Framing: Cyberdesk wraps your instructions in a short action-replay prompt instead of the normal default context
- Decision: The system evaluates and returns cache hit or cache miss
In the Trajectory Editor
You can add or edit custom prompts in the trajectory viewer for recorded steps that have a pre-check snapshot:- Navigate to a trajectory in the Workflows section
- Expand a recorded step to view details
- Find the
Custom Cache Detection Prompt Overridefield in the pre-check snapshot area - Add your prompt with explicit hit/miss criteria
- Save changes to update the trajectory
end_loop_iteration do not run cache detection.
You can also open a cache comparison in run history, click Improve Cache Detection, and save the same override back to the underlying trajectory step.
Example Use Cases
Since your custom prompt replaces the default context for that step, you must be explicit about what defines a cache hit vs miss.Validating Critical Elements
Checking Layout Structure
Focus Area Validation
Conditional States
Form Validation
Best Practices
Always Define Both Outcomes
Since you’re replacing the default cache-detection context, explicitly state both when it’s a cache hit and when it’s a cache miss. Good: “Cache hit if the dialog is visible. Cache miss if it’s not visible or obscured.” Less Good: “The dialog should be visible”Be Specific About What to Check
Good: “Cache hit if three buttons are arranged horizontally at the bottom of the form.” Less Good: “Check the buttons are correct”Explicitly State What to Ignore
Good: “Ignore timestamps, ‘Last Updated’ labels, and dynamic content. Focus only on the form structure.” Less Good: Assuming the system knows what to ignoreConsider Parameter Variations
Good: “The username field will contain different values based on parameters - ignore the actual text, just verify the field exists.” Less Good: “Username should be John”Handle Edge Cases
Good: “Cache hit if either the success modal OR the results table is visible. Cache miss if neither is present.” Less Good: “Something might be wrong”Keep It Clear
Aim for clear, unambiguous criteria. Remember: your prompt replaces Cyberdesk’s default cache-detection context for this step.When to Use Custom Prompts
Consider adding a custom prompt when:- A step frequently has false positives or negatives
- The validation criteria are subtle or nuanced
- Dynamic content makes default comparison unreliable
- You’ve observed specific failure patterns
- The step is critical to workflow success
- You need precise control over what defines a match
Technical Details
Data Storage
Custom prompts are stored in thepre_check_snapshot object of each trajectory step: