computesdk icon indicating copy to clipboard operation
computesdk copied to clipboard

feat(bench): add task cleanup hooks

Open HeyGarrison opened this issue 5 months ago • 2 comments

Summary

  • add defineTask cleanup hooks that run after success or failure
  • pass cleanup the same assignment, taskIndex, and shared task state as steps
  • document cleanup usage and add a patch changeset

Tests

  • pnpm --filter @computesdk/bench test
  • pnpm --filter @computesdk/bench typecheck
  • pnpm --filter @computesdk/bench lint
  • pnpm --filter @computesdk/bench build

HeyGarrison avatar Jun 15 '26 21:06 HeyGarrison

Contributor License Agreement

All contributors are covered by a CLA.

open-cla[bot] avatar Jun 15 '26 21:06 open-cla[bot]

Superagent didn't find any vulnerabilities or security issues in this PR.

superagent-security avatar Jun 15 '26 21:06 superagent-security

Addressed Copilot review comments in a1063177:

  • Cleanup now preserves the original step/task error if cleanup also throws. Cleanup errors only become the task failure when the task otherwise succeeded.
  • README cleanup example now uses typed task state with defineTask/defineStep so state.sandbox access type-checks.

Re-ran:

  • pnpm --filter @computesdk/bench test
  • pnpm --filter @computesdk/bench typecheck
  • pnpm --filter @computesdk/bench lint
  • pnpm --filter @computesdk/bench build

HeyGarrison avatar Jun 16 '26 18:06 HeyGarrison