改动 / #2615
#2615 web: opt-in message editing, retry and history rewind
open · draft · @uppet · 0 评论 · 去 GitHub 看
BenchmarksSetup & installServer & APIAMD / HIPNVIDIA / CUDA
说明
Issue: Related to #271 (deleting user/assistant messages). Complements #1787's whole-chat sidebar. ## Summary When an answer loops, the built-in chat can stop it but cannot repair that conversation. Add an opt-in **Edit chat history** switch in the **Chat settings** drawer (the labelled gear button below the composer), so a user can stop the answer, rewrite a message, remove a broken suffix, or retry the turn. ## What changed - User **Edit** keeps available attachments, removes later messages, and regenerates from the edited prompt. Assistant **Edit** saves corrected text without inference and removes stale reasoning, tool calls/results, errors, and timings. - **Regenerate** retries the preceding user turn without duplicating it. **Remove from here** truncates the selected message and its descendants, keeping tool-call history together. - One-step **Undo** survives feature-driven regeneration, but expires on a new question, New chat, or reload. Busy requests and open editors block history mutations; Stop must finish first. - The settings entry has a visible **Chat settings** label (**Settings** on phones); the drawer title and help text use the same name. Ctrl/Command+Enter saves; Escape cancels. Controls wrap on narrow screens. - Reloaded attachments whose contents were not stored cannot be silently omitted during a retry. The UI asks the user to attach them again. The switch is off by default and stored separately in this browser. Sampling defaults, API payloads, server code, inference engines, and GPU backends are unchanged. This does not add a sidebar or change chat storage. ## Validation - `python3 -m unittest serve.test_web_history -v`: **16 passing** CPU/Node VM regressions, including abort/finalize ordering, failed-request Undo, stale Undo invalidation, attachments, tool cleanup, export, and reasoning-only turns. - **7 real Chromium workflows** against a temporary local mock SSE server: default-off message DOM and API payload matched unmodified upstream; user/assistant editing, retry, suffix removal, Undo, Stop boundaries, keyboard submission, preference persistence, Reset, and 320/390 px viewports passed with no page errors. - Seven browser workflows also passed on a copy of the installed **0.1.43.1** assets with a local default-on preference. The upstream implementation in this PR remains opt-in. - `node --check serve/web/app.js` and `git diff --check` passed. Based on main `296b59d2f73c8f04a805df29c2fa97655adace78`. Browser/model responses were mocked; no live-model correctness or performance benchmark is claimed. No CUDA/HIP/SYCL source changed.
本站相关内容
相关页面的快捷入口。