mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-29 02:43:37 +00:00
15 lines
478 B
TypeScript
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 });
|
|
}
|