diff --git a/extensions/qwen-portal-auth/README.md b/extensions/qwen-portal-auth/README.md index da1ae4527..4800a83d7 100644 --- a/extensions/qwen-portal-auth/README.md +++ b/extensions/qwen-portal-auth/README.md @@ -21,4 +21,4 @@ clawdbot models auth login --provider qwen-portal --set-default ## Notes - Qwen OAuth uses a device-code login flow. -- Tokens expire periodically; re-run login if requests fail. +- Tokens auto-refresh; re-run login if refresh fails or access is revoked. diff --git a/src/commands/auth-choice-options.test.ts b/src/commands/auth-choice-options.test.ts index 722baea45..c23c7d783 100644 --- a/src/commands/auth-choice-options.test.ts +++ b/src/commands/auth-choice-options.test.ts @@ -139,7 +139,7 @@ describe("buildAuthChoiceOptions", () => { expect(options.some((opt) => opt.value === "chutes")).toBe(true); }); - it("includes Qwen Portal auth choice", () => { + it("includes Qwen auth choice", () => { const store: AuthProfileStore = { version: 1, profiles: {} }; const options = buildAuthChoiceOptions({ store, diff --git a/src/commands/auth-choice-options.ts b/src/commands/auth-choice-options.ts index e95e2d4c3..84e7119ad 100644 --- a/src/commands/auth-choice-options.ts +++ b/src/commands/auth-choice-options.ts @@ -56,7 +56,7 @@ const AUTH_CHOICE_GROUP_DEFS: { { value: "qwen", label: "Qwen", - hint: "Portal OAuth", + hint: "OAuth", choices: ["qwen-portal"], }, { diff --git a/src/commands/auth-choice.apply.qwen-portal.ts b/src/commands/auth-choice.apply.qwen-portal.ts index 9cb59d727..acaf5078e 100644 --- a/src/commands/auth-choice.apply.qwen-portal.ts +++ b/src/commands/auth-choice.apply.qwen-portal.ts @@ -1,15 +1,15 @@ -import type { ClawdbotConfig } from "../config/config.js"; import { resolveDefaultAgentId, resolveAgentDir, resolveAgentWorkspaceDir } from "../agents/agent-scope.js"; -import { resolveDefaultAgentWorkspaceDir } from "../agents/workspace.js"; import { upsertAuthProfile } from "../agents/auth-profiles.js"; import { normalizeProviderId } from "../agents/model-selection.js"; -import type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.js"; -import { applyAuthProfileConfig } from "./onboard-auth.js"; -import { isRemoteEnvironment } from "./oauth-env.js"; -import { openUrl } from "./onboard-helpers.js"; -import { createVpsAwareOAuthHandlers } from "./oauth-flow.js"; +import { resolveDefaultAgentWorkspaceDir } from "../agents/workspace.js"; +import type { ClawdbotConfig } from "../config/config.js"; import { resolvePluginProviders } from "../plugins/providers.js"; import type { ProviderAuthMethod, ProviderPlugin } from "../plugins/types.js"; +import type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.js"; +import { applyAuthProfileConfig } from "./onboard-auth.js"; +import { openUrl } from "./onboard-helpers.js"; +import { createVpsAwareOAuthHandlers } from "./oauth-flow.js"; +import { isRemoteEnvironment } from "./oauth-env.js"; const PLUGIN_ID = "qwen-portal-auth"; const PROVIDER_ID = "qwen-portal"; @@ -116,15 +116,15 @@ export async function applyAuthChoiceQwenPortal( const provider = resolveProviderMatch(providers, PROVIDER_ID); if (!provider) { await params.prompter.note( - "Qwen Portal auth plugin is not available. Run `clawdbot plugins enable qwen-portal-auth` and re-run the wizard.", - "Qwen Portal", + "Qwen auth plugin is not available. Run `clawdbot plugins enable qwen-portal-auth` and re-run the wizard.", + "Qwen", ); return { config: nextConfig }; } const method = pickAuthMethod(provider, "device") ?? provider.auth[0]; if (!method) { - await params.prompter.note("Qwen Portal auth method missing.", "Qwen Portal"); + await params.prompter.note("Qwen auth method missing.", "Qwen"); return { config: nextConfig }; } diff --git a/src/commands/auth-choice.test.ts b/src/commands/auth-choice.test.ts index e6ebb4553..fbc434aa3 100644 --- a/src/commands/auth-choice.test.ts +++ b/src/commands/auth-choice.test.ts @@ -13,7 +13,7 @@ vi.mock("../providers/github-copilot-auth.js", () => ({ githubCopilotLoginCommand: vi.fn(async () => {}), })); -const resolvePluginProviders = vi.fn(() => []); +const resolvePluginProviders = vi.hoisted(() => vi.fn(() => [])); vi.mock("../plugins/providers.js", () => ({ resolvePluginProviders, })); @@ -492,7 +492,7 @@ describe("applyAuthChoice", () => { }); }); - it("writes Qwen Portal credentials when selecting qwen-portal", async () => { + it("writes Qwen credentials when selecting qwen-portal", async () => { tempStateDir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-auth-")); process.env.CLAWDBOT_STATE_DIR = tempStateDir; process.env.CLAWDBOT_AGENT_DIR = path.join(tempStateDir, "agent"); @@ -501,7 +501,7 @@ describe("applyAuthChoice", () => { resolvePluginProviders.mockReturnValue([ { id: "qwen-portal", - label: "Qwen Portal OAuth", + label: "Qwen", auth: [ { id: "device",