Skip to content

fix(mothership): answer a Chat workflow tool paused for a person with its resume link - #9751

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/copilot-hitl-pause-link
Nov 6, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/copilot-hitl-pause-link

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A Chat workflow tool (run_workflow, run_from_block, …) whose run paused at a Human in the Loop block was never answered: the browser reports nothing for a paused run, the execute route's report skipped a non-terminal log, and the lapsed-wait watcher only detaches a running log (a paused run's log stays pending). The turn parked until it timed out and the user never saw where to approve
  • Settle the call as soon as its run waits on a person, with the resume page link and an instruction to give it to the user rather than resume it. A run paused only on time still holds the call, since it resumes itself
  • The Chat-side waiter re-reads the pause and the call's binding instead of trusting a confirmation's data, so a confirmation can't put another link in front of the model
  • The lapsed-wait watcher answers a human pause if the route's best-effort report failed
  • Move the pause point parser into execution-state and share it with run status reads
  • Stop is unchanged: it already skips a run paused at an approval. A resume or cancel after the answer finds the call settled and leaves it

Type of Change

  • Bug fix

Testing

  • workflow-client-settlement.integration.ts (real Postgres + Redis): 25 passing, 4 new. Each new test fails with its guard reverted (route report, watcher net, waiter re-read, waiter binding check); the existing resume/cancel tests now run through a time pause, the case that still holds the call
  • execution-read-payloads.integration.ts for the moved parser
  • Unit: workflow-client-fallback, client, execution-status, execution-status-projection, copilot confirm route, workflow mutations, tool executor (234 passing)
  • biome on changed files, check:comment-hygiene, check:source-conventions, check:utils, check:file-names; full type-check and check:audits in CI

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)

… its resume link

A browser-run workflow tool whose run paused at a Human in the Loop block was
never answered: the browser reports nothing for a paused run, the execute
route's report skipped a non-terminal log, and the lapsed-wait watcher only
detaches a running log. The Chat turn parked on the call until it timed out,
and the model never learned the run was waiting on the user or where to answer.

- Settle the call when its run waits on a person, with the resume page link
  and an instruction to hand it to the user rather than resume it. A run
  paused only on time resumes itself and keeps the call held.
- The Chat-side waiter re-reads the pause and the call's binding instead of
  trusting a confirmation's data.
- The lapsed-wait watcher answers a human pause if the route's report failed.
- Share the pause point parser between run status reads and this check.
@vercel

vercel Bot commented Nov 6, 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 Nov 6, 2026 8:07pm 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.

1 issue found across 7 files

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

Turn on auto-fix | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/mothership/request/tools/client.ts">

<violation number="1" location="apps/sim/lib/mothership/request/tools/client.ts:391">
P2: A person can submit the form before this waiter re-reads the pause. The pause lookup then returns null while the resumed run is still pending/running, and the fallback reports the original `success` confirmation as `{ success: true }`, falsely telling Chat that the workflow finished. Handle this in-progress-resume case as deferred (using a URL rebuilt from the verified execution identity or waiting for the terminal result) rather than falling through to structural success.</violation>
</file>

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the resumed-run race now returns a running answer rather than claiming completion.

Summary

Chat workflow tools now answer a human pause with the resume link instead of leaving the turn waiting.

  • Chat gets a resume link when a workflow waits for a person.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Workflow pauses for a person] --> B[Route or watcher settles the tool call]
  B --> C[Chat reads the pause and call binding]
  C --> D{Still waiting on a person?}
  D -->|Yes| E[Return the resume link]
  D -->|No| F{Bound run still going?}
  F -->|Yes| G[Return running status and run IDs]
  F -->|No| H[Read the trusted finished result]
Loading

Reviews (2) · Last reviewed commit: "fix(mothership): answer a paused Chat wo..." · Reviewed by Greptile

…n its form was submitted before Chat read the pause
@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 6, 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 7 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

@waleedlatif1
waleedlatif1 merged commit 89c1d63 into staging Nov 6, 2026
79 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/copilot-hitl-pause-link branch November 6, 2026 20:13

This branch was previously deployed

1 inactive deployment
Preview — 464f14a9 Deployed Nov 6, 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