Desktop: per-session mode, thinking/reasoning effort, and model selection — plus auto context-window from OpenAI-compatible /models metadata
- Ngôn ngữ chính
- Rust
- Star
- 54.2k
- Fork
- 6.2k
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 240
Mô tả
### Summary
Desktop app: make chat mode, thinking/reasoning effort, and model selection per-session (not global/shared), and auto-derive each model's context window from the provider's OpenAI-compatible `/models` metadata instead of a hardcoded 128k fallback.
### Background / current behavior (Windows Desktop)
- Changing the context window or reasoning effort in one chat affects other chats — these are stored as shared provider/profile config, not per session.
- Third-party OpenAI-compatible models (my LiteLLM gateway) always show a `0/128k` context window, regardless of the model's real limit.
- There is no per-session way to set mode / reasoning / model from the UI — slash commands like `/model` and `/mode` do not work in the desktop session box.
### Requested behavior
1. **Per-session controls:** each chat has its own mode (Agent / Auto / Plan / Chat), thinking/reasoning effort, and model selection — independent of other chats, similar to the Claude Desktop app.
2. **Automatic context window:** detect the real context limit from the provider. My gateway already returns per-model metadata:
```bash
curl https://litellm.usc1.gcp.kibocommerce.com/v1/models \
-H "Authorization: Bearer $KEY"
```
Each model includes `max_input_tokens`, e.g. `1048576` for `glm-5.2`, `kimi-k3`, `deepseek-v4-pro`, and `262144` for `qwen3.8`. Goose should use that value for the `0/X` counter and for compaction, instead of defaulting to 128k.
3. Context window should be **per model per session**, so a mixed provider (some 1M, one 256k) needs no provider-duplication workaround.
### Environment
- OS & Arch: Windows
- Interface: Desktop (GUI)
- Provider: custom OpenAI-compatible (LiteLLM gateway)
### Related existing issues
- #11558 — live-first provider metadata incl. reasoning (recommend coordinating here)
- #11335 — per-chat backends / per-session scoping
- #11881 — closed: Windows GUI 128k default
- #11729 — stale desktop context counter
- [x] I checked for duplicates — this is the per-session scope + generic OpenAI-compatible `/models` auto-detect delta on top of #11558/#11335.
Hướng dẫn đóng góp
Hướng nghiên cứu
The issue relates to the desktop GUI's session management and provider integration. Start by examining the code for session state storage and the provider metadata fetching logic, likely in the desktop client's source. Look for where the context window is currently hardcoded and where model selection is stored globally. Check related issues #11558 and #11335 for context. 'Done' means each chat session independently stores its mode, reasoning effort, and model, and the context window is dynamically fetched from the provider's /models endpoint.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- ai-infra-agents, desktop
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100