fix: Found and fix review mistakes

This commit is contained in:
Petr Mironychev
2026-07-02 22:26:07 +02:00
parent c070d65366
commit 35bbaa1af0
139 changed files with 2032 additions and 1573 deletions

View File

@@ -63,15 +63,24 @@ Agent(config, provider)
validated at load against a synthetic context
provider.setPromptCaching(cfg.cachePrompt, cfg.cacheTtl == "1h")
SessionManager — two ways to obtain a Session:
• createSession(agentName, externalHistory?) — chat: attaches a persistent,
externally-owned history
SessionManager — three ways to obtain a Session:
• createDetachedSession(externalHistory) — chat: one persistent, caller-owned
session over an externally-owned
history; the agent is (re)bound via
rebindAgentByName when the picker
changes (rebinding cancels any
in-flight request)
• createSession(agentName, externalHistory?) — manager-tracked session, removed
via removeSession
• acquire(agentName) / release(session) — one-shot pipelines: a small
per-agent pool of internal-history
sessions; acquire hands out a
session with cleared history,
cleared system-prompt layers and
cleared client tools
cleared system-prompt layers,
cleared client tools and cleared
pinned context / content loader /
bindings; release refuses to pool
external-history sessions
Session(agent[, externalHistory])
├─ ConversationHistory — messages as polymorphic ContentBlocks
@@ -214,20 +223,24 @@ ChatRootView (QML) — owns ConversationHistory m_history
chatAssistant allow-list; active agent persisted
▼ dispatchSend
ClientInterface
session = sessionManager.createSession(activeAgent, m_history)
session = sessionManager.createDetachedSession(m_history) — one persistent
session per chat view; ensureAgentBound → rebindAgentByName on
picker change
sessionManager.toolContributors().contribute(client.tools()) — builtin+skills+MCP
session.setContentLoader(ChatSerializer::loadContentFromStorage)
systemPrompt layer "chat.context" = project info + skills + linked files
session.send( blocks{ TextContent + StoredAttachmentContent + StoredImageContent } )
▼ consumes Session signals (NOT raw client signals):
event(Usage) → ChatModel.setMessageUsage + token-counter calibration
finished(id) → ChangesManager.applyPendingEditsForRequest + persist;
removeSession (the persistent history survives)
failed(id, ErrorInfo) → surface error; removeSession
finished(id) → ChangesManager.applyPendingEditsForRequest + persist
failed(id, ErrorInfo) → surface error
cancelled(id) → clear busy state (the persistent session and history survive
every outcome)
ChatCompressor → acquire(chatCompression agent — single configured) → seed history
from the chat's messages → "compression" layer → send → read summary
from the compression session's own history → release
ChatCompressor → acquire(chatCompression agent — single configured) → send the
flattened transcript as one user message → read summary from the
compression session's own history → write a fresh v0.3 file →
release
InputTokenCounter → estimates over ConversationHistory (calibrated by Usage events)
ChatSerializer → persists ConversationHistory via MessageSerializer (v0.3);
imports legacy v0.1/v0.2 files

View File

@@ -1,16 +1,12 @@
# Configure for Anthropic Claude
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to Provider Settings tab and configure Claude api key
3. Return to General tab and configure:
- Set "Claude" as the provider for code completion or/and chat assistant
- Set the Claude URL (https://api.anthropic.com)
- Select your preferred model (e.g., claude-3-5-sonnet-20241022)
- Choose the Claude template for code completion or/and chat
<details>
<summary>Example of Claude settings: (click to expand)</summary>
<img width="823" alt="Claude Settings" src="https://github.com/user-attachments/assets/828e09ea-e271-4a7a-8271-d3d5dd5c13fd" />
</details>
1. Open Qt Creator settings and navigate to QodeAssist > Providers
2. Select the bundled **Claude** provider and enter your Anthropic API key
3. Go to QodeAssist > General > Agent Pipelines and assign Claude agents to the features you want:
- Code completion: **Claude Completion**
- Chat assistant: **Claude Chat — Sonnet** (or an Opus variant)
- Chat compression: **Claude Compression**
- Quick refactor: **Claude Quick Refactor** (or the Fast variant)
To change the model or request parameters, duplicate the bundled agent on the
QodeAssist > Agents page (it extends the Claude base agent) and edit your copy.

View File

@@ -1,16 +1,12 @@
# Configure for Google AI
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to Provider Settings tab and configure Google AI api key
3. Return to General tab and configure:
- Set "Google AI" as the provider for code completion or/and chat assistant
- Set the OpenAI URL (https://generativelanguage.googleapis.com/v1beta)
- Select your preferred model (e.g., gemini-2.0-flash)
- Choose the Google AI template
<details>
<summary>Example of Google AI settings: (click to expand)</summary>
<img width="829" alt="Google AI Settings" src="https://github.com/user-attachments/assets/046ede65-a94d-496c-bc6c-41f3750be12a" />
</details>
1. Open Qt Creator settings and navigate to QodeAssist > Providers
2. Select the bundled **Google AI** provider and enter your Google AI Studio API key
3. Go to QodeAssist > General > Agent Pipelines and assign Google agents to the features you want:
- Code completion: **Google Completion**
- Chat assistant: **Google Chat**
- Chat compression: **Google Compression**
- Quick refactor: **Google Quick Refactor**
To change the Gemini model or request parameters, duplicate the bundled agent on
the QodeAssist > Agents page (it extends the Google base agent) and edit your copy.

View File

@@ -1,16 +1,14 @@
# Configure for llama.cpp
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to General tab and configure:
- Set "llama.cpp" as the provider for code completion or/and chat assistant
- Set the llama.cpp URL (e.g. http://localhost:8080)
- Fill in model name
- Choose template for model(e.g. llama.cpp FIM for any model with FIM support)
- Disable using tools if your model doesn't support tooling
<details>
<summary>Example of llama.cpp settings: (click to expand)</summary>
<img width="829" alt="llama.cpp Settings" src="https://github.com/user-attachments/assets/8c75602c-60f3-49ed-a7a9-d3c972061ea2" />
</details>
1. Start `llama-server` locally (default http://localhost:8080)
2. Open Qt Creator settings and navigate to QodeAssist > Providers
- Select the bundled **llama.cpp** provider and adjust the URL if your server runs elsewhere (no API key needed)
3. Go to QodeAssist > General > Agent Pipelines and assign llama.cpp agents to the features you want:
- Code completion: **LlamaCpp Completion — FIM** (needs a FIM-capable model)
- Chat assistant: **LlamaCpp Chat**
- Chat compression: **LlamaCpp Compression**
- Quick refactor: **LlamaCpp Quick Refactor**
To change the model or request parameters, duplicate the bundled agent on the
QodeAssist > Agents page (it extends the llama.cpp base agent) and edit your
copy. Disable `enable_tools` in your agent if the model doesn't support tool calling.

View File

@@ -1,16 +1,13 @@
# Configure for Mistral AI
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to Provider Settings tab and configure Mistral AI api key
3. Return to General tab and configure:
- Set "Mistral AI" as the provider for code completion or/and chat assistant
- Set the OpenAI URL (https://api.mistral.ai)
- Select your preferred model (e.g., mistral-large-latest)
- Choose the Mistral AI template for code completion or/and chat
<details>
<summary>Example of Mistral AI settings: (click to expand)</summary>
<img width="829" alt="Mistral AI Settings" src="https://github.com/user-attachments/assets/1c5ed13b-a29b-43f7-b33f-2e05fdea540c" />
</details>
1. Open Qt Creator settings and navigate to QodeAssist > Providers
2. Select the bundled **Mistral AI** provider and enter your Mistral API key
- For Codestral code completion, configure the separate **Codestral** provider — it uses its own key and endpoint (codestral.mistral.ai)
3. Go to QodeAssist > General > Agent Pipelines and assign Mistral agents to the features you want:
- Code completion: **Mistral Completion — Codestral FIM** (needs the Codestral provider)
- Chat assistant: **Mistral Chat** (or the Reasoning variant)
- Chat compression: **Mistral Compression**
- Quick refactor: **Mistral Quick Refactor**
To change the model or request parameters, duplicate the bundled agent on the
QodeAssist > Agents page (it extends the Mistral base agent) and edit your copy.

View File

@@ -17,14 +17,13 @@ ollama run qwen2.5-coder:32b
```
3. Open Qt Creator settings (Edit > Preferences on Linux/Windows, Qt Creator > Preferences on macOS)
4. Navigate to the "QodeAssist" tab
5. On the "General" page, verify:
- Ollama is selected as your LLM provider
- The URL is set to http://localhost:11434
- Your installed model appears in the model selection
- The prompt template is Ollama Auto FIM or Ollama Auto Chat for chat assistance. You can specify template if it is not work correct
- Disable using tools if your model doesn't support tooling
6. Click Apply if you made any changes
4. Navigate to QodeAssist > Providers and verify the bundled **Ollama (Native)** provider points at http://localhost:11434 (no API key needed)
5. Navigate to QodeAssist > General > Agent Pipelines — the Ollama agents are assigned by default:
- Code completion: **Ollama Completion — FIM** (needs a base/FIM model; use **Ollama Completion — Chat-style** for instruct models)
- Chat assistant: **Ollama Chat — Simple / Thinking / Gemma 4**
- Chat compression: **Ollama Compression — 8 GB** (or the 16/32 GB tier for your machine)
- Quick refactor: **Ollama Quick Refactor — Simple**
6. Point the agents at models you actually have (see the next section)
You're all set! QodeAssist is now ready to use in Qt Creator.
@@ -55,45 +54,13 @@ swap it (Change…) for one you already have.
## Extended Thinking Mode
Ollama supports extended thinking mode for models that are capable of deep reasoning (such as DeepSeek-R1, QwQ, and similar reasoning models). This mode allows the model to show its step-by-step reasoning process before providing the final answer.
Ollama supports native reasoning for models trained for it (Qwen3.5, Gemma 4, DeepSeek-R1, QwQ, …). Reasoning is streamed into collapsible "Thinking" blocks in the chat.
### How to Enable
Thinking is a property of the **agent**, not a global switch:
**For Chat Assistant:**
1. Navigate to Qt Creator > Preferences > QodeAssist > Chat Assistant
2. In the "Extended Thinking (Claude, Ollama)" section, check "Enable extended thinking mode"
3. Select a reasoning-capable model (e.g., deepseek-r1:8b, qwq:32b)
4. Click Apply
- For chat, pick a thinking agent in the chat panel: **Ollama Chat — Thinking** or **Ollama Chat — Gemma 4**
- For quick refactor, assign **Ollama Quick Refactor — Qwen3.5** or **— Gemma 4** in Agent Pipelines
- In your own agents, set `think = true` in the `[body]` table (top level, not under `[body.options]`)
**For Quick Refactoring:**
1. Navigate to Qt Creator > Preferences > QodeAssist > Quick Refactor
2. Check "Enable Thinking Mode"
3. Configure thinking budget and max tokens as needed
4. Click Apply
### Supported Models
Thinking mode works best with models specifically designed for reasoning:
- **DeepSeek-R1** series (deepseek-r1:8b, deepseek-r1:14b, deepseek-r1:32b)
- **QwQ** series (qwq:32b)
- Other models trained for chain-of-thought reasoning
### How It Works
When thinking mode is enabled:
1. The model generates internal reasoning (visible in the chat as "Thinking" blocks)
2. After reasoning, it provides the final answer
3. You can collapse/expand thinking blocks to focus on the final answer
4. Temperature is automatically set to 1.0 for optimal reasoning performance
**Technical Details:**
- Thinking mode adds the `enable_thinking: true` parameter to requests sent to Ollama
- This is natively supported by the Ollama API for compatible models
- Works in both Chat Assistant and Quick Refactoring contexts
<details>
<summary>Example of Ollama settings: (click to expand)</summary>
<img width="824" alt="Ollama Settings" src="https://github.com/user-attachments/assets/ed64e03a-a923-467a-aa44-4f790e315b53" />
</details>
Use a reasoning-capable model with these agents — a non-reasoning model simply ignores the flag.

View File

@@ -1,32 +1,18 @@
# Configure for OpenAI
QodeAssist supports both OpenAI's standard Chat Completions API and the new Responses API, giving you access to the latest GPT models including GPT-5.1 and GPT-5.1-codex.
QodeAssist supports both OpenAI's standard Chat Completions API and the Responses API, giving you access to the latest GPT models.
## Standard OpenAI Configuration
1. Open Qt Creator settings and navigate to QodeAssist > Providers
2. Select the bundled **OpenAI (Chat Completions)** or **OpenAI (Responses API)** provider and enter your OpenAI API key
3. Go to QodeAssist > General > Agent Pipelines and assign OpenAI agents to the features you want:
- Code completion: **OpenAI Completion**
- Chat assistant: **OpenAI Chat**, **OpenAI Chat — Mini** (Chat Completions), or **OpenAI Chat — Responses**
- Chat compression: **OpenAI Compression**
- Quick refactor: **OpenAI Quick Refactor**
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to Provider Settings tab and configure OpenAI api key
3. Return to General tab and configure:
- Set "OpenAI" as the provider for code completion or/and chat assistant
- Set the OpenAI URL (https://api.openai.com)
- Select your preferred model (e.g., gpt-4o, gpt-5.1, gpt-5.1-codex)
- Choose the OpenAI template for code completion or/and chat
<details>
<summary>Example of OpenAI settings: (click to expand)</summary>
<img width="829" alt="OpenAI Settings" src="https://github.com/user-attachments/assets/4716f790-6159-44d0-a8f4-565ccb6eb713" />
</details>
## OpenAI Responses API Configuration
The Responses API is OpenAI's newer endpoint that provides enhanced capabilities and improved performance. It supports the latest GPT-5.1 models.
1. Open Qt Creator settings and navigate to the QodeAssist section
2. Go to Provider Settings tab and configure OpenAI api key
3. Return to General tab and configure:
- Set "OpenAI Responses" as the provider for code completion or/and chat assistant
- Set the OpenAI URL (https://api.openai.com)
- Select your preferred model (e.g., gpt-5.1, gpt-5.1-codex)
- Choose the OpenAI Responses template for code completion or/and chat
To change the model or request parameters, duplicate the bundled agent on the
QodeAssist > Agents page (it extends the OpenAI base agent) and edit your copy.
Note for GPT-5 family models on Chat Completions: use `max_completion_tokens`
(not `max_tokens`) and `reasoning_effort` in the agent `[body]`; reasoning
models reject `temperature`.

View File

@@ -9,11 +9,11 @@ Make sure you're using the correct default URLs:
- **LM Studio**: `http://localhost:1234`
- **llama.cpp**: `http://localhost:8080`
### 2. Check model and template compatibility
### 2. Check agent and model compatibility
- Ensure the correct model is selected in settings
- Verify that the selected prompt template matches your model
- Some models may not support certain features (e.g., tool calling)
- Ensure each Agent Pipelines slot (QodeAssist > General) has an agent assigned — an unassigned slot disables that feature
- Verify the agent's model exists on your provider (check the agent on the QodeAssist > Agents page)
- Some models may not support certain features (e.g., tool calling or native FIM completion) — pick an agent variant that matches your model
### 3. Linux compatibility
@@ -31,7 +31,7 @@ If issues persist, you can reset settings to their default values:
**Note:**
- API keys are preserved during reset
- You will need to re-select your model after reset
- Resetting the General page restores the default local Ollama agent pipelines — re-assign your own agents afterwards
## Chat History Migration