feat(hooks): remind users to start new sessions - #257
Conversation
|
已提交 PR #257 实现该功能。\n\n主要实现:\n- 在 上计数用户轮次\n- 在 上输出可见提醒\n- 默认阈值 20,支持 覆盖\n- 支持 永久关闭\n- 支持回复 "关闭轮次提醒" / "disable turn hint" 静默当前会话 |
|
Reviewed the diff and ran the PR branch locally — A few non-blocking suggestions: 1. 2. session-id derivation is inconsistent with the other Stop handlers 3. (very minor) mute keyword uses substring match None of these block merge; #1 is the one I'd fix to keep the helper and actual usage in sync. |
- Use isTurnHintDisabled() helper in both handlers - Derive session id with includeCwd to align with other stop handlers
|
@jeff-r2026 Thanks for the review. Updated per your suggestions:\n\n1. Both handlers now use the |

Summary
Adds a turn-limit hint that nudges users to start a new session once a conversation reaches a configurable threshold. A
prompt-submithandler counts human turns and schedules a user-visible reminder delivered by astophandler after the assistant's current response completes.TEAMAI_TURN_LIMIT).TEAMAI_TURN_HINT_DISABLED=1.Type of Change
Test Plan
npx tsc --noEmitpassesnpx vitest runpasses for affected test filesRelated Issues
Closes #227
Notes for Reviewers
stophook rather thanprompt-submitbecauseprompt-submit'sadditionalContextis not reliably surfaced to users. The counter records state onprompt-submit; the reminder is rendered after the assistant finishes its current turn.onAcceptedwhen the dispatcher actually selects the handler's output, avoiding lost reminders when a higher-priority stop handler wins.