[PR #27] [MERGED] feat: add qwen code support #27

Closed
opened 2026-03-04 01:39:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/yigitkonur/cli-continues/pull/27
Author: @yigitkonur
Created: 3/2/2026
Status: Merged
Merged: 3/2/2026
Merged by: @yigitkonur

Base: mainHead: feat/qwen-code-parser


📝 Commits (1)

  • 0239af8 feat: add qwen code (qwen-code) as supported tool

📊 Changes

9 files changed (+611 additions, -27 deletions)

View changed files

📝 src/__tests__/e2e-conversions.test.ts (+6 -1)
📝 src/__tests__/extract-handoffs.ts (+5 -1)
📝 src/__tests__/fixtures/index.ts (+93 -8)
📝 src/__tests__/schemas.test.ts (+3 -3)
📝 src/__tests__/unit-conversions.test.ts (+79 -14)
📝 src/parsers/index.ts (+1 -0)
src/parsers/qwen-code.ts (+406 -0)
📝 src/parsers/registry.ts (+17 -0)
📝 src/types/tool-names.ts (+1 -0)

📄 Description

adds qwen code (qwen cli from QwenLM/qwen-code) as the 16th supported tool.

what changed:

  • new parser at src/parsers/qwen-code.ts — reads ~/.qwen/tmp/<hash>/chats/*.jsonl (ChatRecord JSONL format, forked from gemini cli)
  • registered in registry with binary qwen, resume via --continue, storage path ~/.qwen/tmp/*/chats/
  • fixture + all 30 new conversion test paths (240 total, up from 210)
  • 692 tests passing, zero type errors

technical notes:

  • qwen code stores sessions as append-only JSONL with tree-structured messages (uuid/parentUuid)
  • message content uses google's Content format: message.parts[].text
  • tool invocations extracted from functionCall parts + enriched toolCallResult metadata
  • project dirs are sha256 hashes of the working directory path
  • reuses gemini's flag mapper since qwen-code is forked from gemini cli

closes #12


Open with Devin

Review all of them with eye of John Carmack-like simplicity with elegeance approach and apply the one only if required

Greptile Summary

Adds qwen-code (16th tool) - follows 4-step registration checklist, includes fixture and 30 new test paths. Parser correctly streams JSONL, uses SummaryCollector, and reuses gemini's flag mapper since qwen-code is forked from gemini CLI.

Critical issue:

  • Lines 82 & 162 use unsafe as casts instead of Zod validation - violates zod-schema-validation rule. Must create QwenChatRecordSchema in src/types/schemas.ts and use .safeParse() like gemini.ts does.

Minor issues:

  • Line 385 manually slices messages instead of using trimMessages() helper (though gemini.ts also does this)
  • Line 17 imports unused trimMessages

Fix the Zod validation before merging - malformed session files will crash the CLI instead of being skipped.

Confidence Score: 2/5

  • Not safe to merge - missing Zod validation will crash on malformed session files
  • Score reflects critical correctness bug (unsafe casts) that violates explicit architectural rule and creates runtime crash risk. Otherwise clean implementation following gemini pattern.
  • src/parsers/qwen-code.ts (add Zod schema validation), src/types/schemas.ts (create QwenChatRecordSchema)

Important Files Changed

Filename Overview
src/parsers/qwen-code.ts New qwen-code parser added - follows gemini pattern well, but missing critical Zod validation on lines 82 & 162
src/types/tool-names.ts Added qwen-code to TOOL_NAMES array - clean, correct
src/parsers/registry.ts Qwen Code registration complete - reuses gemini flag mapper appropriately, all ToolAdapter fields present
src/tests/fixtures/index.ts Added createQwenCodeFixture with realistic JSONL data - follows established patterns

Last reviewed commit: 0239af8


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/yigitkonur/cli-continues/pull/27 **Author:** [@yigitkonur](https://github.com/yigitkonur) **Created:** 3/2/2026 **Status:** ✅ Merged **Merged:** 3/2/2026 **Merged by:** [@yigitkonur](https://github.com/yigitkonur) **Base:** `main` ← **Head:** `feat/qwen-code-parser` --- ### 📝 Commits (1) - [`0239af8`](https://github.com/yigitkonur/cli-continues/commit/0239af85b2c0bb1d039e18aca0400e88cdecd5e4) feat: add qwen code (qwen-code) as supported tool ### 📊 Changes **9 files changed** (+611 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/__tests__/e2e-conversions.test.ts` (+6 -1) 📝 `src/__tests__/extract-handoffs.ts` (+5 -1) 📝 `src/__tests__/fixtures/index.ts` (+93 -8) 📝 `src/__tests__/schemas.test.ts` (+3 -3) 📝 `src/__tests__/unit-conversions.test.ts` (+79 -14) 📝 `src/parsers/index.ts` (+1 -0) ➕ `src/parsers/qwen-code.ts` (+406 -0) 📝 `src/parsers/registry.ts` (+17 -0) 📝 `src/types/tool-names.ts` (+1 -0) </details> ### 📄 Description adds qwen code (`qwen` cli from [QwenLM/qwen-code](https://github.com/QwenLM/qwen-code)) as the 16th supported tool. **what changed:** - new parser at `src/parsers/qwen-code.ts` — reads `~/.qwen/tmp/<hash>/chats/*.jsonl` (ChatRecord JSONL format, forked from gemini cli) - registered in registry with binary `qwen`, resume via `--continue`, storage path `~/.qwen/tmp/*/chats/` - fixture + all 30 new conversion test paths (240 total, up from 210) - 692 tests passing, zero type errors **technical notes:** - qwen code stores sessions as append-only JSONL with tree-structured messages (uuid/parentUuid) - message content uses google's Content format: `message.parts[].text` - tool invocations extracted from `functionCall` parts + enriched `toolCallResult` metadata - project dirs are sha256 hashes of the working directory path - reuses gemini's flag mapper since qwen-code is forked from gemini cli closes #12 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/yigitkonur/cli-continues/pull/27" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> <!-- greptile_comment --> # Review all of them with eye of John Carmack-like simplicity with elegeance approach and apply the one only if required <h3>Greptile Summary</h3> Adds qwen-code (16th tool) - follows 4-step registration checklist, includes fixture and 30 new test paths. Parser correctly streams JSONL, uses SummaryCollector, and reuses gemini's flag mapper since qwen-code is forked from gemini CLI. **Critical issue:** - Lines 82 & 162 use unsafe `as` casts instead of Zod validation - violates `zod-schema-validation` rule. Must create `QwenChatRecordSchema` in `src/types/schemas.ts` and use `.safeParse()` like gemini.ts does. **Minor issues:** - Line 385 manually slices messages instead of using `trimMessages()` helper (though gemini.ts also does this) - Line 17 imports unused `trimMessages` Fix the Zod validation before merging - malformed session files will crash the CLI instead of being skipped. <details><summary><h3>Confidence Score: 2/5</h3></summary> - Not safe to merge - missing Zod validation will crash on malformed session files - Score reflects critical correctness bug (unsafe casts) that violates explicit architectural rule and creates runtime crash risk. Otherwise clean implementation following gemini pattern. - src/parsers/qwen-code.ts (add Zod schema validation), src/types/schemas.ts (create QwenChatRecordSchema) </details> <details open><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | src/parsers/qwen-code.ts | New qwen-code parser added - follows gemini pattern well, but missing critical Zod validation on lines 82 & 162 | | src/types/tool-names.ts | Added `qwen-code` to TOOL_NAMES array - clean, correct | | src/parsers/registry.ts | Qwen Code registration complete - reuses gemini flag mapper appropriately, all ToolAdapter fields present | | src/__tests__/fixtures/index.ts | Added createQwenCodeFixture with realistic JSONL data - follows established patterns | </details> </details> <sub>Last reviewed commit: 0239af8</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:39:19 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cli-continues#27
No description provided.