Skip to content

Commit bf7648b

Browse files
committed
Fix Meta smoke screenshot path resolution
1 parent 63646c9 commit bf7648b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.agents/skills/update-models/reference/discover-models.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env tsx
2+
import { existsSync } from "node:fs";
23
import { readFile, writeFile } from "node:fs/promises";
34
import { homedir } from "node:os";
45
import { join } from "node:path";
@@ -201,7 +202,12 @@ async function discoverMeta(args: Args): Promise<Record<string, unknown>> {
201202

202203
async function smokeMeta(client: any, model: string): Promise<SmokeResult> {
203204
try {
204-
const screenshot = await readFile(join(process.cwd(), "packages", "ai", "examples", "screenshot.png"));
205+
const screenshotPath = [
206+
join(process.cwd(), "examples", "screenshot.png"),
207+
join(process.cwd(), "packages", "ai", "examples", "screenshot.png"),
208+
].find(existsSync);
209+
if (!screenshotPath) throw new Error("could not find packages/ai/examples/screenshot.png");
210+
const screenshot = await readFile(screenshotPath);
205211
const response = await client.responses.create({
206212
model,
207213
store: false,

0 commit comments

Comments
 (0)