Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): renew managed ChatGPT tokens rejected before local expiry #29950

Openvoltcrash(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/29950/headopened View on GitHub

Showing 16 changed files with 9 additions and 55 deletions (loading 13).

x
0 of 16 viewed, 16 left
0 additions and 48 deletionsapps/server/src/cli/managedChatGptToken.tsDeleted
@@ -1,48 +0,0 @@
-// @effect-diagnostics nodeBuiltinImport:off - Lean self-invoked local IPC client; no auth/store graph.
-import * as NodeNet from "node:net";
-import * as Effect from "effect/Effect";
-import * as Exit from "effect/Exit";
-import * as Schema from "effect/Schema";
-import * as Protocol from "../provider/CodexManagedTokenProtocol.ts";
-​
-const decodeArguments = Schema.decodeUnknownEffect(
- Schema.Tuple([
- Schema.NonEmptyString,
- Protocol.Request.fields.instanceId,
- Protocol.Request.fields.environmentId,
- Protocol.Request.fields.profileKey,
- ]),
-);
-const encodeRequest = Schema.encodeSync(Schema.fromJsonString(Protocol.Request));
-const decodeResponse = Schema.decodeUnknownEffect(Schema.fromJsonString(Protocol.Response), {
- onExcessProperty: "error",
-});
-​
-/** Codex's auth.command protocol is a bare token on stdout, never a CLI diagnostic. */
-export async function runManagedChatGptTokenCli(args: ReadonlyArray<string>): Promise<void> {
- const program = Effect.gen(function* () {
- const [endpoint, instanceId, environmentId, profileKey] = yield* decodeArguments(args);
- const socket = yield* Effect.acquireRelease(
- Effect.sync(() => NodeNet.createConnection(endpoint)),
- (socket) => Effect.sync(() => socket.destroy()),
- );
- socket.on("error", () => {});
- socket.once("connect", () =>