Files
openclaw/extensions/codex/src/app-server/timeout.ts
2026-06-04 08:42:50 -04:00

15 lines
478 B
TypeScript

/**
* Thin Codex app-server timeout adapter around OpenClaw's shared security
* runtime timeout helper.
*/
import { withTimeout as withSharedTimeout } from "openclaw/plugin-sdk/security-runtime";
/** Awaits a promise with a Codex-specific timeout error message. */
export async function withTimeout<T>(
promise: Promise<T>,
timeoutMs: number,
timeoutMessage: string,
): Promise<T> {
return await withSharedTimeout(promise, timeoutMs, { message: timeoutMessage });
}