You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -486,6 +486,14 @@ This document outlines significant changes and updates to the LLM Interactive Pr
486
486
-**Structured Error Responses**: Returns detailed 400 Bad Request responses with measured vs. limit token counts and error codes.
487
487
-**Configuration Integration**: CLI override takes precedence over config file settings while maintaining compatibility with existing configurations.
488
488
-**Environment Variable Support**: Sets `FORCE_CONTEXT_WINDOW` environment variable for downstream processes.
489
+
490
+
## 2025-10-31 - ZAI Coding Plan GLM 4.6 Support
491
+
492
+
-**Model Updates**: ZAI coding plan now preserves the client-provided model and defaults to `glm-4.6`, keeping `claude-sonnet-4-20250514` available as a legacy option.
493
+
-**Anthropic Routing**: Chat controller now forwards the resolved model name to the Anthropic compatibility path instead of forcing `claude-sonnet-4-20250514`.
494
+
-**API Headers**: ZAI connector overrides `get_headers` to include the current KiloCode metadata required by the upstream service.
495
+
-**Capabilities**: Model capability registry exposes entries for `glm-4.6`, `zai-coding-plan`, and the legacy Claude variant with updated metadata.
496
+
-**Testing & Docs**: Unit/integration tests and documentation refreshed to reflect GLM 4.6, with new coverage ensuring headers and payload models are preserved.
489
497
-**Schema Validation**: Updated YAML schema to support the new `context_window_override` field.
490
498
-**Comprehensive Testing**: Full test coverage for CLI argument parsing, enforcement logic, and edge cases.
491
499
-**Documentation**: Enhanced README with detailed examples, use cases, and troubleshooting guidance.
Enhanced the Qwen OAuth connector to support reasoning effort levels by automatically appending " /think" to messages when reasoning effort is set to medium or high.
5
+
6
+
## Implementation Details
7
+
8
+
### Changes Made
9
+
1.**Modified `src/connectors/qwen_oauth.py`**:
10
+
- Updated `chat_completions()` method to detect `reasoning_effort` parameter
11
+
- When `reasoning_effort` is "medium" or "high", appends " /think" to the last client message
12
+
- Only appends to user or system messages, not tool responses
13
+
- Handles both Pydantic models and dict message formats
14
+
15
+
### How It Works
16
+
- The connector checks if `reasoning_effort` is set to "medium" or "high"
17
+
- It finds the last client message (user or system role, skipping tool responses)
18
+
- Appends " /think" to the content of that message
19
+
- This triggers Qwen's extended reasoning mode for more thoughtful responses
20
+
21
+
### Usage Example
22
+
```python
23
+
request = ChatRequest(
24
+
model="qwen-turbo",
25
+
messages=[
26
+
ChatMessage(role="user", content="What is 2+2?")
27
+
],
28
+
reasoning_effort="medium"# or "high"
29
+
)
30
+
```
31
+
32
+
The message will be transformed to: "What is 2+2? /think"
33
+
34
+
### Test Coverage
35
+
Created comprehensive test suite in `tests/unit/test_qwen_oauth_reasoning_effort.py`:
36
+
- ✅ Test reasoning_effort="medium" appends " /think"
37
+
- ✅ Test reasoning_effort="high" appends " /think"
38
+
- ✅ Test reasoning_effort="low" does NOT append
39
+
- ✅ Test no reasoning_effort does NOT append
40
+
- ✅ Test skips tool response messages
41
+
- ✅ Test works with system messages
42
+
- ✅ Test works with multiple messages (only last user message modified)
43
+
- ✅ Test works with Pydantic ChatMessage objects
44
+
45
+
All 132 qwen-related tests pass, including the 8 new tests.
46
+
47
+
## Behavior
48
+
-**reasoning_effort="low"**: No modification (standard behavior)
49
+
-**reasoning_effort="medium"**: Appends " /think" to last client message
50
+
-**reasoning_effort="high"**: Appends " /think" to last client message
51
+
-**No reasoning_effort**: No modification (standard behavior)
52
+
53
+
## Notes
54
+
- The " /think" suffix is only appended to regular messages, not tool call responses
55
+
- The modification happens before the message is sent to the Qwen API
56
+
- This feature is specific to the Qwen OAuth connector and leverages Qwen's native reasoning capabilities
0 commit comments