fix(desktop): session persistence — refresh/login/context/empty-content 4-bug fix
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

1. App.tsx: add restoreSession() call on startup to prevent redirect
   to login page after refresh (isRestoring guard + BootstrapScreen)
2. CloneManager: call syncAgents() after loadClones() to restore
   currentAgent and conversation history on app load
3. zclaw-memory: add get_or_create_session() so frontend session UUID
   is persisted directly — kernel no longer creates mismatched IDs
4. openai.rs: assistant message content must be non-empty for
   Kimi/Qwen APIs — replace empty content with meaningful placeholders

Also includes admin-v2 ModelServices unified page (merge providers +
models + API keys into expandable row layout)
This commit is contained in:
iven
2026-03-31 13:38:59 +08:00
parent 3e5d64484e
commit 6cae768401
29 changed files with 1982 additions and 933 deletions

View File

@@ -5,10 +5,10 @@
import { useState } from 'react'
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { Button, message, Tag, Modal, Form, Input, Select, Popconfirm, Space } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
import type { ProColumns } from '@ant-design/pro-components'
import { ProTable } from '@ant-design/pro-components'
import { accountService } from '@/services/accounts'
import { PageHeader } from '@/components/PageHeader'
import type { AccountPublic } from '@/types'
const roleLabels: Record<string, string> = {
@@ -116,7 +116,10 @@ export default function Accounts() {
hideInSearch: true,
render: (_, record) => (
<Space>
<Button size="small" onClick={() => { setEditingId(record.id); form.setFieldsValue(record); setModalOpen(true) }}>
<Button
size="small"
onClick={() => { setEditingId(record.id); form.setFieldsValue(record); setModalOpen(true) }}
>
</Button>
{record.status === 'active' ? (
@@ -142,6 +145,8 @@ export default function Accounts() {
return (
<div>
<PageHeader title="账号管理" description="管理系统用户账号、角色与权限" />
<ProTable<AccountPublic>
columns={columns}
dataSource={data?.items ?? []}
@@ -158,13 +163,13 @@ export default function Accounts() {
/>
<Modal
title="编辑账号"
title={<span className="text-base font-semibold"></span>}
open={modalOpen}
onOk={handleSave}
onCancel={() => { setModalOpen(false); setEditingId(null); form.resetFields() }}
confirmLoading={updateMutation.isPending}
>
<Form form={form} layout="vertical">
<Form form={form} layout="vertical" className="mt-4">
<Form.Item name="display_name" label="显示名">
<Input />
</Form.Item>