Skip to content

fix(tui): prevent prompt submit storms#1307

Open
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/939-multiline-paste-single-submit
Open

fix(tui): prevent prompt submit storms#1307
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/939-multiline-paste-single-submit

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • add a single-flight guard around normal prompt submissions
  • block duplicate prompt submits until the session leaves busy state and returns idle
  • release the guard on dispatch failure or if no run status arrives after dispatch

This mitigates terminal paste fallbacks that send multiline clipboard content as a stream of Return key events, which could otherwise submit each pasted line as a separate prompt.

Fixes #939

Tests

  • bun test test/cli/cmd/tui --timeout 30000
  • bun typecheck
  • git diff --check

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.

粘贴长json会自动截断输入发出消息,卡顿,同时导致接入的deepseek api出现异常扣费情况

1 participant