Skip to content

[P1] Terminalize pre-created background workflow run when PRD lease acquisition fails #6

Description

@brAperia2025

Context: CodeRabbit feedback on upstream PR coleam00#1875 surfaced a likely-valid pending-row bug in our fork.

Problem:

  • packages/core/src/orchestrator/orchestrator.ts may pre-create a workflow run.
  • If acquirePrdExecutionLeaseForRun throws, the function sends an error and returns without terminalizing the pre-created run.

Impact:

  • P1. Leaves stale pending rows and can interfere with path locks/status until cleanup.

Acceptance criteria:

  • On PRD lease acquisition failure after preCreatedRun exists, mark the run failed/cancelled with a clear guard-blocked reason.
  • Log any DB finalization failure separately.
  • Add a regression test for lease acquisition failure after pre-creation.

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions