From 901d75391e0d3f048c518fb73bf204217cc13f07 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 19 Sep 2026 19:43:03 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20sanitize=20provider=20baseUrl=20in=20mai?= =?UTF-8?q?n=20thread=20=E2=80=94=20strip=20stray=20'@url:'=20annotation?= =?UTF-8?q?=20and=20markdown=20backticks=20pasted=20from=20chat=20(was=20p?= =?UTF-8?q?roducing=20invalid=20fetch=20URLs);=20bump=200.1.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 4669621..d4d2b10 100644 --- a/src/main.ts +++ b/src/main.ts @@ -518,7 +518,11 @@ export default function () { } catch (pe) { emit('PROBE_RESULT', { msg: 'example.com UNREACHABLE ยท ' + (pe != null ? (typeof pe === 'string' ? pe : JSON.stringify(pe)) : 'unknown') }) } - const base = payload.baseUrl.replace(/\/+$/, '') + const base = String(payload.baseUrl == null ? '' : payload.baseUrl) + .replace(/`/g, '') // drop stray markdown backticks + .replace(/^@url:\s*/i, '') // drop '@url:' annotation if pasted from chat + .trim() + .replace(/\/+$/, '') // drop trailing slashes const res = await fetch(base + '/models', { headers: { Authorization: 'Bearer ' + payload.apiKey } })