mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user