feat: surface codex account runtime notices
This commit is contained in:
@@ -175,6 +175,24 @@ export interface ExecutionProgressTokenUsage {
|
||||
contextPercent?: number;
|
||||
}
|
||||
|
||||
export interface ExecutionProgressAccountStatus {
|
||||
authMode?: string;
|
||||
planType?: string;
|
||||
limitId?: string;
|
||||
limitName?: string;
|
||||
usedPercent?: number;
|
||||
windowDurationMins?: number;
|
||||
resetsAt?: number;
|
||||
rateLimitReachedType?: string;
|
||||
creditsBalance?: string;
|
||||
hasCredits?: boolean;
|
||||
unlimitedCredits?: boolean;
|
||||
}
|
||||
|
||||
export interface ExecutionProgressModelVerification {
|
||||
verifications: string[];
|
||||
}
|
||||
|
||||
export interface ExecutionProgressMcpServer {
|
||||
name: string;
|
||||
status?: string;
|
||||
@@ -236,6 +254,8 @@ export interface ExecutionProgressSnapshot {
|
||||
realtime?: ExecutionProgressRealtime;
|
||||
modelRoute?: ExecutionProgressModelRoute;
|
||||
tokenUsage?: ExecutionProgressTokenUsage;
|
||||
accountStatus?: ExecutionProgressAccountStatus;
|
||||
modelVerification?: ExecutionProgressModelVerification;
|
||||
mcpServers?: ExecutionProgressMcpServer[];
|
||||
remoteControl?: ExecutionProgressRemoteControl;
|
||||
threadGoal?: ExecutionProgressThreadGoal;
|
||||
@@ -256,6 +276,8 @@ export interface ExecutionProgressInput {
|
||||
realtime?: Partial<ExecutionProgressRealtime>;
|
||||
modelRoute?: Partial<ExecutionProgressModelRoute>;
|
||||
tokenUsage?: Partial<ExecutionProgressTokenUsage>;
|
||||
accountStatus?: Partial<ExecutionProgressAccountStatus> & { accessToken?: unknown; apiKey?: unknown };
|
||||
modelVerification?: Partial<ExecutionProgressModelVerification> & { turnId?: unknown };
|
||||
mcpServers?: Array<Partial<ExecutionProgressMcpServer> & { name?: string }>;
|
||||
remoteControl?: Partial<ExecutionProgressRemoteControl> & { installationId?: unknown };
|
||||
threadGoal?: Partial<ExecutionProgressThreadGoal>;
|
||||
@@ -3936,6 +3958,10 @@ function normalizeExecutionProgressSnapshot(raw: Partial<ExecutionProgressSnapsh
|
||||
realtime: nativeRemoteControl ? undefined : normalizeExecutionProgressRealtime(raw.realtime),
|
||||
modelRoute: nativeRemoteControl ? undefined : normalizeExecutionProgressModelRoute(raw.modelRoute),
|
||||
tokenUsage: nativeRemoteControl ? undefined : normalizeExecutionProgressTokenUsage(raw.tokenUsage),
|
||||
accountStatus: nativeRemoteControl ? undefined : normalizeExecutionProgressAccountStatus(raw.accountStatus),
|
||||
modelVerification: nativeRemoteControl
|
||||
? undefined
|
||||
: normalizeExecutionProgressModelVerification(raw.modelVerification),
|
||||
mcpServers: nativeRemoteControl ? undefined : normalizeExecutionProgressMcpServers(raw.mcpServers),
|
||||
remoteControl: nativeRemoteControl ? undefined : normalizeExecutionProgressRemoteControl(raw.remoteControl),
|
||||
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(raw.threadGoal),
|
||||
@@ -5567,6 +5593,43 @@ function normalizeExecutionProgressTokenUsage(
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeExecutionProgressAccountStatus(
|
||||
input?: ExecutionProgressInput["accountStatus"],
|
||||
): ExecutionProgressAccountStatus | undefined {
|
||||
if (!input) {
|
||||
return undefined;
|
||||
}
|
||||
const status: ExecutionProgressAccountStatus = {
|
||||
authMode: safeExecutionProgressText(input.authMode) || undefined,
|
||||
planType: safeExecutionProgressText(input.planType) || undefined,
|
||||
limitId: safeExecutionProgressText(input.limitId) || undefined,
|
||||
limitName: safeExecutionProgressText(input.limitName) || undefined,
|
||||
usedPercent: normalizeOptionalNumber(input.usedPercent),
|
||||
windowDurationMins: normalizeOptionalNumber(input.windowDurationMins),
|
||||
resetsAt: normalizeOptionalNumber(input.resetsAt),
|
||||
rateLimitReachedType: safeExecutionProgressText(input.rateLimitReachedType) || undefined,
|
||||
creditsBalance: safeExecutionProgressText(input.creditsBalance) || undefined,
|
||||
hasCredits: typeof input.hasCredits === "boolean" ? input.hasCredits : undefined,
|
||||
unlimitedCredits: typeof input.unlimitedCredits === "boolean" ? input.unlimitedCredits : undefined,
|
||||
};
|
||||
return Object.values(status).some((value) => value !== undefined && value !== "") ? status : undefined;
|
||||
}
|
||||
|
||||
function normalizeExecutionProgressModelVerification(
|
||||
input?: ExecutionProgressInput["modelVerification"],
|
||||
): ExecutionProgressModelVerification | undefined {
|
||||
if (!input) {
|
||||
return undefined;
|
||||
}
|
||||
const verifications = Array.isArray(input.verifications)
|
||||
? input.verifications
|
||||
.map((verification) => safeExecutionProgressText(verification))
|
||||
.filter(Boolean)
|
||||
.slice(0, 8)
|
||||
: [];
|
||||
return verifications.length > 0 ? { verifications } : undefined;
|
||||
}
|
||||
|
||||
function normalizeExecutionProgressMcpServers(input?: ExecutionProgressInput["mcpServers"]) {
|
||||
return (input ?? [])
|
||||
.map((server): ExecutionProgressMcpServer | null => {
|
||||
@@ -5799,6 +5862,10 @@ function buildExecutionProgressSnapshot(
|
||||
realtime: nativeRemoteControl ? undefined : normalizeExecutionProgressRealtime(input?.realtime),
|
||||
modelRoute: nativeRemoteControl ? undefined : normalizeExecutionProgressModelRoute(input?.modelRoute),
|
||||
tokenUsage: nativeRemoteControl ? undefined : normalizeExecutionProgressTokenUsage(input?.tokenUsage),
|
||||
accountStatus: nativeRemoteControl ? undefined : normalizeExecutionProgressAccountStatus(input?.accountStatus),
|
||||
modelVerification: nativeRemoteControl
|
||||
? undefined
|
||||
: normalizeExecutionProgressModelVerification(input?.modelVerification),
|
||||
mcpServers: nativeRemoteControl ? undefined : normalizeExecutionProgressMcpServers(input?.mcpServers),
|
||||
remoteControl: nativeRemoteControl ? undefined : normalizeExecutionProgressRemoteControl(input?.remoteControl),
|
||||
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(input?.threadGoal),
|
||||
|
||||
Reference in New Issue
Block a user