Skip to content

Normalize runner status handling and ensure timeout cleanup in execution API#17

Open
fractional-pm wants to merge 1 commit intomainfrom
codex/fix-tenant-scoping-for-execution-endpoint
Open

Normalize runner status handling and ensure timeout cleanup in execution API#17
fractional-pm wants to merge 1 commit intomainfrom
codex/fix-tenant-scoping-for-execution-endpoint

Conversation

@fractional-pm
Copy link
Copy Markdown
Contributor

Motivation

  • Ensure the execution endpoint correctly interprets varied runner status strings and persists accurate execution status.
  • Prevent the request timeout from leaking by guaranteeing clearTimeout is always called.
  • Allow the API to represent an in-progress state (RUNNING) separately from success and error.

Description

  • Added normalizeRunnerStatus to map various runner status strings (e.g. COMPLETED, DONE, FAILED) to a canonical SUCCESS/ERROR/RUNNING set.
  • Broadened the local status variable to include RUNNING and preserve the initial execution record as RUNNING when created.
  • Wrapped the runner fetch call in a try/finally so the timeout is always cleared, and set status based on the normalized runner response payload.
  • Kept the existing error handling to mark executions as ERROR on exceptions and only set completedAt when status === 'SUCCESS'.

Testing

  • Ran the automated test suite via pnpm test and all tests completed successfully.
  • Ran a type check/build via pnpm build to validate typings and the build and it succeeded.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant