fix: 完善 Agent Companion 完成气泡5s自动关闭#1246
Conversation
bobleer
left a comment
There was a problem hiding this comment.
The core auto-dismiss design is sound, but there are blocking issues before this can merge.
Blocking: unrelated binary rename
This PR is about completion-bubble auto-dismiss, but it also renames bitfun-desktop -> BitFun in:
src/apps/desktop/Cargo.toml([[bin]] name)scripts/dev.cjs(binaryName)
This renames the executable on all platforms while many paths still hardcode bitfun-desktop:
BitFun-Installer/src-tauri/src/installer/mod.rs—MAIN_APP_EXE = "bitfun-desktop.exe"(used in 15+ call sites acrosscommands.rs,registry.rs,shortcut.rs)BitFun-Installer/scripts/build-installer.cjs— 5 hardcodedbitfun-desktop.exereferencestests/e2e/config/embedded-driver.ts:73— binary nametests/e2e/config/capabilities.ts:24,28—appName.github/workflows/desktop-package.yml:117— exe validation pathsrc/crates/interfaces/acp/src/client/manager.rs:597— ACP client identity stringsrc/apps/desktop/src/computer_use/desktop_host.rs— user-facing messages and comments
CI Rust Build Check only compiles and won't catch the E2E/installer/packaging breakage this causes on Windows/Linux.
Revert the binary rename from this PR. The Bitfun -> BitFun displayName branding fix is fine to keep.
Blocking: shouldMarkUnreadCompletion behavior change
Changing from conditional (sessionId !== activeSessionId || !isAppWindowFocused()) to always true has side effects:
- Every completion triggers a persistence write (
markSessionUnreadCompletion+onPersistUnreadCompletion), where previously completions on the active/focused session were skipped entirely. - Restored sessions with persisted
unreadCompletioncannot be distinguished from new completions — they immediately schedule a 5s auto-dismiss timer on app start.
Add at least one focused test covering the new semantics.
Should fix: log verbosity
Multiple log.info("[AgentCompanion auto-dismiss] ...") calls in App.tsx. The project logging guidelines require English-only logs. These timer lifecycle logs should be log.debug, not log.info.
Missing tests
No coverage for:
- Auto-dismiss timer scheduling/cancellation (
checkAndSchedule) - Cross-window
agent-companion://dismiss-completionevents - The
shouldMarkUnreadCompletionchange
…iss, add tests - Revert bitfun-desktop → BitFun binary rename in Cargo.toml and dev.cjs - Keep shouldMarkUnreadCompletion always true but skip auto-dismiss for active focused sessions (user sees completion directly in chat UI) - Change AgentCompanion auto-dismiss logs from info to debug level - Add shouldMarkUnreadCompletion to __test_only__ with 3 focused tests
…for 5s The checkAndSchedule active-focused guard was clearing unreadCompletion immediately, which prevented the Agent Companion pet from ever showing completion bubbles for the active session. Reverted to always schedule the 5 s auto-dismiss timer for every session.
|
发送多条消息后,每完成一条后观察 partner 气泡,气泡显示“已完成”后 停留 5 秒自动消失,或是点击 Agent 伙伴立即消失。 |
Summary
Fixes #
Type and Areas
Type:
Areas:
Motivation / Impact
Verification
Reviewer Notes
Checklist