Skip to content

Add Qwen Code support - #157

Merged
yourconscience merged 1 commit into
mainfrom
feat/qwen-code
Sep 3, 2026
Merged

Add Qwen Code support#157
yourconscience merged 1 commit into
mainfrom
feat/qwen-code

Conversation

@yourconscience

@yourconscience yourconscience commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Qwen Code as a detected managed harness
  • sync skills through skills.directories, roles under ~/.qwen/agents, MCP and hooks in settings.json, and root instructions through QWEN.md
  • document the verified capability surface and add focused end-to-end tests

Verification

  • go test ./...
  • isolated local dotagents setup, sync, and status against Qwen Code 0.22.3
  • Qwen mcp list read the generated MCP entry; Qwen startup loaded generated skills, roles, hooks, and root instructions without schema errors

Local limitation

  • a real model response could not be completed because the existing local Qwen authentication returns 401 invalid access token or token expired even outside the isolated test

Summary by Sourcery

Add verified Qwen Code support across the dotagents setup, sync, and status workflows.

New Features:

  • Add Qwen Code as a managed harness with support for skills, roles, MCP servers, hooks, and root instructions.

Enhancements:

  • Use Qwen Code's native configuration and file formats while preserving existing settings and avoiding duplicate skill mirrors.

Documentation:

  • Document Qwen Code's supported synchronization surfaces, role configuration, root instructions, and config-driven skills integration.

Tests:

  • Add focused capability, configuration, rendering, hook, MCP, and end-to-end synchronization tests for Qwen Code.

@sourcery-ai

sourcery-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds Qwen Code 0.22.3 support as a detected, config-driven managed harness, integrating canonical skills, native Markdown roles, MCP, hooks, and QWEN.md root instructions while preserving existing settings; focused unit and end-to-end tests and documentation cover the implementation.

Sequence diagram for Qwen Code setup and sync

sequenceDiagram
    participant User
    participant Dotagents as dotagents
    participant Settings as ~/.qwen/settings.json
    participant Skills as ~/.agents/skills
    participant Roles as ~/.qwen/agents
    participant Qwen as Qwen Code

    User->>Dotagents: setup
    Dotagents->>Settings: patchQwenConfig
    Settings-->>Dotagents: skills.directories configured
    User->>Dotagents: sync
    Dotagents->>Roles: renderQwenAgentRole
    Dotagents->>Settings: patchJSONMCPServer
    Dotagents->>Settings: patchQwenHook
    Dotagents->>Qwen: link QWEN.md
    Qwen->>Skills: load configured skill directory
    Qwen->>Roles: load Markdown roles
    Qwen->>Settings: read MCP servers and hooks
Loading

File-Level Changes

Change Details Files
Registers Qwen Code as a fully managed harness with config-driven skills, roles, MCP, hooks, and root instructions.
  • Adds Qwen detection and setup defaults rooted at ~/.qwen.
  • Uses ~/.qwen/settings.json for skills.directories and MCP server configuration while preserving unrelated settings.
  • Adapts hook timeout values from seconds to Qwen’s milliseconds and supports cleanup of managed hooks.
  • Links AGENTS.md to ~/.qwen/QWEN.md.
  • Adds Qwen role YAML-frontmatter rendering, model and approval-mode overrides, and generic tool-name mapping.
cmd/dotagents/harness.go
cmd/dotagents/doctor.go
cmd/dotagents/setup_scaffold.go
cmd/dotagents/qwen.go
cmd/dotagents/hooks.go
cmd/dotagents/agents.go
Adds focused automated coverage for Qwen capability registration, configuration patching, native rendering, and end-to-end synchronization.
  • Tests detection and native skill/role roots.
  • Verifies idempotent settings updates, malformed-input protection, and preservation of unrelated configuration.
  • Verifies MCP and hook updates share settings.json and convert hook timeouts correctly.
  • Exercises setup/sync/status behavior without creating a duplicate skill mirror.
cmd/dotagents/qwen_test.go
Documents Qwen Code support and its verified synchronization surfaces.
  • Adds Qwen to capability matrices, supported-harness listings, and project descriptions.
  • Documents config-driven skills, Qwen role output, root-instruction linking, and per-harness role options.
  • Updates the built-in dotagents skill description and workflow documentation.
README.md
docs/roles.md
docs/setup.md
docs/site/index.html
docs/skills.md
skills/dotagents/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the Qwen adapter is wrong, it can leave incorrect skills, MCP, role, root-instruction, or hook settings persisted in ~/.qwen/settings.json after the code is reverted; in particular, a timeout conversion or config patch could change how an existing hook runs. The affected configuration is bounded and can be corrected or regenerated, so a rerun or manual cleanup repairs it.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@yourconscience
yourconscience merged commit c54dee2 into main Sep 3, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 695abe22b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/dotagents/harness.go
read: readJSONMCPServer,
rootKey: "mcpServers",
}),
Roles: &RolesCapability{Extension: ".md", Render: renderQwenAgentRole},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve imported Qwen roles before enabling role sync

When first-run setup shares an existing ~/.qwen/agents/<name>.md, this capability causes scanNativeRoles to use the generic Markdown importer, which copies native top-level fields such as model, tools, and approvalMode into the canonical file. renderQwenAgentRole instead expects nested qwen options and adds generated metadata, so the expected output differs from the untouched native source; the first sync then classifies that source as an unmanaged conflict and aborts. Add a Qwen-specific conversion that preserves those native fields in canonical qwen options so importing an existing Qwen role can complete.

AGENTS.md reference: AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

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.

1 participant