chore: naming to chatgpt oauth instead of codex oauth (#551)
This commit is contained in:
@@ -75,7 +75,7 @@ export async function getClient() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Note: OpenAI Codex OAuth token refresh is handled by the Letta backend
|
||||
// Note: ChatGPT OAuth token refresh is handled by the Letta backend
|
||||
// when using the chatgpt_oauth provider type
|
||||
|
||||
return new Letta({
|
||||
|
||||
@@ -25,7 +25,7 @@ function buildModelSettings(
|
||||
modelHandle: string,
|
||||
updateArgs?: Record<string, unknown>,
|
||||
): ModelSettings {
|
||||
// Include our custom OpenAI Codex OAuth provider (chatgpt-plus-pro)
|
||||
// Include our custom ChatGPT OAuth provider (chatgpt-plus-pro)
|
||||
const isOpenAI =
|
||||
modelHandle.startsWith("openai/") ||
|
||||
modelHandle.startsWith(`${OPENAI_CODEX_PROVIDER_NAME}/`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* OAuth 2.0 utilities for OpenAI Codex authentication
|
||||
* OAuth 2.0 utilities for ChatGPT OAuth authentication
|
||||
* Uses Authorization Code Flow with PKCE and local callback server
|
||||
* Compatible with Codex CLI authentication flow
|
||||
*/
|
||||
|
||||
@@ -3561,7 +3561,7 @@ export default function App({
|
||||
// Special handling for /connect command - OAuth connection
|
||||
if (msg.trim().startsWith("/connect")) {
|
||||
// Handle all /connect commands through the unified handler
|
||||
// For codex: uses local OAuth server (no dialog needed)
|
||||
// For codex: uses local ChatGPT OAuth server (no dialog needed)
|
||||
// For zai: requires API key as argument
|
||||
const { handleConnect } = await import("./commands/connect");
|
||||
await handleConnect(
|
||||
|
||||
@@ -138,7 +138,7 @@ export async function handleConnect(
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /connect codex - OpenAI Codex OAuth with local server
|
||||
* Handle /connect codex - ChatGPT OAuth with local server
|
||||
*/
|
||||
async function handleConnectCodex(
|
||||
ctx: ConnectCommandContext,
|
||||
@@ -151,7 +151,7 @@ async function handleConnectCodex(
|
||||
ctx.buffersRef,
|
||||
ctx.refreshDerived,
|
||||
msg,
|
||||
"Already connected to OpenAI Codex via OAuth.\n\nUse /disconnect codex to remove the current connection first.",
|
||||
"Already connected to ChatGPT via OAuth.\n\nUse /disconnect codex to remove the current connection first.",
|
||||
false,
|
||||
);
|
||||
return;
|
||||
@@ -179,7 +179,7 @@ async function handleConnectCodex(
|
||||
ctx.refreshDerived,
|
||||
cmdId,
|
||||
msg,
|
||||
`\u2717 OpenAI Codex OAuth requires a Pro or Enterprise plan\n\n` +
|
||||
`\u2717 ChatGPT OAuth requires a Pro or Enterprise plan\n\n` +
|
||||
`This feature is only available for Letta Pro or Enterprise customers.\n` +
|
||||
`Current plan: ${eligibility.billing_tier}\n\n` +
|
||||
`To upgrade your plan, visit:\n\n` +
|
||||
@@ -304,7 +304,7 @@ async function handleConnectCodex(
|
||||
ctx.refreshDerived,
|
||||
cmdId,
|
||||
msg,
|
||||
"Creating OpenAI Codex provider...",
|
||||
"Creating ChatGPT OAuth provider...",
|
||||
true,
|
||||
"running",
|
||||
);
|
||||
@@ -326,7 +326,7 @@ async function handleConnectCodex(
|
||||
ctx.refreshDerived,
|
||||
cmdId,
|
||||
msg,
|
||||
`\u2713 Successfully connected to OpenAI Codex!\n\n` +
|
||||
`\u2713 Successfully connected to ChatGPT!\n\n` +
|
||||
`Provider '${OPENAI_CODEX_PROVIDER_NAME}' created/updated in Letta.\n` +
|
||||
`Your ChatGPT Plus/Pro subscription is now linked.`,
|
||||
true,
|
||||
@@ -348,7 +348,7 @@ async function handleConnectCodex(
|
||||
let displayMessage: string;
|
||||
if (errorMessage === "PLAN_UPGRADE_REQUIRED") {
|
||||
displayMessage =
|
||||
`\u2717 OpenAI Codex OAuth requires a Pro or Enterprise plan\n\n` +
|
||||
`\u2717 ChatGPT OAuth requires a Pro or Enterprise plan\n\n` +
|
||||
`This feature is only available for Letta Pro or Enterprise customers.\n` +
|
||||
`To upgrade your plan, visit:\n\n` +
|
||||
` https://app.letta.com/settings/organization/usage\n\n` +
|
||||
@@ -437,7 +437,7 @@ async function handleDisconnectCodex(
|
||||
ctx.buffersRef,
|
||||
ctx.refreshDerived,
|
||||
msg,
|
||||
"Not currently connected to OpenAI Codex via OAuth.\n\nUse /connect codex to authenticate.",
|
||||
"Not currently connected to ChatGPT via OAuth.\n\nUse /connect codex to authenticate.",
|
||||
false,
|
||||
);
|
||||
return;
|
||||
@@ -448,7 +448,7 @@ async function handleDisconnectCodex(
|
||||
ctx.buffersRef,
|
||||
ctx.refreshDerived,
|
||||
msg,
|
||||
"Disconnecting from OpenAI Codex OAuth...",
|
||||
"Disconnecting from ChatGPT OAuth...",
|
||||
true,
|
||||
"running",
|
||||
);
|
||||
@@ -464,7 +464,7 @@ async function handleDisconnectCodex(
|
||||
ctx.refreshDerived,
|
||||
cmdId,
|
||||
msg,
|
||||
`\u2713 Disconnected from OpenAI Codex OAuth.\n\n` +
|
||||
`\u2713 Disconnected from ChatGPT OAuth.\n\n` +
|
||||
`Provider '${OPENAI_CODEX_PROVIDER_NAME}' removed from Letta.`,
|
||||
true,
|
||||
"finished",
|
||||
@@ -475,7 +475,7 @@ async function handleDisconnectCodex(
|
||||
ctx.refreshDerived,
|
||||
cmdId,
|
||||
msg,
|
||||
`\u2717 Failed to disconnect from OpenAI Codex: ${getErrorMessage(error)}`,
|
||||
`\u2717 Failed to disconnect from ChatGPT: ${getErrorMessage(error)}`,
|
||||
false,
|
||||
"finished",
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Direct API calls to Letta for managing OpenAI Codex provider
|
||||
* Direct API calls to Letta for managing ChatGPT OAuth provider
|
||||
* Uses the chatgpt_oauth provider type - backend handles request transformation
|
||||
* (transforms OpenAI API format → ChatGPT backend API format)
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
import { LETTA_CLOUD_API_URL } from "../auth/oauth";
|
||||
import { settingsManager } from "../settings-manager";
|
||||
|
||||
// Provider name constant for letta-code's OpenAI Codex OAuth provider
|
||||
// Provider name constant for letta-code's ChatGPT OAuth provider
|
||||
export const OPENAI_CODEX_PROVIDER_NAME = "chatgpt-plus-pro";
|
||||
|
||||
// Provider type for ChatGPT OAuth (backend handles transformation)
|
||||
@@ -190,7 +190,7 @@ export async function updateOpenAICodexProvider(
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the OpenAI Codex provider
|
||||
* Delete the ChatGPT OAuth provider
|
||||
*/
|
||||
export async function deleteOpenAICodexProvider(
|
||||
providerId: string,
|
||||
@@ -224,7 +224,7 @@ export async function createOrUpdateOpenAICodexProvider(
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the OpenAI Codex provider (called on /disconnect)
|
||||
* Remove the ChatGPT OAuth provider (called on /disconnect)
|
||||
*/
|
||||
export async function removeOpenAICodexProvider(): Promise<void> {
|
||||
const existing = await getOpenAICodexProvider();
|
||||
@@ -234,7 +234,7 @@ export async function removeOpenAICodexProvider(): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is eligible for OpenAI Codex OAuth
|
||||
* Check if user is eligible for ChatGPT OAuth
|
||||
* Requires Pro or Enterprise billing tier
|
||||
*/
|
||||
export async function checkOpenAICodexEligibility(): Promise<EligibilityCheckResult> {
|
||||
@@ -257,12 +257,12 @@ export async function checkOpenAICodexEligibility(): Promise<EligibilityCheckRes
|
||||
return {
|
||||
eligible: false,
|
||||
billing_tier: balance.billing_tier,
|
||||
reason: `OpenAI Codex OAuth requires a Pro or Enterprise plan. Current plan: ${balance.billing_tier}`,
|
||||
reason: `ChatGPT OAuth requires a Pro or Enterprise plan. Current plan: ${balance.billing_tier}`,
|
||||
};
|
||||
} catch (error) {
|
||||
// If we can't check eligibility, allow the flow to continue
|
||||
// The provider creation will handle the error appropriately
|
||||
console.warn("Failed to check OpenAI Codex OAuth eligibility:", error);
|
||||
console.warn("Failed to check ChatGPT OAuth eligibility:", error);
|
||||
return {
|
||||
eligible: true,
|
||||
billing_tier: "unknown",
|
||||
|
||||
Reference in New Issue
Block a user