Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/octop-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
all_plats = [
{"plat": "linux-amd64", "arch": "amd64", "os": "ubuntu-latest"},
{"plat": "linux-arm64", "arch": "arm64", "os": "ubuntu-24.04-arm"},
{"plat": "darwin-arm64", "arch": "arm64", "os": "macos-14"},
{"plat": "darwin-arm64", "arch": "arm64", "os": "macos-15"},
{"plat": "darwin-amd64", "arch": "amd64", "os": "macos-15-intel"},
{"plat": "windows-amd64", "arch": "amd64", "os": "windows-latest"},
{"plat": "windows-arm64", "arch": "arm64", "os": "windows-11-arm"},
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@

## [Unreleased]

### 新增
- 无全局 API Key 的供应商(无鉴权端点或按人鉴权)可以正常使用:模型可用性不再要求凭据
- 专家市场默认打开「精选」,用书签标出接入市场前随安装包提供的 22 个专家模板

### 修复
- 关机时会等正在进行的数据库查询结束再关闭连接,避免 Windows 上测试进程被访问冲突打断
- 模型池里的优先模型可以取消,并且不再显示为聊天框里的选中模型。聊天框只显示专家默认模型或这场对话的手选模型
- 添加云端协同时,权限不足、连接被占用、连到本机或达到条数上限会立刻显示可读错误,不再重试原始关闭帧
- 同一专家的不同会话不再互相取消正在等待的提问。侧栏展开时可以拖右缘改宽度
- 重名的模型供应商返回冲突,不再报服务器错误。知识库引用只包含实际写进上下文的文档
- 备份落到另一块磁盘时不再丢文件。两个账号在同一浏览器里不再共用主题
- 未读数字可以打开对应会话。自定义 ACP 显示自己的名称,HTML 预览里的页内链接留在预览框内
- 供应商的默认模型可以清空并保持为空。对话里的模型名与选择时一致,能区分不同厂家的同名模型
- 服务端升级后,登录页和已登录页面都会提示刷新前端。PostgreSQL 备份缺少客户端工具时会说明原因,Docker 镜像带上该工具
- 专家配置文件改为文本框编辑,打开时不再停在编辑器加载中

## [1.0.3b4] - 2026-11-06

### 新增
Expand Down Expand Up @@ -70,6 +86,7 @@
- 表单和对话可以让 AI 润色。搜索增加 DeepSeek 与元宝,模型支持 OpenAI Responses API

### 修复
- 记忆配置 API 支持独立开关自动记录对话与自动注入召回结果,显式关闭时正确传递到运行时,避免配置被静默忽略(#2282)。
- 云端协同共享后可以直接对话。回复进行中不会被刷新冲掉,也不能删掉这场会话
- 手机截图写到专家自己的工作区。只改定时任务文案时,间隔任务不再重新计时
- 浏览器工作台恢复中文输入。主动关怀等对话安静后再发
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import OidcComplete from "./pages/Login/OidcComplete";
import SetupPage from "./pages/Setup";
import InvitePage from "./pages/Invite";
import AuthGuard from "./components/AuthGuard";
import PwaUpdatePrompt from "./components/PwaUpdatePrompt";
import OctopSpinner from "./components/OctopSpinner";
import { AntdAppProvider } from "./components/AntdAppProvider";
import GlobalErrorBoundary from "./components/ErrorBoundary";
Expand Down Expand Up @@ -132,6 +133,7 @@ function ThemedApp() {
{desktopChrome ? (
<DesktopWindowControls chrome={desktopChrome} />
) : null}
<PwaUpdatePrompt />
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route path="/login/oidc/complete" element={<OidcComplete />} />
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/api/modules/expertMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export interface MarketExpert {
skill_slugs?: string[];
skill_count?: number;
source?: string;
/** True when this card is a template that ships with Octop. */
featured?: boolean;
content?: LocalizedText;
quick_prompts?: ExpertMarketQuickPrompt[];
task_examples?: { zh?: string[]; en?: string[] } | null;
Expand Down
7 changes: 7 additions & 0 deletions dashboard/src/api/modules/octopThreads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export interface OctopThread {
turn_active?: boolean;
/** True when this thread is paused on a HITL approval or question. */
awaiting_user?: boolean;
/** Shared with other users who can open this expert. */
contributed?: boolean;
/** False when the thread was contributed by someone else. */
owned?: boolean;
}

export interface OctopThreadHistory {
Expand Down Expand Up @@ -117,6 +121,7 @@ export interface ThreadDeleteResult {
export interface OctopThreadPatch {
title?: string;
pinned?: boolean;
contributed?: boolean;
model_ref?: string | null;
reasoning_mode?: "auto" | "enabled" | "disabled" | null;
reasoning_effort?: string | null;
Expand Down Expand Up @@ -240,6 +245,8 @@ export const octopThreadsApi = {
thread_id: string;
title: string | null;
pinned?: boolean;
contributed?: boolean;
owned?: boolean;
model_ref?: string | null;
reasoning_mode?: "auto" | "enabled" | "disabled" | null;
reasoning_effort?: string | null;
Expand Down
6 changes: 6 additions & 0 deletions dashboard/src/components/AuthGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { authApi, type OctopUser } from "../api/modules/auth";
import { applyUserLocale } from "../utils/locale";
import { isNetworkFetchError } from "../utils/networkError";
import { CurrentUserProvider } from "../hooks/useCurrentUser";
import { useTheme } from "../context/ThemeContext";
import BootOfflinePanel from "./BootOfflinePanel";

interface AuthGuardProps {
Expand Down Expand Up @@ -42,6 +43,11 @@ export default function AuthGuard({ children }: AuthGuardProps) {
const [checking, setChecking] = useState(true);
const [authed, setAuthed] = useState(false);
const [user, setUser] = useState<OctopUser | null>(null);
const { bindUser } = useTheme();
useEffect(() => {
bindUser(user?.id ?? null);
return () => bindUser(null);
}, [user?.id, bindUser]);
const [offline, setOffline] = useState(false);
const [retryKey, setRetryKey] = useState(0);

Expand Down
3 changes: 2 additions & 1 deletion dashboard/src/components/PwaUpdatePrompt/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
border: 1px solid var(--fn-border-primary, rgba(255, 255, 255, 0.08));
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
z-index: 9999;
white-space: nowrap;
max-width: calc(100vw - 24px);
flex-wrap: wrap;
animation: slideUp 0.25s ease;
}

Expand Down
37 changes: 23 additions & 14 deletions dashboard/src/components/PwaUpdatePrompt/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { applyUpdate } from "../../pwa";
import { applyUpdate, hasPendingAppUpdate } from "../../pwa";
import { updateApi } from "../../api/modules/update";
import { useCurrentUser } from "../../hooks/useCurrentUser";
import { userCan } from "../../utils/permissions";
Expand All @@ -16,14 +16,16 @@ export const PWA_UPDATE_DISMISSED_KEY = "pwa:update-dismissed";
/**
* Listens for the "pwa:update-ready" event (dispatched by sw-register.ts) and
* renders a dismissible banner so the user can choose when to reload.
* Designed to be mounted once in MainLayout.
* Mount once above the router so the login page sees it too. If the event
* fired before this component mounted, the waiting worker is checked directly.
*
* Only users allowed to update see the banner: applying it restarts the backend
* service, which requires the ``update`` permission. Non-admins are not prompted.
* The banner is shown on every page, including login. Reloading picks up the
* new frontend.
* Restarting the backend service still requires the ``update`` permission.
*
* When the process is running as a system service (OCTOP_SERVICE_MODE is
* set), clicking the update-now action also triggers a backend service restart so that
* the new Python package takes effect alongside the new frontend bundle.
* set) and the user may update, clicking the action also restarts the backend
* so the new Python package takes effect alongside the new frontend bundle.
*/
export default function PwaUpdatePrompt() {
const { t } = useTranslation();
Expand All @@ -34,16 +36,23 @@ export default function PwaUpdatePrompt() {
const canUpdate = userCan(user, "update");

useEffect(() => {
const handler = () => {
let cancelled = false;
const show = () => {
try {
if (sessionStorage.getItem(PWA_UPDATE_DISMISSED_KEY)) return;
} catch {
// private mode / storage disabled — still allow the prompt
}
setVisible(true);
if (!cancelled) setVisible(true);
};
window.addEventListener("pwa:update-ready", show);
void hasPendingAppUpdate().then((pending) => {
if (pending) show();
});
return () => {
cancelled = true;
window.removeEventListener("pwa:update-ready", show);
};
window.addEventListener("pwa:update-ready", handler);
return () => window.removeEventListener("pwa:update-ready", handler);
}, []);

// Fetch service mode once so we know whether to also restart the backend.
Expand All @@ -55,13 +64,13 @@ export default function PwaUpdatePrompt() {
.catch(() => {});
}, [canUpdate]);

if (!canUpdate || !visible) return null;
if (!visible) return null;

const handleUpdate = async () => {
setVisible(false);
// If running as a system service, trigger backend restart first.
// applyUpdate() reloads once after posting SKIP_WAITING.
if (serviceMode) {
// Frontend reload is enough for everyone. Only an operator may restart
// the backend service that is serving this page.
if (canUpdate && serviceMode) {
updateApi.restartService().catch(() => {});
}
await applyUpdate();
Expand Down
6 changes: 6 additions & 0 deletions dashboard/src/components/RailEdgeControl.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
width: 12px;
}

.edgePassThrough {
/* The rail itself must not cover a resize handle. The collapse button
stays pointer-events: none until a hover rule reveals it. */
pointer-events: none;
}

.line {
position: absolute;
top: 0;
Expand Down
7 changes: 7 additions & 0 deletions dashboard/src/components/RailEdgeControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ interface RailEdgeControlProps {
* ``before`` / ``after`` sit on either side when two rails share one line.
*/
placement?: "center" | "before" | "after";
/**
* Let pointer events fall through the rail so a resize handle underneath
* stays usable. The collapse button itself still receives clicks.
*/
passThrough?: boolean;
}

/**
Expand All @@ -39,6 +44,7 @@ export default function RailEdgeControl({
className,
showLine = true,
placement = "center",
passThrough = false,
}: RailEdgeControlProps) {
const { t } = useTranslation();
const ariaLabel =
Expand All @@ -53,6 +59,7 @@ export default function RailEdgeControl({
styles.edge,
side === "start" ? styles.edgeStart : styles.edgeEnd,
!expanded && styles.edgeCollapsed,
passThrough && styles.edgePassThrough,
className,
)}
>
Expand Down
21 changes: 21 additions & 0 deletions dashboard/src/context/AgentContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,27 @@ describe("mapBridgeAgent", () => {
expect(mapped.owner_username).toBe("Alice");
});

it("keeps a shared peer expert's default model for the chat picker", () => {
const mapped = mapBridgeAgent(
{
agent_id: "bridge:cid:01AGENT",
name: "Peer",
is_owner: false,
is_shared: true,
default_model: "prov/shared-default",
},
{
...conn,
is_owner: false,
owner_username: "alice",
owner_display_name: "Alice",
},
);
expect(mapped.is_shared).toBe(true);
expect(mapped.is_owner).toBe(false);
expect(mapped.default_model).toBe("prov/shared-default");
});

it("keeps management when this user owns the link and the peer owns the expert", () => {
const mapped = mapBridgeAgent(
{
Expand Down
33 changes: 32 additions & 1 deletion dashboard/src/context/ThemeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import {
useState,
useEffect,
useCallback,
useRef,
type ReactNode,
} from "react";
import {
defaultAppearance,
loadAppearanceOnBoot,
readStoredAppearance,
writeStoredAppearance,
type ThemePreference,
} from "../styles/appearanceStorage";
Expand Down Expand Up @@ -43,6 +46,8 @@ interface ThemeContextValue {
toggle: () => void;
/** Whether the current mode is considered "dark" for Ant Design */
isDark: boolean;
/** Load the signed-in user's palette. ``null`` restores the shared boot theme. */
bindUser: (userId: number | null) => void;
}

const ThemeContext = createContext<ThemeContextValue>({
Expand All @@ -55,6 +60,7 @@ const ThemeContext = createContext<ThemeContextValue>({
setCustomColor: () => {},
toggle: () => {},
isDark: false,
bindUser: () => {},
});

function resolveMode(pref: ThemePreference): ThemeMode {
Expand Down Expand Up @@ -91,6 +97,27 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
);

const [mode, setMode] = useState<ThemeMode>(() => resolveMode(preference));
const userIdRef = useRef<number | null>(null);

const bindUser = useCallback((userId: number | null) => {
if (userIdRef.current === userId) return;
const previous = userIdRef.current;
userIdRef.current = userId;
if (userId == null) {
if (previous != null) {
const defaults = defaultAppearance();
setPreferenceState(defaults.preference);
setPaletteState(defaults.palette);
setCustomColorState(defaults.customColor ?? "");
writeStoredAppearance(defaults, null);
}
return;
}
const stored = readStoredAppearance(userId);
setPreferenceState(stored.preference);
setPaletteState(stored.palette);
setCustomColorState(stored.customColor ?? "");
}, []);

// Listen for system color scheme changes when preference is "system"
useEffect(() => {
Expand All @@ -111,7 +138,10 @@ export function ThemeProvider({ children }: { children: ReactNode }) {

// Persist preference + palette together (mode is derived, not stored)
useEffect(() => {
writeStoredAppearance({ preference, palette, customColor });
writeStoredAppearance(
{ preference, palette, customColor },
userIdRef.current,
);
document.documentElement.setAttribute("data-palette", palette);
}, [preference, palette, customColor]);

Expand Down Expand Up @@ -185,6 +215,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
setCustomColor,
toggle,
isDark: isDarkMode(mode),
bindUser,
}}
>
{children}
Expand Down
38 changes: 38 additions & 0 deletions dashboard/src/hooks/useAuthImageSrc.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { afterEach, describe, expect, it, vi } from "vitest";

vi.mock("../api/request", () => ({
requestBlob: vi.fn(async () => new Blob(["img"], { type: "image/png" })),
}));

import { requestBlob } from "../api/request";
import { acquireAuthImageSrc, releaseAuthImageSrc } from "./useAuthImageSrc";

afterEach(() => {
vi.mocked(requestBlob).mockClear();
});

describe("auth image cache", () => {
it("keeps an idle object URL so the next mount does not refetch", async () => {
const created: string[] = [];
const revoked: string[] = [];
vi.stubGlobal("URL", {
createObjectURL: (blob: Blob) => {
const url = `blob:${created.length}:${blob.size}`;
created.push(url);
return url;
},
revokeObjectURL: (url: string) => {
revoked.push(url);
},
});

const first = await acquireAuthImageSrc("/api/avatar/keep");
releaseAuthImageSrc("/api/avatar/keep");
const second = await acquireAuthImageSrc("/api/avatar/keep");
releaseAuthImageSrc("/api/avatar/keep");

expect(second).toBe(first);
expect(requestBlob).toHaveBeenCalledTimes(1);
expect(revoked).not.toContain(first);
});
});
Loading
Loading