Skip to content

fix(tables): write the cell state when a resumed run throws - #8401

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/resume-cell-terminal-on-throw
Sep 29, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/resume-cell-terminal-on-throw

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • runResumeAndCellTerminal wrote the cell terminal only after a resume returned. A resume that threw left the table cell on its last partial running state — stuck, and not cancellable (the cancel path sees a failed log with a running sidecar and returns conflict)
  • The resume manager now records, on the error it rethrows, whether the attempt kept its pause resumable (wasPausedExecutionRetained): true for an admission refusal or an unavailable run buffer, which go through markResumeAttemptFailed; false for every other failure, which markResumeFailed makes terminal
  • The resume job mirrors that onto the cell: back to paused when the pause was kept, error with the message otherwise — the same shape workflow-column-execution writes when a first run throws. A cancelled cell is protected by the existing cancellation guard in writeWorkflowGroupState
  • A failed cell write is logged without masking the resume error; the original error is still rethrown, so job behavior is unchanged

Type of Change

  • Bug fix

Testing

  • Manager: an unclaimable paused log (real ResumeAdmissionError) keeps the pause resumable; a failed run does not. Removing the new record from the admission branch turns its test red
  • Resume job, table-cell path: a failed run writes error; a kept pause writes paused; a failing cell write still rethrows the original error (red with the write guard removed)
  • Type-check, lint, all audits, and the background, table, workflow, resume and v2 workflow suites 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 4:44am 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 5 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

[Medium risk] Adds error handling to resume execution cell state writes.

The PR appears safe to merge; no outstanding findings remain.

Summary

The PR writes a table cell’s settled state when a resume throws, using the resume manager’s failure outcome. The latest changes replace error-attached outcome storage with a callback and update the tests and shared mock accordingly. Both previous findings are resolved.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resume attempt throws] --> B[Manager settles attempt]
  B --> C{Outcome}
  C -->|Pause retained| D[Write cell as pending]
  C -->|Execution failed| E[Write cell as error]
  C -->|Neither changed| F[Leave cell unchanged]
  D --> G[Rethrow resume error]
  E --> G
  F --> G
Loading

Reviews (4) · Last reviewed commit: "fix(tables): report a failed resume's ou..."

Comment thread apps/sim/background/resume-execution.ts Outdated
runResumeAndCellTerminal only wrote the cell terminal after a resume returned, so a resume that threw left the cell on its last partial running state, where it could not even be cancelled. The resume manager now records, on the error it rethrows, when the attempt kept its pause resumable (admission refused, run buffer unavailable). The resume job mirrors that onto the cell: back to paused when the pause was kept, failed otherwise. A failed cell write is logged without masking the resume error, which is still rethrown.
…from the error

An admission refusal can also mean the execution already finished, so treating every refusal as a kept pause wrote paused over a completed cell. markResumeAttemptFailed and markResumeFailed now return what their transaction actually did (pause still resumable / execution failed), the manager records that outcome on the rethrown error, and the resume job writes paused, error, or nothing.
@waleedlatif1
waleedlatif1 force-pushed the fix/resume-cell-terminal-on-throw branch from 1918976 to e19a8ab Compare September 29, 2026 03:11
@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/lib/workflows/executor/human-in-the-loop-manager.ts Outdated

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

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/workflows/executor/human-in-the-loop-manager.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 5 files

Confidence score: 5/5

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

Re-trigger cubic

…of the error

The outcome rode on the thrown error through a module WeakMap, so it was lost
when draining queued resumes threw after the settle. startResumeExecution now
takes onAttemptFailed, called right after the settle transaction; a hook
failure is logged and never replaces the attempt's error.
@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 61a5169 into staging Sep 29, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/resume-cell-terminal-on-throw branch September 29, 2026 05:14

This branch was previously deployed

1 inactive deployment
Preview — 8c419ed6 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