Skip to content

wip cache#1968

Draft
Mbeaulne wants to merge 1 commit intomasterfrom
03-19-wip_cache
Draft

wip cache#1968
Mbeaulne wants to merge 1 commit intomasterfrom
03-19-wip_cache

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 19, 2026

Description

Added cache status indicators and information throughout the pipeline execution interface. Tasks that used cached results now display a teal "Cached" badge alongside existing status indicators. The task details panel shows cache status, original completion time, and links to the source run when applicable. This enhancement helps users understand when tasks are reusing previous execution results.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

  1. Run a pipeline with caching enabled
  2. Re-run the same pipeline to trigger cached execution
  3. Verify that cached tasks display a teal "Cached" badge in the flow canvas
  4. Click on a cached task and check the execution details panel shows cache status, original completion time, and source run link
  5. Ensure the cache badge appears correctly alongside disabled cache indicators when both conditions are present

Additional Comments

The cache detection logic compares task completion time with run creation time - if a task completed before the run started, it's considered cached. The feature only activates for completed runs to avoid unnecessary API calls during active execution.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Mar 19, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=03-19-wip_cache/cf7e982`

),
enabled: isRunComplete,
staleTime: TWENTY_FOUR_HOURS_IN_MS,
refetchOnWindowFocus: false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

The URL construction here duplicates fetchContainerExecutionState from executionService.ts, which already does exactly this:

const fetchContainerExecutionState = async (
  executionId: string,
  backendUrl: string,
): Promise<GetContainerExecutionStateResponse> => {
  const url = `${backendUrl}/api/executions/${executionId}/container_state`;
  return fetchWithErrorHandling(url);
};

If the endpoint changes, there would be two places to update. Consider importing and reusing the existing function:

import { fetchContainerExecutionState } from "@/services/executionService";

// in queries:
queryFn: () => fetchContainerExecutionState(executionId, backendUrl),

Note: fetchContainerExecutionState isn't currently exported, so you'd need to add the export. Alternatively, extract the URL pattern to a shared constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant