Skip to content

fix: validate blank message submission / 修复空消息提交校验 - #34

Merged
tiye merged 1 commit into
mainfrom
fix/blank-message-submit
Sep 1, 2026
Merged

fix: validate blank message submission / 修复空消息提交校验#34
tiye merged 1 commit into
mainfrom
fix/blank-message-submit

Conversation

@tiye

@tiye tiye commented Sep 1, 2026

Copy link
Copy Markdown
Member

English

Follow-up to #33: blank composer submissions could still reset the chat and enter Streaming before validation, while the prompt validator returned a non-string success value under the current alerts contract.

  • return an empty String from the Reply prompt validator success path;
  • validate blank text before API-key lookup and before any Store mutation;
  • show an alerts-based “Please enter text” message;
  • keep the existing chat/session state unchanged for invalid input.

中文

这是 #33 的后续修复:空白输入仍会在校验前重置聊天并进入 Streaming,同时 Reply prompt validator 的成功分支在新版 alerts 契约下返回了非字符串值。

  • Reply prompt validator 的成功分支返回空字符串;
  • 在 API key 查询及任何 Store 修改之前校验空白文本;
  • 通过 alerts 显示 “Please enter text”;
  • 非法输入时保持现有聊天/会话状态不变。

Validation / 验证

  • calcit edit format
  • calcit --check-only
  • calcit js
  • msg-buffer config module resolved to the local Respo checkout, then check/codegen passed / 通过 msg-buffer config module 指向本地 Respo 后检查与编译通过
  • clean browser smoke on 127.0.0.1:5182: blank Submit shows the alert, does not enter Streaming, and logs no runtime error / 干净浏览器环境验证空提交只显示提示、不进入 Streaming、无运行时错误

Copilot AI lite review requested due to automatic review settings September 1, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes correctly block blank submissions before any API-key lookup and prevent unintended state transitions while matching the alerts validator contract (string return).

Pull request overview

Addresses a follow-up validation gap where blank submissions could still transition the chat into a “Streaming” flow (and mutate state) before input validation, and aligns the Reply prompt validator with the updated alerts contract by returning a string on success.

Changes:

  • Make the Reply prompt validator return an empty string on success (and an error string on blank input).
  • Add an alerts-based “Please enter text” alert and short-circuit blank submissions before API-key lookup / message submission.
  • Ensure invalid (blank) input does not reset chat/session state or trigger streaming.
File summaries
File Description
calcit.cirru Updates prompt validation and submit flow to block blank submissions early and display an alerts-based “Please enter text” without mutating chat/session state.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tiye
tiye merged commit 2af9902 into main Sep 1, 2026
2 checks passed
@tiye
tiye deleted the fix/blank-message-submit branch September 1, 2026 11:52
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.

2 participants