chore: Also format scripts and skills.

This commit is contained in:
cpojer
2026-01-31 21:21:09 +09:00
parent a767c584c7
commit 76b5208b11
95 changed files with 2250 additions and 1239 deletions

View File

@@ -20,9 +20,7 @@ function pickAnthropicEnv(): { type: "oauth" | "api"; value: string } | null {
}
function pickZaiKey(): string | null {
return (
process.env.ZAI_API_KEY?.trim() ?? process.env.Z_AI_API_KEY?.trim() ?? null
);
return process.env.ZAI_API_KEY?.trim() ?? process.env.Z_AI_API_KEY?.trim() ?? null;
}
async function runCommand(
@@ -74,9 +72,7 @@ async function main() {
process.exit(1);
}
const baseDir = await fs.mkdtemp(
path.join(os.tmpdir(), "openclaw-zai-fallback-"),
);
const baseDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-zai-fallback-"));
const stateDir = path.join(baseDir, "state");
const configPath = path.join(baseDir, "openclaw.json");
await fs.mkdir(stateDir, { recursive: true });
@@ -130,28 +126,14 @@ async function main() {
"Then use the read tool to display the file contents. Reply with just the file contents.";
const run1 = await runCommand(
"run1",
[
"openclaw",
"agent",
"--local",
"--session-id",
sessionId,
"--message",
toolPrompt,
],
["openclaw", "agent", "--local", "--session-id", sessionId, "--message", toolPrompt],
envValidAnthropic,
);
if (run1.code !== 0) {
process.exit(run1.code ?? 1);
}
const sessionFile = path.join(
stateDir,
"agents",
"main",
"sessions",
`${sessionId}.jsonl`,
);
const sessionFile = path.join(stateDir, "agents", "main", "sessions", `${sessionId}.jsonl`);
const transcript = await fs.readFile(sessionFile, "utf8").catch(() => "");
if (!transcript.includes('"toolResult"')) {
console.warn("Warning: no toolResult entries detected in session history.");
@@ -162,15 +144,7 @@ async function main() {
"What is the content of zai-fallback-tool.txt? Reply with just the contents.";
const run2 = await runCommand(
"run2",
[
"openclaw",
"agent",
"--local",
"--session-id",
sessionId,
"--message",
followupPrompt,
],
["openclaw", "agent", "--local", "--session-id", sessionId, "--message", followupPrompt],
envInvalidAnthropic,
);