mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 07:00:26 +08:00
Replaces the oauth_cli_kit indirection with DeepTutor's own PKCE loopback sign-in, an account-scoped live model catalog, and a Settings card that exposes only the OAuth surface. Credentials live in `<user-root>/private/openai-codex/` with owner-only permissions, atomic writes, and a generation guard that stops a late refresh from resurrecting a signed-out session; `~/.codex` is never read or modified. A CLI path shares the same service. A Codex token authorizes one person's ChatGPT plan, so credentials anchor to the signing-in account's own root and the managed profile is marked `owner_bound`: `redacted_model_access` drops it for every caller, and it is not offered as an assignable model. Signing in publishes the profile but only activates it when no LLM is configured yet, so it never repoints a deployment that already has one. Also from review: reschedule the status poll so one dropped response cannot strand the card on "waiting"; defer the catalog reload when the operator has unsaved edits instead of discarding them; log the real cause behind the generic provider error; stop promising a retry when the token refresh actually failed; bind both loopback stacks since `localhost` may resolve to either; and drop the provider metadata fields nothing consumed.
14 lines
467 B
TypeScript
14 lines
467 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
import test from "node:test";
|
|
|
|
const runnerPath = path.resolve(process.cwd(), "scripts/run-node-tests.mjs");
|
|
|
|
test("node test runner launches TypeScript through the current Node runtime", () => {
|
|
const source = readFileSync(runnerPath, "utf8");
|
|
|
|
assert.match(source, /run\(process\.execPath/);
|
|
assert.match(source, /"typescript", "bin", "tsc"/);
|
|
});
|