feat(codex): support backend-authorized Luna Reserve fallback (#1780)

* feat(codex): reconcile Luna Reserve fallback and conditional usage

* fix(codex): preserve queued settings and reconcile Reserve sessions
This commit is contained in:
SSU-WEI HUANG
2026-09-09 09:27:40 +08:00
committed by GitHub
parent 5c5c8b3a9f
commit 8357da0a9d
18 changed files with 928 additions and 21 deletions
+10 -1
View File
@@ -4,6 +4,7 @@ import { logger } from '@/ui/logger';
import { JsonLineParser } from '@/utils/jsonLineParser';
import { killProcessByChildProcess } from '@/utils/process';
import type {
ThreadSettingsUpdateParams,
CollaborationModeListResponse,
InitializeParams,
InitializeResponse,
@@ -300,6 +301,14 @@ export class CodexAppServerClient extends JsonLineParser {
return response as ConfigReadResponse;
}
async readAccountRateLimits(supportsLunaReserve = false): Promise<unknown> {
return this.sendRequest('account/rateLimits/read', supportsLunaReserve ? { supportsLunaReserve: true } : null, { timeoutMs: 30_000 });
}
async updateThreadSettings(params: ThreadSettingsUpdateParams): Promise<void> {
await this.sendRequest('thread/settings/update', params, { timeoutMs: 30_000 });
}
async listModels(params?: ModelListParams): Promise<ModelListResponse> {
const response = await this.sendRequest('model/list', params ?? {}, {
timeoutMs: 30_000
@@ -354,7 +363,7 @@ export class CodexAppServerClient extends JsonLineParser {
return response as ThreadForkResponse;
}
async supportsMethod(method: 'thread/fork' | 'thread/rollback'): Promise<boolean> {
async supportsMethod(method: 'thread/fork' | 'thread/rollback' | 'thread/settings/update'): Promise<boolean> {
try {
await this.sendRequest(method, { threadId: '__hapi_capability_probe__' }, { timeoutMs: 30_000 });
return true;