Skip to content

fix: preserve starter prompt errors with dismissible retry feedback - #1706

Open
LittleSound wants to merge 2 commits into
mainfrom
fix/memoh-240-starter-prompt-errors
Open

LittleSound wants to merge 2 commits into
mainfrom
fix/memoh-240-starter-prompt-errors

Conversation

@LittleSound

@LittleSound LittleSound commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Author

  • Human
  • Agent

Type

  • bug
  • feat
  • test

Summary

Starter prompt generation failures previously became successful empty responses, hiding the suggestion area on initial load and reducing refresh failures to a generic toast. Propagate operational failures through the standard Problem Details boundary and show a localized error with its Request ID while retaining cached suggestions and retry controls.

The error banner has its own dismiss button. Dismissing it preserves suggestions and Refresh, including when no suggestions are cached. A subsequent failed attempt shows the new error again. Missing title-model configuration retains its existing empty-state behavior; provider diagnostics remain server-side.

Related Issues

MEMOH-240

Validation

  • Regression tests reproduced swallowed backend failures and missing frontend error/dismiss behavior before implementation.
  • Targeted starter prompt Go tests passed; error boundary and handler tests passed.
  • Starter prompt query/component Vitest tests: 7 passed. Existing error parsing tests: 123 passed.
  • pnpm run lint --fix: no errors, 20 existing warnings.
  • pnpm --filter @memohai/web run typecheck: passed (the root package has no typecheck script).
  • UI contract guard and git diff --check: passed; guard reports 3 existing warnings.
  • Real application: isolated memoh-240 stack, backend localhost:18380, Vite http://127.0.0.1:25101. Generated suggestions, disabled the local title model, confirmed an actual HTTP error with Request ID, dismissed the banner without losing suggestions, and retried to confirm a new failure reappears. Repeated without cached suggestions: dismiss leaves Refresh available. Restored the model and confirmed successful retry clears the error.
  • Agent browser verification only; no production configuration or billing changes. The seeded semantic-memory configuration logged a connection refusal; suggestion generation still succeeded through its existing best-effort path.

2026-11-22 合并冲突验证(Agent)

  • 合入 origin/main 的 fb0014607478cd1666598fc5dfbc9379b17c2a90。唯一文本冲突在 zh.json 的 chatExamples:保留本 PR 的 dismissError,同时采用主分支无句号的 noBot;其余代码自动合并,未扩大功能范围。
  • 中英日 locale 均通过重复键检查;除原 PR 新增的 dismissError 外,与主分支文案一致。
  • 127 个前端测试通过(推荐 query、组件与 API 错误解析);推荐问题 Go 回归测试以及 apperror、server、handlers 测试通过。Web 类型检查通过;根包没有 typecheck 脚本,使用 pnpm --filter @memohai/web run typecheck。
  • pnpm run lint --fix 无错误、33 条既有警告;UI contract 和 settings rows 守卫通过;相对主分支的 git diff --check 通过。完整 mise run lint(包含 Go lint)也通过,耗时约 6 分钟。最终提交 771b18649 的全部提交钩子(ESLint、Go lint、所选 Go 包测试)通过。
  • 真实环境:隔离 memoh-pr1706,Server http://localhost:18480、Channel 18481、Web http://127.0.0.1:25100/bot/gamer,服务均健康,后端挂载当前合并后的工作区。
  • 真实 UI 操作:中文桌面页面点击“换一批”,在仅此测试副本临时禁用标题模型后得到真实 HTTP 500,显示本地化错误与 Request ID;点击“关闭错误提示”后仍保留“换一批”;再次点击显示新的错误与不同 Request ID。对应后端日志已核对,测试模型配置已恢复。
  • 检查恢复记录:共享 lint 缓存曾产生 t.Fatal 后的 SA5011 告警,换用任务独立缓存后同一代码通过,未关闭任何规则(上游同类记录)。提交钩子中的 recovers_subscriber_buffer_overflow 曾出现一次 5 秒时序超时,单独复跑及随后完整钩子重跑通过;未修改无关测试。
  • 清理:已恢复测试模型配置并停止专用浏览器、Vite 和隔离后端,删除本任务测试卷;未触碰其他环境。
  • 验证范围:本轮验证了无缓存的中文错误、关闭与再次失败流程。种子模型的外部服务返回 502,本轮未验证成功生成;缓存保留与成功重试由现有回归测试覆盖。下方旧截图和旧验证保留为历史记录,不作为本轮证据。Human QA 未勾选。

Screenshots / Recordings

本轮冲突解决后的真实应用截图(2026-11-22):

中文错误显示 Request ID

关闭错误后仍可重试

再次重试显示新的 Request ID

Local development data only.

Error banner with its independent close button:
Dismissible error

After dismissal, suggestions and Refresh remain:
Error dismissed

A subsequent failure is shown again:
New error after retry

With no cached suggestions, dismissing still preserves Refresh:
Retry retained without cache

Successful retry after restoring the local model:
Recovery

Human QA

  • Human QA passed

2026-11-03 local verification: Chinese starter prompts refresh successfully after aligning noBot punctuation with main. Backend localhost:18380, Web 127.0.0.1:25100. Agent verification only.

@github-actions github-actions Bot added bug Fixes a bug or unexpected behavior change:server Changes backend code, configuration, or API contracts change:web Changes web frontend or shared frontend packages size:S PR size uses the larger of added or deleted lines, excluding generated files labels Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes a bug or unexpected behavior change:server Changes backend code, configuration, or API contracts change:web Changes web frontend or shared frontend packages size:S PR size uses the larger of added or deleted lines, excluding generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants