fix(desktop): resolve all remaining P1 defects (P1-02/05/06, P1-01 experimental)
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (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
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (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
- P1-02: Heartbeat auto-initialized in kernel_init for default agent - P1-05: CloneManager shows warning when deleting active agent + auto-switch - P1-06: AgentInfo returns soul/system_prompt/temperature/max_tokens - P1-01: Browser Hand marked experimental (requires Fantoccini bridge) - Updated DEFECT_LIST.md: all P1 resolved (0 active) - Updated RELEASE_READINESS.md: all P1 sections reflect current status
This commit is contained in:
@@ -31,8 +31,24 @@ export function CloneManager() {
|
||||
}, [connected, loadClones]);
|
||||
|
||||
const handleDelete = async (id: string) => {
|
||||
if (confirm('确定删除该分身?')) {
|
||||
const active = useConversationStore.getState().currentAgent;
|
||||
const isActive = active?.id === id;
|
||||
const remainingCount = clones.length > 0 ? clones.length - 1 : agents.length - 1;
|
||||
|
||||
if (isActive && remainingCount <= 0) {
|
||||
// Cannot delete the only agent
|
||||
return;
|
||||
}
|
||||
|
||||
const message = isActive
|
||||
? '该分身当前正在使用中,删除后将自动切换到其他分身。确定删除?'
|
||||
: '确定删除该分身?';
|
||||
|
||||
if (confirm(message)) {
|
||||
await deleteClone(id);
|
||||
// Auto-switch: syncAgents handles fallback to first remaining agent
|
||||
const updatedClones = useAgentStore.getState().clones;
|
||||
useChatStore.getState().syncAgents(updatedClones);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ export interface AgentInfo {
|
||||
messageCount: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
soul?: string;
|
||||
systemPrompt?: string;
|
||||
temperature?: number;
|
||||
maxTokens?: number;
|
||||
}
|
||||
|
||||
export interface CreateAgentRequest {
|
||||
|
||||
Reference in New Issue
Block a user