fix: add ASK_USER_QUESTION to statusline-setup agent, clear debounce on command change

- Agent can now ask for clarification when PS1 is not found
- Clear pending debounce timer before immediate doUpdate on command
  change to prevent redundant second execution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
wenshao 2026-04-06 14:46:02 +08:00
parent 4c4e63888a
commit 9bba05bad3
2 changed files with 6 additions and 1 deletions

View file

@ -240,6 +240,11 @@ export function useStatusLine(): {
useEffect(() => {
if (!hasMountedRef.current) return;
if (statusLineCommand) {
// Clear any pending debounce so we don't get a redundant second run.
if (debounceTimerRef.current !== undefined) {
clearTimeout(debounceTimerRef.current);
debounceTimerRef.current = undefined;
}
doUpdate();
}
// Cleanup when command is removed is handled by the state-change effect.