fix: resolve apiProxy via ctx.get for /model (v0.3.2)

Cordis throws on ctx.apiProxy without inject; use ctx.get and declare apiProxy inject so catalog and model APIs work under dsh web.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
owo
2026-08-14 20:20:55 +08:00
co-authored by Cursor
parent f433cce24d
commit 5dbe833205
18 changed files with 209 additions and 35 deletions
+6 -1
View File
@@ -36,7 +36,12 @@ export const MSG = {
return `当前绑定:${label}\n(会话当前未在内存中运行;发消息时会自动 resume。)`;
},
GONE: '绑定的会话已不可用。请重新 /sessions。',
MODEL_UNAVAILABLE: '无法读取模型列表(需要 dsh web / apiProxy)。请确认本机 Harness 已加载 host-apiproxy。',
MODEL_UNAVAILABLE(detail) {
const tip = '无法读取模型列表。请确认已绑定会话,且本机 dsh web 已加载 host-apiproxy。';
if (!detail)
return tip;
return `${tip}\n详情:${detail}`;
},
MODEL_UNROUTABLE(current) {
return `当前模型不可路由:${current}\n请在 Web 或本机配置可用 provider 后再试 /model。`;
},