Chat session: add `session.reset()` for stateless single-turn requests
维护者通常 1 天内回复
@barhanc 已经在做这个了。
开始于 2026年11月27日。
评估
这个 Issue 还没有评估数据。
描述
Problem description
There is no way to clear a chat session. resetOnTurn: true sounds like it, but (as documented) it only forces full re-encoding: the session keeps the history and re-prefills all of it on every turn. Sending the same prompt four times gave 19, 45, 71 and 97 prefilled tokens. For independent single-turn requests (extraction, classification, benchmarks) the only way to get a clean context is to dispose and recreate the session.
Proposed solution
A session.reset() method that clears the history and KV cache back to initialMessages without reloading the model (react-native-litert-lm has resetConversation() for this), or an option that drops each turn from history after it completes. It would also help to state in the docs that resetOnTurn keeps and re-prefills the full history.
Alternative solutions
No response
Benefits to React Native ExecuTorch
Stateless requests are a common use of small on-device models, and recreating the session costs a model reload.
Additional context
No response
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 102
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 46
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
software-mansion/react-native-executorch 的其他 Issue
-
Require react-native-blob-util >=1.0.0 (Xcode 27 iOS build failure)可能已有人在做 @msluszniak 于 23 天前认领。 未关闭dependencies platform: ios
难度 1/5 1-3 小时 新手友好度 78/100
software-mansion/react-native-executorch#1617 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Android: prebuilt libexecutorch.so SIGILLs on ARMv8.0 CPUs (unguarded LSE atomics in the JNI layer, one-line fix upstream)可能已有人在做 @msluszniak 今天认领。 未关闭user exp
software-mansion/react-native-executorch#1665 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
software-mansion/react-native-executorch#1663 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
software-mansion/react-native-executorch#1661 ·
维护者通常 1 天内回复
-
Selfie segmentation: single-channel mask is passed through sigmoid twice可能已有人在做 @barhanc 于 1 天前认领。 未关闭model
software-mansion/react-native-executorch#1660 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 software-mansion/react-native-executorch 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
ehmpathy/rhachet-roles-bhrain#878 ·
维护者通常 1 天内回复
-
Chat UI: Message actions dropdown is cut off beneath composer when message is near bottom of chat可能已有人在做 @koeria 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
milind-soni/OpenMausBot#8023 ·
维护者通常 1 天内回复
-
Windows microphone listing treats words in a device name as DirectShow labels可能已有人在做 @Sujal-chaudhary 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
clipy-recorder/clipy#447 · 2 条评论 ·
维护者通常 1 天内回复
-
enhancement from-app needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
nightly-labs/openbot#19162 ·
维护者通常 1 天内回复
-
triage:in-progress
难度 2/5 1-3 小时 新手友好度 76/100
Cotal-AI/Cotal#11229 · 1 条评论 ·
维护者通常 1 天内回复