Add provider/model selection for schedules and workspace fetch debug logging

- Unify resolveProviderAndModel across CLI and server, supporting
  provider/model syntax (e.g. codex/gpt-5.4) for agent runs and schedules
- Add --provider flag to schedule create CLI and both MCP schedule tools
- Add structured debug logging to workspace fetch hydrate, sidebar
  refresh, and real-time update paths
- Update orchestrate skill references
This commit is contained in:
Mohamed Boudra
2026-04-14 14:42:10 +07:00
parent 202fa3e8f3
commit dd6a396dbf
17 changed files with 1209 additions and 161 deletions
@@ -9,6 +9,10 @@ import { useSidebarOrderStore } from "@/stores/sidebar-order-store";
import type { WorkspaceDescriptor } from "@/stores/session-store";
import type { WorkspaceDescriptorPayload } from "@server/shared/messages";
import { projectDisplayNameFromProjectId } from "@/utils/project-display-name";
import {
summarizeSidebarProjects,
summarizeWorkspaceCollection,
} from "@/utils/workspace-fetch-debug";
const EMPTY_ORDER: string[] = [];
const EMPTY_PROJECTS: SidebarProjectEntry[] = [];
@@ -284,6 +288,20 @@ export function useSidebarWorkspacesList(options?: {
});
}, [persistedProjectOrder, persistedWorkspaceOrderByScope, serverId, sessionWorkspaces]);
useEffect(() => {
if (!serverId) {
return;
}
console.log("[WorkspaceFetch][sidebar] model", {
serverId,
connectionStatus,
hasHydratedWorkspaces,
sessionWorkspaces: summarizeWorkspaceCollection(sessionWorkspaces?.values()),
projects: summarizeSidebarProjects(projects),
});
}, [connectionStatus, hasHydratedWorkspaces, projects, serverId, sessionWorkspaces]);
useEffect(() => {
if (!serverId || projects.length === 0) {
return;
@@ -327,10 +345,21 @@ export function useSidebarWorkspacesList(options?: {
let cursor: string | null = null;
try {
while (true) {
console.log("[WorkspaceFetch][sidebar-refresh] request", {
serverId,
cursor,
existingWorkspaces: summarizeWorkspaceCollection(existingWorkspaces?.values()),
});
const payload = await client.fetchWorkspaces({
sort: [{ key: "activity_at", direction: "desc" }],
page: cursor ? { limit: 200, cursor } : { limit: 200 },
});
console.log("[WorkspaceFetch][sidebar-refresh] response", {
serverId,
cursor,
pageInfo: payload.pageInfo,
payload: summarizeWorkspaceCollection(payload.entries),
});
for (const entry of payload.entries) {
const workspace = toWorkspaceDescriptor(entry);
next.set(
@@ -349,7 +378,16 @@ export function useSidebarWorkspacesList(options?: {
const store = useSessionStore.getState();
store.setWorkspaces(serverId, next);
store.setHasHydratedWorkspaces(serverId, true);
} catch {
console.log("[WorkspaceFetch][sidebar-refresh] applied", {
serverId,
nextWorkspaces: summarizeWorkspaceCollection(next.values()),
});
} catch (error) {
console.error("[WorkspaceFetch][sidebar-refresh] failed", {
serverId,
cursor,
error,
});
// ignore explicit refresh failures; hook keeps existing data
}
})();