迁移上游子智能体功能线:ChatGroup 分组体系 + subagent_model 配置 + spawn 会话归属
- chats/models.py: SessionSource.subagent + ChatGroupKind/ChatGroup/default_chat_groups + ChatSpec 扩展 group_id/parent_session_id/root_session_id/last_finished_at + ChatsFile.groups - chats/manager.py: group CRUD 方法(list/create/update/reorder/delete) + get_or_create_chat/create_chat 的 group 归属与校验 - chats/api.py: /chats/groups 端点(GET/POST/PUT order/PUT/DELETE) - config.py+agents.py: AgentConfig.subagent_model 配置 - agent_management.py: _build_subagent_request_context 补 subagent_model→model_slot_override - console.py: _chat_registration_fields 识别 spawn_subagent 请求并注册 subagent 会话 - constant.py: DEFAULT_SPAWN_FOREGROUND_TIMEOUT_SECONDS - 前端 chat.ts: groups API 请求函数
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
ChatDeleteResponse,
|
||||
ChatUpdateRequest,
|
||||
BatchArchiveResult,
|
||||
ChatGroup,
|
||||
Session,
|
||||
} from "../types";
|
||||
|
||||
@@ -126,6 +127,32 @@ export const chatApi = {
|
||||
request<void>(`/console/chat/stop?chat_id=${encodeURIComponent(chatId)}`, {
|
||||
method: "POST",
|
||||
}),
|
||||
|
||||
listGroups: () => request<ChatGroup[]>("/chats/groups"),
|
||||
|
||||
createGroup: (name: string) =>
|
||||
request<ChatGroup>("/chats/groups", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ name }),
|
||||
}),
|
||||
|
||||
updateGroup: (groupId: string, update: { name?: string; pinned?: boolean }) =>
|
||||
request<ChatGroup>(`/chats/groups/${encodeURIComponent(groupId)}`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(update),
|
||||
}),
|
||||
|
||||
reorderGroups: (groupIds: string[]) =>
|
||||
request<ChatGroup[]>("/chats/groups/order", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ group_ids: groupIds }),
|
||||
}),
|
||||
|
||||
deleteGroup: (groupId: string) =>
|
||||
request<{ success: boolean; group_id: string }>(
|
||||
`/chats/groups/${encodeURIComponent(groupId)}`,
|
||||
{ method: "DELETE" },
|
||||
),
|
||||
};
|
||||
|
||||
export const sessionApi = {
|
||||
|
||||
Reference in New Issue
Block a user