From fcc6a253b5d7c35fe0b1ef589fc9153ff17b21df Mon Sep 17 00:00:00 2001 From: Tom Tong Date: Thu, 18 Jun 2026 21:44:43 +0000 Subject: [PATCH 1/2] frontend: subpath-safe fetch() in /model command cmdModel() had the only two root-absolute fetch('/api/...') calls left in the frontend. Under a reverse proxy that mounts the app at a subpath (e.g. jupyter-server-proxy at /proxy//), a root-absolute path escapes the mount and 404s, so /model can't load the catalog or update the session. Resolve both against document.baseURI (falling back to location.href) like every other fetch in the frontend already does. Co-Authored-By: Claude Opus 4.8 --- static/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/commands.js b/static/commands.js index 2cd0c6ad..ec7daaf7 100644 --- a/static/commands.js +++ b/static/commands.js @@ -547,7 +547,7 @@ async function cmdModel(args){ // CLI resolves against the full catalog, so /model must too. (#3368) let modelsData=null; try { - const resp=await fetch('/api/models'); + const resp=await fetch(new URL('api/models',document.baseURI||location.href).href); if(resp.ok){ modelsData=await resp.json(); const aliases=modelsData.aliases||{}; @@ -587,7 +587,7 @@ async function cmdModel(args){ if(!match && !versionedNoSnap && S&&S.session&&S.session.session_id){ const provider=q.slice(0,q.indexOf('/')); try{ - const resp=await fetch('/api/session/update',{ + const resp=await fetch(new URL('api/session/update',document.baseURI||location.href).href,{ method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({ From 6a7c18fc6dc712766c4d9b1aff4eb569120b514c Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Fri, 19 Jun 2026 03:02:29 +0000 Subject: [PATCH 2/2] =?UTF-8?q?release:=20v0.51.508=20=E2=80=94=20/model?= =?UTF-8?q?=20command=20works=20under=20reverse-proxy=20subpath=20(#4448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: tomtong2015 Closes #4448 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4faa20..e0464e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ ## [Unreleased] +## [v0.51.508] — 2026-06-19 — Release RS (the /model command works under a reverse-proxy subpath) + +### Fixed + +- **The `/model` slash command now works when the WebUI is served under a subpath (#3368 follow-up).** Its two API calls (`/api/models` and `/api/session/update`) used root-absolute paths that broke behind a reverse proxy mounting the app under a subpath; they now resolve relative to `document.baseURI`, matching how the rest of the app builds API URLs. Thanks @tomtong2015. + ## [v0.51.507] — 2026-06-19 — Release RR (jump-to-question button stays usable on mobile) ### Fixed