Skip to content

fix(llm): omit temperature for OpenAI GPT-6 family (#1101) - #1115

Merged
H-Chris233 merged 2 commits into
Open-Less:betafrom
HKLHaoBin:fix/1101-gpt6-temperature
Sep 27, 2026
Merged

H-Chris233 merged 2 commits into
Open-Less:betafrom
HKLHaoBin:fix/1101-gpt6-temperature

Conversation

@HKLHaoBin

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • cargo test -p openless-core --locked --lib omits_temperature
  • cargo test -p openless-core --locked --lib keeps_custom_temperature_for_gpt
  • cargo test -p openless-core --locked --lib keeps_default_temperature_for_openai_non
  • Bugbot review: no bugs
  • Fork CI + Release Tauri + Android APK (debug) workflow_dispatch on this branch: all success
  • Manual: enable system proxy, polish with GPT-6 Astra — request succeeds (no 400 on temperature)

Official openai channel already skipped temperature for gpt-5* (Open-Less#857);
GPT-6 Astra/Sol/Luna reject non-default temperature the same way. Extend
the omit rule and cover display-name / prefixed model ids in unit tests.
@H-Chris233 H-Chris233 self-assigned this Sep 27, 2026
@H-Chris233
H-Chris233 merged commit 5b39599 into Open-Less:beta Sep 27, 2026
6 checks passed
aeoform added a commit to aeoform/openless that referenced this pull request Sep 28, 2026
现场:一个跑了一晚的 UI 进程 RSS 5.8 GB(VSS 7.2 GB),但 21 小时只用了
60 秒 CPU、GPU 显存 47 MiB —— 涨的是纯内存,不是渲染,也不是泄漏式的匀速增长。

成因是三段代码凑在一起:

1. 宿主 `publish_view_model()`:内容没变也**每 2 秒发一份保活快照**。
2. UI 侧收件通道是无界 `mpsc::channel()`(`UiBridgeClient::connect`)。
3. 窗口被遮挡/不可见时,eframe 会**完全跳过 egui pass**
   (eframe 0.36 `wgpu_integration.rs` 的 `if !show_ui { /* 不做任何 egui pass */ }`),
   `UiClientApp::ui()` 根本不会被调用,也就没人排空那个通道。

于是「窗口不可见」的每一秒都在堆快照:21 小时 ≈ 3.7 万份 × ~154 KB ≈ 5.8 GB,
且窗口恢复可见后要先逐份消化积压再回到正常帧,看起来就是卡死。
旁证:健康实例每 40 秒左右会写一条 `[ui-client] ipc round-trip ...`(UI 每 2 秒
一次 ping),而那个实例 21 小时里一条都没有 —— 它的 egui pass 一直没跑。

改法:快照不再走通道,只进 `UiBridgeClient` 的**单一槽位**(`LatestSnapshot`)。
旧快照本来就会被后一份覆盖,中间那些没有任何价值;窗口每帧 `take_snapshot()`
一次即可。内存因此与「窗口被遮挡多久 / 宿主发过多少份」无关。
控制帧(Ready/Hotkeys/Pong/Focus…)照旧走通道:它们由事件驱动、体积小。

回归测试 `an_undrained_window_keeps_only_the_newest_snapshot`:连发 40 份快照、
一份都不取,断言只有序号 40 留在槽位、取走后清空、通道里一句快照都没有
(把快照改回走通道时该测试立刻超时失败,已验证)。

另外这次同步把 origin/beta 的两个提交(Open-Less#1113 空格/鼠标热键、Open-Less#1115 GPT-6 温度)
合入本分支,无冲突。

package revision 120。
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.

[area] 使用 GPT-6 进行润色的时候,预填了错误的参数。

2 participants