Skip to content

fix(tables): settle a resume whose pause cannot be saved as failed, and never fail a completed run - #8417

Merged
waleedlatif1 merged 6 commits into
stagingfrom
fix/resume-failure-outcome-gaps
Sep 29, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
fix/resume-failure-outcome-gaps

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two gaps in how a failed resume attempt settles, raised on the v0.9.6 release PR (#8410).

  • A pause that can't be saved now fails the attempt. When a resumed run paused but its pause state couldn't be persisted (the snapshot seed was missing, or persistPauseResult threw), the log was failed but the paused result was still returned. So the table cell showed paused and the resume entry was marked completed. It now fails the log with the same reason, then throws, so the attempt settles through the shared failure path: slot released, resume entry and pause point failed, execution_failed reported to onAttemptFailed, and queued resumes drained. Every caller of startResumeExecution already handles a throw.
  • A completed run is never rewritten as failed. markResumeFailed only skipped cancelled logs. If a step after a completed run threw (for example markResumeCompleted or processQueuedResumes), the log was rewritten from completed to failed, and the cell was set to error. A completed log now keeps its outcome. markResumeFailed reports what the attempt left the execution as, and a new execution_completed outcome settles the cell as completed, which is what the success path would have written. Without that outcome, the cell would stay on its last running progress state. The pause point and resume entry are still marked failed, as before. An already failed log still reports execution_failed but keeps its original end time. runResumeExecution awaits the log's finalization before returning or throwing, so the status read here reflects this attempt's run.

Type of Change

  • Bug fix

Testing

  • markResumeFailed: a completed log reports execution_completed without rewriting the log; a failed log reports execution_failed without rewriting it; a running log is failed as before; cancelled and cancelling report nothing.
  • The task settles the cell as completed for execution_completed.
  • startResumeExecution: a failed pause persistence and a missing snapshot seed both reject and report execution_failed.
  • Each new test fails on the previous code. Type-check, lint, all audits, and the full apps/sim suite pass.

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)

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 29, 2026 5:34pm UTC

Request Review

@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 2 files

Confidence score: 5/5

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

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Changes how resume failures are classified and handled.

The PR appears safe to merge; no new actionable issue remains.

Summary

The PR makes an unsaved pause fail its resume attempt and preserves a completed execution log when later resume bookkeeping fails.

  • Failed attempts now report the execution’s final outcome to the table-cell writer.
  • A completed cell can continue its downstream row cascade after a later bookkeeping failure.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resume attempt] --> B{Pause result?}
  B -->|Pause cannot be saved| C[Fail log and settle attempt as failed]
  B -->|Run completed| D{Later bookkeeping fails?}
  D -->|No| E[Write completed cell and continue cascade]
  D -->|Yes| F[Preserve completed log and write completed cell]
  F --> G[Continue cascade, then surface error]
Loading

Reviews (5) · Last reviewed commit: "test(tables): assert which downstream gr..."

Comment thread apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts Outdated
Comment thread apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts Outdated
…nd never fail a completed run

A resumed run that paused but whose pause state could not be persisted failed
its log yet returned a paused result, so the cell showed paused and the resume
entry was marked completed. It now throws after failing the log, so the attempt
settles as failed and reports execution_failed.

markResumeFailed also rewrote a completed log as failed when a step after a
completed run threw. A completed run's outcome now stands, and an already
failed log keeps its original end time.
…ater step throws

Leaving a completed log alone reported no outcome, so the cell stayed on its
last running state. markResumeFailed now reports what the attempt left the
execution as, and a run that completed before a later step threw settles the
cell as completed. The pause point is still marked failed as before.
@waleedlatif1
waleedlatif1 force-pushed the fix/resume-failure-outcome-gaps branch 2 times, most recently from aa14823 to 6be9ba0 Compare September 29, 2026 16:48
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

Comment thread apps/sim/background/resume-execution.ts

@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 4 files

Confidence score: 5/5

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

Re-trigger cubic

…r step threw

A completed run's cell is completed, so its downstream workflow groups still
start; the failure is still rethrown. A pause that cannot be saved now throws a
stable message with the underlying error on cause, so API callers never see
internal persistence details.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 4 files

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/background/resume-execution.ts Outdated
Comment thread apps/sim/background/resume-execution.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 4 files

Confidence score: 5/5

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

Re-trigger cubic

Comment thread apps/sim/background/resume-governed-subject.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 4 files

Confidence score: 5/5

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

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 5a1a4f3 into staging Sep 29, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/resume-failure-outcome-gaps branch September 29, 2026 20:07

This branch was previously deployed

1 inactive deployment
Preview — 4fef9c4e Deployed Sep 29, 2026 by vercel[bot]
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