What happened
Editing the declared context window for a custom model and clicking Save once can persist the previous value instead of the value currently shown in the input. As a result, the usage view can still report that the context limit is unknown or continue using the stale limit.
Expected behavior: the value displayed in the context-window input is persisted by the first Save click.
How to reproduce
- Open Settings → Models and select a custom OpenAI-compatible connection.
- Add a custom model with a context window such as
128000.
- Open that model's capability settings.
- Change the context window to
258000.
- Without clicking elsewhere first, click Save once.
- Read the connection snapshot or reopen the settings.
The saved relayModelProfiles[modelId].contextWindow remains 128000. A second Save persists 258000.
Environment
- Maka commit:
2bdabbe62
- OS: macOS 15.7.3
- Surface: Desktop
- Node.js: v24.14.0
Logs, screenshots, or additional context
NumberInput already buffers text and commits it on blur/Enter. DeclaredContextWindowField adds another local draft and commit boundary, so the blur caused by clicking Save updates only the inner draft while the row-level Save reads the previous value.
A deterministic Electron E2E reproduces the defect by changing 128000 to 258000, clicking Save once, and asserting the persisted connection snapshot.
Submitted with Codex assistance on behalf of @liuxiaocs7.
What happened
Editing the declared context window for a custom model and clicking Save once can persist the previous value instead of the value currently shown in the input. As a result, the usage view can still report that the context limit is unknown or continue using the stale limit.
Expected behavior: the value displayed in the context-window input is persisted by the first Save click.
How to reproduce
128000.258000.The saved
relayModelProfiles[modelId].contextWindowremains128000. A second Save persists258000.Environment
2bdabbe62Logs, screenshots, or additional context
NumberInputalready buffers text and commits it on blur/Enter.DeclaredContextWindowFieldadds another local draft and commit boundary, so the blur caused by clicking Save updates only the inner draft while the row-level Save reads the previous value.A deterministic Electron E2E reproduces the defect by changing
128000to258000, clicking Save once, and asserting the persisted connection snapshot.Submitted with Codex assistance on behalf of @liuxiaocs7.