What
Define the expected behavior when run is called multiple times with different context options.
Goal
Establish clear semantics for how context and caching interact:
- When should cached results be reused?
- When should a new context trigger re-execution?
- How should empty context (
{}) vs. no context (nil) be handled?
The behavior should be intuitive and predictable for users.
Approach
- Analyze current behavior where new context is silently ignored if one exists
- Design clear rules for when context changes should trigger cache invalidation
- Consider distinguishing between "no context argument" (use cache), "empty context" (ambiguous), and "new context values" (re-execute)
- Document the chosen behavior clearly