Skip to content

【已审核】fix(automation): 自动任务会话始终留在自动任务区,毕业时 toast 提示#918

Merged
ErlichLiu merged 2 commits into
proma-ai:mainfrom
climashscape:fix/automation-session-graduation-feedback
Jun 25, 2026
Merged

【已审核】fix(automation): 自动任务会话始终留在自动任务区,毕业时 toast 提示#918
ErlichLiu merged 2 commits into
proma-ai:mainfrom
climashscape:fix/automation-session-graduation-feedback

Conversation

@climashscape

@climashscape climashscape commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

概述

自动任务会话之前有"毕业"机制:用户发消息后 automationGraduated=true,会话从「自动任务」组静默移到普通工作区项目列表——用户困惑"自动任务去哪了"。

本 PR 修复两个问题:

  1. 自动任务会话永远留在「自动任务」组 — 移除 isHiddenAutomationSessionautomationGroup 中对 automationGraduated 的过滤,自动任务会话无论是否被用户互动过,始终归属自动任务区
  2. 新增 toast 提示 — 用户首次向自动任务会话发消息时,toast 提示"已接管自动任务会话,后续定时运行将创建新会话"
  3. broadcastChanged 刷新会话列表 — 自动任务运行完成时同步刷新侧边栏会话列表,确保新会话及时出现

automationGraduated 字段保留且仍由 agent-service.ts 设置,调度器用它阻止向已被用户接管的会话注入新的定时运行。

改动

  • packages/shared/src/types/agent.ts (+2) — PromaEvent 新增 automation_graduated 类型
  • apps/electron/src/main/lib/agent-service.ts (+5) — 毕业时通过 eventBus 发送 proma_event
  • apps/electron/src/renderer/hooks/useGlobalAgentListeners.ts (+6) — 处理毕业事件显示 toast
  • apps/electron/src/renderer/main.tsx (+5/-1) — AutomationInitializer 同步刷新会话列表
  • apps/electron/src/renderer/components/app-shell/LeftSidebar.tsx (+5/-8) — 移除 automationGraduated 过滤,会话始终留在自动任务组

测试

  • TypeCheck 通过 (bun run typecheck)

紧急度

低 — UX 改进。

clim.ashscape added 2 commits June 24, 2026 02:32
…mation session graduates

When a user sends a message to an automation session, the session is
marked as 'graduated' (automationGraduated=true) and moves from the
automation group to the workspace's normal session list. Previously this
happened silently, causing confusion.

Changes:
- Emit 'automation_graduated' proma_event via EventBus after graduation
- Show a toast notification explaining the session has moved
- Refresh session list immediately so the sidebar updates
- Also refresh sessions when automation changed events fire
  (AutomationInitializer), ensuring new automation sessions appear
  in the sidebar automation group promptly
Remove graduation from sidebar filters — automation sessions now
always stay in the '自动任务' group even after user interaction.
Previously, sending a message would cause the session to silently
move from the automation group to the workspace project list.

The scheduler still uses automationGraduated internally to prevent
reusing user-interacted sessions for future automated runs.
@climashscape climashscape changed the title 【施工中】fix(automation): add toast notification and session refresh when automation session graduates 【施工中】fix(automation): keep automation sessions in automation group, add toast on graduation Jun 23, 2026
@climashscape climashscape marked this pull request as ready for review June 23, 2026 18:40
@climashscape climashscape changed the title 【施工中】fix(automation): keep automation sessions in automation group, add toast on graduation 【已审核】fix(automation): keep automation sessions in automation group, add toast on graduation Jun 23, 2026
@climashscape climashscape changed the title 【已审核】fix(automation): keep automation sessions in automation group, add toast on graduation 【已审核】fix(automation): 自动任务会话始终留在自动任务区,毕业时 toast 提示 Jun 23, 2026
@ErlichLiu ErlichLiu merged commit dd587e7 into proma-ai:main Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants