docs: document codex app-server small utilities

This commit is contained in:
Peter Steinberger
2026-06-04 08:42:50 -04:00
parent e4a775567c
commit b91ed087c8
4 changed files with 24 additions and 0 deletions

View File

@@ -1,5 +1,10 @@
/**
* 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,

View File

@@ -1,3 +1,7 @@
/**
* Enriches Codex usage-limit failures with current rate-limit information and
* marks blocked auth profiles when Codex exposes a reset time.
*/
import {
embeddedAgentLog,
formatErrorMessage,
@@ -33,6 +37,7 @@ type CodexUsageLimitErrorResult = {
rateLimitsForProfile?: JsonValue;
};
/** Marks a Codex auth profile blocked until the reset time advertised by rate limits. */
export async function markCodexAuthProfileBlockedFromRateLimits(params: {
params: EmbeddedRunAttemptParams;
authProfileId?: string;
@@ -64,6 +69,7 @@ export async function markCodexAuthProfileBlockedFromRateLimits(params: {
}
}
/** Formats a turn-start usage-limit error, refreshing rate limits when needed. */
export async function formatCodexTurnStartUsageLimitError(params: {
client: CodexAppServerClient;
error: unknown;
@@ -79,6 +85,7 @@ export async function formatCodexTurnStartUsageLimitError(params: {
});
}
/** Refreshes a generic prompt usage-limit message into a reset-aware message. */
export async function refreshCodexUsageLimitPromptError(params: {
client: CodexAppServerClient;
message: string | undefined;

View File

@@ -1,5 +1,12 @@
/**
* Version and package pins for the managed Codex app-server runtime.
*/
/** Minimum Codex app-server version supported by the OpenClaw Codex bridge. */
export const MIN_CODEX_APP_SERVER_VERSION = "0.125.0";
/** Minimum Codex app-server version that supports sandbox exec-server environments. */
export const MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION = "0.132.0";
/** npm package name for the managed Codex app-server binary. */
export const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
// Keep this in sync with the Codex CLI live-test package pin.
/** Managed Codex app-server package version installed by OpenClaw. */
export const MANAGED_CODEX_APP_SERVER_PACKAGE_VERSION = "0.135.0";

View File

@@ -1,3 +1,8 @@
/**
* Filters Codex dynamic tools for turns that already contain image inputs so
* models with native vision do not get redundant image-inspection tools.
*/
/** Removes the image tool when the model can directly consume inbound images. */
export function filterToolsForVisionInputs<T extends { name?: string }>(
tools: T[],
params: {