v0.16.0
Queue handlers can now bound an individual external operation with the worker's deterministic scheduler:
try {
const result = await control.withTimeout(30_000, (signal) => {
return executeTool(input, { signal });
});
actions.emit("tool.completed", result);
} catch (error: unknown) {
actions.emit("tool.failed", describeFailure(error));
}- The operation signal aborts on either its deadline or active lease cancellation.
- Timeouts reject with
WorkOperationTimeoutError. Catch them to commit an application outcome, or leave them uncaught to use normal work retry behavior. withTimeout(...)controls timing and cancellation; it is not an execution sandbox. Pass only the capabilities the operation needs and keep external effects idempotent.