From 9093d20fcf94facf25deca5c6f492a6b3252d964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=87=AF90331?= <90331@sangfor.com> Date: Tue, 19 May 2026 17:57:38 +0800 Subject: [PATCH] fix: favorite list route should respect type query parameter The /global/favorite/skills GET route was hardcoded to list only skill-type favorites, causing cloud hub to show Cloud status for non-skill favorites (agent, command, mcp) even after they were loaded locally. Now it reads the optional type query parameter and passes it to listFavoriteItems, matching the opencode server behavior. Co-Authored-By: Claude Opus 4.7 --- src/server/routes/favorite.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/routes/favorite.ts b/src/server/routes/favorite.ts index d7aaab968..3062dcc8e 100644 --- a/src/server/routes/favorite.ts +++ b/src/server/routes/favorite.ts @@ -3,6 +3,7 @@ import { listFavoriteItems, loadFavoriteItem, unloadFavoriteItem, + type FavoriteItemType, } from '../../costrict/favorite/favorite.js' import { notFound } from '../errors.js' @@ -10,7 +11,8 @@ export function createFavoriteRoutes(): Hono { return new Hono() .get('/global/favorite/skills', async c => { try { - const items = await listFavoriteItems('skill') + const type = c.req.query('type') as FavoriteItemType | undefined + const items = await listFavoriteItems(type) return c.json({ success: true, items }) } catch (error) { const message = error instanceof Error ? error.message : String(error)