Skip to content

Orphaned workspace directories block webhook retries after execution failure #15

Description

@flancer64

Problem

When an execution fails after workspace creation (e.g., hostScript exits non-zero, Docker times out), the workspace directory at <workspaceRoot>/ws/<owner>/<repo>/<eventType>/<eventId>/ is left on disk.

If GitHub retries the same webhook delivery (same X-GitHub-Delivery UUID), Workspace/Preparer.mjs:99 (assertWorkspaceIsAbsent) throws:

Execution workspace already exists: /home/agentess/app/github-flows/var/work/ws/owner/repo/eventType/eventId

This blocks the retry from ever executing, because hostScript and Docker runtime are never reached.

Expected behaviour

The runtime should either:

  • Clean up the workspace directory when execution fails (in Coordinator.start() catch block or in WorkspacePreparer), or
  • Recreate the workspace if it already exists (remove and re-clone), or
  • Include a unique execution attempt counter in the workspace path so retries get a fresh directory.

Affected code

  • src/Execution/Workspace/Preparer.mjs:91-100assertWorkspaceIsAbsent
  • src/Execution/Start/Coordinator.mjs:243-257 — only logs and rethrows, no cleanup

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