Lint with every Oxlint category and list only the offs and options
Check / check (pull_request) Successful in 51s
Check / check (pull_request) Successful in 51s
This commit is contained in:
@@ -38,12 +38,16 @@ function isUsageExhausted(error: unknown): boolean {
|
||||
}
|
||||
|
||||
function failureReason(error: unknown): FailureReason {
|
||||
if (error instanceof AgentAuthError) return "sign-in failed";
|
||||
if (error instanceof AgentAuthError) {
|
||||
return "sign-in failed";
|
||||
}
|
||||
return isUsageExhausted(error) ? "usage exhausted" : "failed";
|
||||
}
|
||||
|
||||
export function failureFooter(failures: ProfileFailure[]): string {
|
||||
if (failures.length === 0) return "> Profile: none";
|
||||
if (failures.length === 0) {
|
||||
return "> Profile: none";
|
||||
}
|
||||
return `> Tried: ${failures
|
||||
.map(({ type, model, reason }) => `\`${type}\` · \`${model}\` (${reason})`)
|
||||
.join(", ")}`;
|
||||
@@ -66,7 +70,9 @@ async function attemptFrom<T, P extends ProfileIdentity>(
|
||||
} catch (error) {
|
||||
const reason = failureReason(error);
|
||||
failures.push({ type: profile.type, model: profile.model, reason });
|
||||
if (reason === "failed" || index === profiles.length - 1) throw error;
|
||||
if (reason === "failed" || index === profiles.length - 1) {
|
||||
throw error;
|
||||
}
|
||||
console.error(`${profile.type} ${reason}; trying next profile`);
|
||||
return attemptFrom(profiles, attempt, failures, index + 1);
|
||||
}
|
||||
@@ -85,7 +91,7 @@ export function runProfiles<T, P extends ProfileIdentity>(
|
||||
export function sanitizedEnvironment(
|
||||
environment: ReadonlyMap<string, string>,
|
||||
): Map<string, string> {
|
||||
const result: Map<string, string> = new Map();
|
||||
const result = new Map<string, string>();
|
||||
for (const name of [
|
||||
"PATH",
|
||||
"HOME",
|
||||
@@ -113,7 +119,9 @@ export function sanitizedEnvironment(
|
||||
"NODE_EXTRA_CA_CERTS",
|
||||
]) {
|
||||
const value = environment.get(name);
|
||||
if (value !== undefined) result.set(name, value);
|
||||
if (value !== undefined) {
|
||||
result.set(name, value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -125,7 +133,9 @@ export function agentEnvironment(
|
||||
): Map<string, string> {
|
||||
const result = sanitizedEnvironment(environment);
|
||||
result.set("HOME", profile.home);
|
||||
if (profile.type === "codex") result.set("CODEX_HOME", `${profile.home}/.codex`);
|
||||
if (profile.type === "codex") {
|
||||
result.set("CODEX_HOME", `${profile.home}/.codex`);
|
||||
}
|
||||
if (token !== undefined && token !== "") {
|
||||
const tokenName = {
|
||||
claude: "CLAUDE_CODE_OAUTH_TOKEN",
|
||||
|
||||
Reference in New Issue
Block a user