Skip to content

fix(resume): capture pause block names and keep the resume page off the execution snapshot - #10104

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/hitl-resume-slow-load
Nov 17, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/hitl-resume-slow-load

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The resume page downloaded the full execution snapshot (every block's output, uncapped for human pauses) twice per load, then JSON.parsed it once per pause point on every render (including every keystroke) just to read a block name. Large runs with many pause points made the page take minutes to load.
  • The engine now records blockName on each pause point when the pause is captured, and persistence stores it in pause_points
  • pause-block-names.ts names pause points for every reader (resume page reads and the v2 run read): the captured name first, else the run's deployment version, read inside the DB and only when a point lacks a name. The snapshot is never parsed for names.
  • New getPausedExecutionView reads without the snapshot column. triggerIds come from metadata (already written at pause time), so Postgres only detoasts the snapshot for rows saved before that. getPausedExecutionDetail is the view plus the snapshot, for resume and API callers.
  • readPausedWorkflowExecution takes a required includeSnapshot. GET /api/resume/{workflowId}/{executionId}?includeSnapshot= defaults to true, so the documented API response is unchanged; the resume page sends false. The /api/workflows/{id}/paused/{executionId} API route always includes it.
  • The context GET's execution no longer carries the snapshot, which matches its documented PausedExecutionSummary shape
  • The v2 blockName is now set for manual runs too, and blockId strips subflow clone suffixes (stripCloneSuffixes). The v2 contract description and OpenAPI are updated, and openapi-core.json documents includeSnapshot and PausePoint.blockName.
  • Pauses persisted before this deploy on a manual run (no deployment version) show the generic "Human in the Loop" label until they resume or expire

Type of Change

  • Bug fix

Testing

  • pause-persistence.integration.ts against real Postgres:
    • captured names come back through the read use case, the context read and readPausedRunPoints on a manual run
    • display reads never contain the snapshot (sentinel check), and includeSnapshot returns it
    • an unnamed older point is named from the deployment version
    • triggerIds come from metadata, falling back to the snapshot
    • Each case goes red when its guard is reverted.
  • engine.test.ts: the paused result carries the DAG node's block name (red when the capture is removed)
  • api/resume/[workflowId]/[executionId]/route.test.ts: only includeSnapshot=false opts out; the default and the paused route read the snapshot (red when the flag is ignored)
  • Workflows lib, resume, v2 workflows, executor and hooks unit suites (3,855 tests); bun run lint; app type-check; check:openapi, check:api-validation:strict, check:explicit-any (baseline shrunk), check:test-patterns, check:boundaries, check:client-boundary, check:source-conventions, check:file-names, check:utils, check:test-types; block-registry check

Checklist

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

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 17, 2026 1:32am 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 9 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

The resume page no longer downloads or repeatedly parses the execution snapshot to show block names.

  • Resume pages load pause details without the execution snapshot.
  • Pause points keep the block name they need for their labels.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Engine[Execution pauses] --> Stored[Store pause point with block name]
  Page[Resume page] --> View[Read without snapshot]
  View --> Stored
  View --> Fallback[Read deployment names when missing]
  API[Default API read] --> Detail[Read view and snapshot]
Loading

Reviews (2) · Last reviewed commit: "improvement(resume): capture pause block..." · Reviewed by Greptile

@waleedlatif1 waleedlatif1 changed the title fix(resume): stop shipping the execution snapshot to the resume page fix(resume): capture pause block names and keep the resume page off the execution snapshot Nov 17, 2026
@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 Nov 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 Sorry, I encountered an error while trying to start the review. Please try again later.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 17, 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 22 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/api/contracts/workflows.ts Resolved
@waleedlatif1
waleedlatif1 merged commit 77ce461 into staging Nov 17, 2026
84 of 85 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/hitl-resume-slow-load branch November 17, 2026 01:48

This branch was successfully deployed

1 active deployment
Preview — 9958b002 Deployed Nov 17, 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