Skip to content

feat: add qwen backend support#201

Merged
vakovalskii merged 1 commit into
vakovalskii:mainfrom
dorogao5:feat/qwen-backend
Apr 21, 2026
Merged

feat: add qwen backend support#201
vakovalskii merged 1 commit into
vakovalskii:mainfrom
dorogao5:feat/qwen-backend

Conversation

@dorogao5
Copy link
Copy Markdown
Contributor

Adds Qwen Code as a first-class agent across backend flows.

What changed

  • Qwen session discovery from ~/.qwen/projects/*/(chats|sessions)/*.jsonl with version-tolerant parsing and graceful handling of missing/malformed files
  • Unified transcript parsing (loadQwenDetail, parseQwenSessionFile, scanQwenSessions)
  • Cost calculation with real usage metadata (supports unavailable pricing when model has no MODEL_PRICING entry)
  • Full-text search index support for Qwen sessions
  • Export to Markdown support
  • Active session detection (ps + lsof + explicit --session-id matching)
  • Cross-agent conversion to/from Qwen format (convert.js)
  • Handoff target support (handoff.js)
  • CLI updates: list, show, stats, handoff, convert help text and resume commands

Validation

  • node -c passed for all modified files
  • Manual checks run locally against real ~/.qwen data

This is PR 1 of 3. Frontend UI (#??? ) and terminal resume (#??? ) depend on this.

Copy link
Copy Markdown
Collaborator

@NovakPAai NovakPAai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

⚠️ padEnd doesn't work correctly with ANSI escape codes — in bin/cli.js, the list case does:

const tool = getToolDisplay(s.tool).ansi.padEnd(18);

String.prototype.padEnd counts escape code characters as visible characters, so ANSI-colored strings like \x1b[33mqwen\x1b[0m (14 chars of escape codes + 4 visible) will pad to fewer spaces than intended. The column alignment in codbash list will be off for all tools.

Suggestion: pad the plain label string and apply ANSI coloring after padding, or calculate visible length separately.

⚠️ Help text example was replaced rather than added — in the handoff help block, this was changed:

- codbash handoff 13ae5748 codex              For Codex specifically  
+ codbash handoff 13ae5748 qwen               For Qwen specifically

The Codex example was removed. A new agent shouldn't erase existing documentation — both examples should coexist.

⚠️ STATS_TOOL_ROWS is incomplete — it lists Claude, Codex, Qwen, Cursor, OpenCode, Kiro but doesn't include Kilo or other agents already supported by the project. Newly added agents (Kimi, Droid, Copilot) are also missing. The stats output will silently omit those session counts.

Copy link
Copy Markdown
Owner

@vakovalskii vakovalskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — backend follows existing Codex/Cursor patterns: parseQwenSessionFile, scanQwenSessions, loadQwenDetail with proper try/catch + version-tolerant parsing. CLI refactor to TOOL_LABELS/STATS_TOOL_ROWS makes future agent additions cleaner. Unavailable-pricing flag reuses Cursor/Kiro convention.

@vakovalskii vakovalskii merged commit e9cd96b into vakovalskii:main Apr 21, 2026
@vakovalskii vakovalskii mentioned this pull request May 25, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants