Skip to content

feat: add overwrite_cache parameter to run_task#6

Open
rbavery wants to merge 2 commits intomainfrom
feat/run-task-overwrite-cache
Open

feat: add overwrite_cache parameter to run_task#6
rbavery wants to merge 2 commits intomainfrom
feat/run-task-overwrite-cache

Conversation

@rbavery
Copy link
Copy Markdown
Member

@rbavery rbavery commented Apr 6, 2026

Summary

  • Adds overwrite_cache: bool = False parameter to the run_task MCP tool, threaded through run_remote_task to flyte.with_runcontext(overwrite_cache=...).
  • When true, Flyte ignores cached results and forces re-execution, storing new outputs in cache.
  • Tests updated to verify the parameter is forwarded correctly (defaults to false, passes true when set).

Why

I'd like to run a task to get accurate timing. I think Union may cache images that have been pulled so the first execution is slower than a subsequent execution with cache=False. Could probably be useful in other scenarios.

Test plan

  • uv run pytest tests/unit/tools/test_tasks.py — all 13 tests pass
  • Manual: call run_task with overwrite_cache=true against a cached task and verify re-execution

rbavery added 2 commits April 6, 2026 16:17
Allow callers to bypass Flyte's cached results and force re-execution
by passing overwrite_cache=true to the run_task MCP tool.
@rbavery rbavery marked this pull request as ready for review April 6, 2026 23:39
@rbavery rbavery requested a review from ljstrnadiii April 6, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant