Skip to content

Commit 7b8da19

Browse files
committed
docs: document auth profile usage
1 parent db7a228 commit 7b8da19

14 files changed

Lines changed: 73 additions & 12 deletions

‎src/agents/auth-profiles.chutes.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Chutes auth profile integration tests.
3+
* Verifies expired OAuth profiles refresh through the provider token endpoint
4+
* while preserving the shared auth-profile store contracts.
5+
*/
16
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
27
import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js";
38
import type { AuthProfileStore } from "./auth-profiles.js";

‎src/agents/auth-profiles.cooldown-auto-expiry.test.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Cooldown auto-expiry regression tests for auth profile ordering.
3+
* Profiles with expired cooldowns should become available and clear stale
4+
* counters before the next failure can escalate.
5+
*/
16
import { describe, expect, it, vi } from "vitest";
27
import { resolveAuthProfileOrder } from "./auth-profiles/order.js";
38
import type { AuthProfileStore } from "./auth-profiles/types.js";
@@ -7,13 +12,6 @@ vi.mock("./provider-auth-aliases.js", () => ({
712
resolveProviderIdForAuth: (provider: string) => provider.trim().toLowerCase(),
813
}));
914

10-
/**
11-
* Integration tests for cooldown auto-expiry through resolveAuthProfileOrder.
12-
* Verifies that profiles with expired cooldowns are treated as available and
13-
* have their error state reset, preventing the escalation loop described in
14-
* #3604, #13623, #15851, and #11972.
15-
*/
16-
1715
function makeStoreWithProfiles(): AuthProfileStore {
1816
return {
1917
version: 1,

‎src/agents/auth-profiles.doctor.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Auth-profile doctor copy tests.
3+
* Covers provider-specific repair hints without invoking real auth flows.
4+
*/
15
import { beforeAll, describe, expect, it } from "vitest";
26
import { formatAuthDoctorHint } from "./auth-profiles/doctor.js";
37
import type { AuthProfileStore } from "./auth-profiles/types.js";

‎src/agents/auth-profiles.external-cli-scope.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* External CLI auth scope tests.
3+
* Verifies config/model signals narrow external credential discovery to the
4+
* providers and profile ids relevant for the current agent.
5+
*/
16
import { describe, expect, it } from "vitest";
27
import type { OpenClawConfig } from "../config/types.openclaw.js";
38
import { resolveExternalCliAuthScopeFromConfig } from "./auth-profiles/external-cli-scope.js";

‎src/agents/auth-profiles.external-cli-sync.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* External CLI OAuth sync tests.
3+
* Covers cached credential readers, bootstrap/replace policy, and runtime-only
4+
* profile persistence decisions without touching real CLI credential stores.
5+
*/
16
import { beforeEach, describe, expect, it, vi } from "vitest";
27
import type { AuthProfileStore, OAuthCredential } from "./auth-profiles/types.js";
38
import type { ClaudeCliCredential } from "./cli-credentials.js";

‎src/agents/auth-profiles.getsoonestcooldownexpiry.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Soonest cooldown expiry tests.
3+
* Verifies timestamp selection across cooldown, blocked, disabled, invalid, and
4+
* model-scoped usage-state combinations.
5+
*/
16
import { describe, expect, it } from "vitest";
27
import type { AuthProfileStore } from "./auth-profiles/types.js";
38
import { getSoonestCooldownExpiry } from "./auth-profiles/usage-state.js";

‎src/agents/auth-profiles.markauthprofilefailure.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Auth-profile failure persistence tests.
3+
* Exercises lock-based usage updates, provider bypasses, and cooldown hook
4+
* behavior against temporary SQLite-backed stores.
5+
*/
16
import fs from "node:fs";
27
import os from "node:os";
38
import path from "node:path";

‎src/agents/auth-profiles.readonly-sync.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Read-only external auth overlay tests.
3+
* Ensures runtime profile overlays do not persist or sync when callers request
4+
* read-only auth-profile resolution.
5+
*/
16
import fs from "node:fs";
27
import os from "node:os";
38
import path from "node:path";

‎src/agents/auth-profiles.resolve-auth-profile-order.does-not-prioritize-lastgood-round-robin-ordering.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Auth profile ordering regression tests.
3+
* Ensures last-good hints do not override explicit config, aws-sdk, or
4+
* round-robin ordering semantics.
5+
*/
16
import { describe, expect, it, vi } from "vitest";
27
import {
38
ANTHROPIC_CFG,

‎src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
/**
2+
* Shared auth profile ordering fixtures.
3+
* Keeps provider/profile config fixtures aligned across ordering regression
4+
* tests without coupling them to production store loading.
5+
*/
16
import type { OpenClawConfig } from "../config/types.openclaw.js";
27
import type { AuthProfileStore } from "./auth-profiles.js";
38

4-
// Shared auth profile fixtures for resolve-auth-profile-order tests.
59
export const ANTHROPIC_STORE: AuthProfileStore = {
610
version: 1,
711
profiles: {

0 commit comments

Comments
 (0)