Skip to content

fix(logs): retry failed runs from failed block - #7304

Open
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
agent/retry-failed-run-from-block
Open

fix(logs): retry failed runs from failed block#7304
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
agent/retry-failed-run-from-block

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes the Logs Retry action to resolve the single unhandled terminating failure and resume from that block using the existing run-from-block executor path. Cached upstream execution state and the original workflow input are reused from the source execution.

Unsupported or ambiguous runs are blocked with a specific explanation instead of silently starting a full retry. Compacted trigger input and streamed current-workflow validation failures are surfaced instead of reporting a false start. Retry is also hidden for users without workspace edit permission.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Focused Vitest suites: 18 passed
  • Existing run-from-block executor suite: 68 passed
  • App TypeScript check
  • API validation audit
  • React Query pattern audit
  • Biome checks on changed files
  • Local browser acceptance: Start → successful upstream Function → failing Function 2; after changing only Function 2, Logs Retry completed successfully with a trace containing only Function 2 and returned the cached upstream marker

Reviewers should focus on retry-target selection for handled versus unhandled failures and the explicit unsupported-case behavior.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Browser proof will be attached in a separate PR comment.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 31, 2026 9:25pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes failed-run retry to identify the sole unhandled terminating block and resume execution from that block using cached upstream state and the original workflow input.

  • Rejects ambiguous, nested, or insufficient execution histories with explicit errors.
  • Consumes streamed execution events until the selected block starts and surfaces validation failures.
  • Restricts retry controls to users with workspace edit permission.
  • Adds focused tests for target resolution, streamed errors, unsupported runs, and permission-based visibility.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/hooks/queries/logs.ts The retry mutation now loads source execution state, starts run-from-block execution, and consumes streamed events until the selected block starts or an error terminates the attempt.
apps/sim/lib/logs/retry.ts The new resolver selects one top-level unhandled failure and rejects execution histories that cannot be retried safely.
apps/sim/app/workspace/[workspaceId]/logs/logs.tsx Retry actions now respect workspace edit permission and surface specific mutation errors.
apps/sim/hooks/queries/logs.test.tsx Tests cover successful run-from-block requests, streamed validation failures, premature completion, and ambiguous failures.
apps/sim/lib/logs/retry.test.ts Tests cover handled errors, trigger failures, missing history, multiple failures, nested groups, and unavailable trigger input.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant L as Logs UI
  participant D as Log detail API
  participant E as Workflow executor
  U->>L: Retry failed execution
  L->>D: Load source execution detail
  D-->>L: Trace spans and workflow input
  L->>L: Resolve sole unhandled failed block
  alt Unsupported or ambiguous trace
    L-->>U: Show specific retry error
  else Retry target resolved
    L->>E: Execute from failed block with source execution ID
    E-->>L: Stream execution events
    alt Validation error before block starts
      L-->>U: Show streamed error
    else Target block starts
      L-->>U: Retry started
    end
  end
Loading

Reviews (3): Last reviewed commit: "fix(logs): retry failed runs from failed..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/logs/retry.ts Outdated
@BillLeoutsakosvl346
BillLeoutsakosvl346 force-pushed the agent/retry-failed-run-from-block branch from bba9627 to 2ad58b6 Compare August 31, 2026 21:07
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@greptile review

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/logs/retry.ts
Comment thread apps/sim/hooks/queries/logs.ts Outdated
@BillLeoutsakosvl346
BillLeoutsakosvl346 force-pushed the agent/retry-failed-run-from-block branch from 2ad58b6 to 471be26 Compare August 31, 2026 21:25
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@greptile review

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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