feat: add TUI feedback prompt after deep investigation#104
Conversation
Show "Thanks! Rate: 1-👍 2-👎 3-❌" in the status bar after deep_search runs and investigation concludes. Keyboard input records feedback (confirmed/corrected/rejected) to the memory DB via the existing updateInvestigationFeedback API. Auto-cleans up after 60s timeout or when a new message is sent.
jacoblee-io
left a comment
There was a problem hiding this comment.
Review
Clean, well-scoped PR. Reuses existing infrastructure (MemoryRef, updateInvestigationFeedback, FEEDBACK_SIGNALS) without introducing unnecessary abstractions. Cleanup is thorough (60s timeout + agent_start + unsubscribe).
Issues
1. No feedback prompt for non-DP deep_search runs in TUI
If a TUI user runs deep_search as a standalone tool (without /dp), disableDpMode never fires and feedback is never shown. The web UI has its own feedback path via InvestigationCard, but TUI users in this flow get nothing. Consider hooking feedback into tool_result directly (guarded by !checklist to avoid double-prompting), or document this as intentional.
2. feedbackCleanup not cleared on session_start — potential leak
If the session restarts while the feedback prompt is active, the stale feedbackCleanup closure (holding a setTimeout handle and onTerminalInput subscription) survives into the new session. Consider adding to the existing session_start handler:
// in session_start handler, before state reset
feedbackCleanup?.();Both are minor — the core logic is solid.
1. Show feedback prompt for standalone deep_search (no DP mode) by triggering showFeedbackIfNeeded in tool_result when !checklist. 2. Clean up stale feedback state (timer, input listener) on session_start to prevent leaks across session restarts.
jacoblee-io
left a comment
There was a problem hiding this comment.
Both items addressed in af27353. LGTM.
session_startnow cleans up stale feedback state- Standalone
deep_search(no DP mode) shows feedback viatool_resulthandler with!checklistguard
Summary
Thanks! Rate: 1-👍 2-👎 3-❌) to the TUI status bar afterdeep_searchcompletes in DP modeshowFeedbackIfNeeded()as an independent function, triggered on both auto-exit (conclusion done) and manual exit (Ctrl+I / /dp)memoryRefto the deep investigation extension so TUI can directly callupdateInvestigationFeedback()Details
The web UI already has investigation feedback via RPC + InvestigationCard. This PR adds the equivalent for TUI users:
tool_result(deep_search)capturesinvestigationIdand setsdeepSearchRanflagshowFeedbackIfNeeded()shows the feedback hintTest plan
/dp+ question), verify feedback prompt appears after conclusioninvestigationstable)deep_searchwas skipped (triage-only)