Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/framework/harness/run-eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,17 @@ async function runOne(
cliVersion?: string;
}
> {
const prompt = parseEvalMarkdown(
const previewHost = process.env.DOCS_PREVIEW_HOST;
const parsedBody = parseEvalMarkdown(
readFileSync(ev.promptPath, 'utf8'),
ev.promptPath
).body;
const prompt = previewHost
? parsedBody.replaceAll(
'https://supabase.com/docs/',
`https://${previewHost}/docs/`
)
: parsedBody;
// A CLI agent always runs in a sandbox and reads skills from disk with its
// file tools (both modes). An in-process (ai-sdk) agent has no sandbox, so in
// tools mode its skills are advertised in the prompt and loaded via the
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/docs-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ const URL_IN_COMMAND_PATTERN = /https?:\/\/[^\s'"`\\;|&>()]+/g;
*/
function isSupabaseApexUrl(value: string): boolean {
try {
return new URL(value).hostname === 'supabase.com';
const hostname = new URL(value).hostname;
return (
hostname === 'supabase.com' ||
(process.env.DOCS_PREVIEW_HOST !== undefined &&
/^docs-[a-z0-9-]+-supabase\.vercel\.app$/.test(hostname))
);
} catch {
return false;
}
Expand Down