Commit graph

2117 commits

Author SHA1 Message Date
DennisYu07
bba3ab93b1 fix proxy normalization 2026-03-30 14:37:18 +08:00
LaZzyMan
a288f91869 fix(core): resolve tree-sitter wasm path for symlinked CLI 2026-03-30 14:17:55 +08:00
tanzhenxin
cd8ba1faf1 test(agents): add getModelsConfig mock to InProcessBackend tests
This ensures tests pass with the new model configuration system.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-30 06:04:37 +00:00
wenshao
5e0d73b3f9 fix: add write_file to allowedTools, replace shell heredoc with write_file tool
The skill instructed agents to write temp files via `cat > file <<'EOF'`
in run_shell_command, which contradicts the repo's tool guidance
("Use write_file, NOT echo >/cat <<EOF"). Resolve the contradiction by:

1. Adding write_file to allowedTools in SKILL.md frontmatter
2. Replacing shell heredoc file writes with write_file tool calls
3. Keeping -F body=@file and --body-file for shell-safe gh api/pr usage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:54:24 +08:00
wenshao
3e105452a2 fix: use temp file + quoted heredoc for shell-safe comment body
Review content may contain double quotes, $VAR, backticks, etc. that
break double-quoted shell arguments or trigger run_shell_command security
rejection. Replace direct string interpolation with a two-step approach:

1. Write body to temp file via quoted heredoc (<<'BODYEOF') which
   prevents ALL shell expansion
2. Reference file with -F body=@/tmp/pr-comment.txt in gh api calls
   and --body-file in gh pr review calls

Also update Step 5 to clean up all temp files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:43:01 +08:00
wenshao
51ee971f31 fix: add start_side param for multi-line PR comments
Add explicit `-f start_side="RIGHT"` to the multi-line gh api comment
example. GitHub API docs indicate start_side may be required for ranged
comments. Adding it explicitly is low-cost and eliminates ambiguity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:29:06 +08:00
wenshao
b96ef5f1bd fix: remove $() command substitution blocked by run_shell_command, align verdict with gh pr review action
- Replace heredoc `BODY=$(cat <<COMMENT_EOF ...)` with direct multi-line
  string in `-f body=` argument, since `$()` is blocked by run_shell_command
  security policy (chat-gpt-5.4 review feedback)
- Map Step 3 verdict to corresponding `gh pr review` action:
  Approve → --approve, Request changes → --request-changes, Comment → --comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:10:51 +08:00
tanzhenxin
707b06ca48 fix(cron): replace "Claude" with "Qwen Code" in tool messages
Also adds terminal capture test scenario for cron-loop feature.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 13:17:52 +08:00
tanzhenxin
42e7e543cb fix(cron): improve jitter strategy and fix vixie-cron day matching semantics
- Update cron scheduler with separate jitter strategies for recurring (up to 10% of period, capped at 15 min) and one-shot jobs (up to 90s early for :00/:30 minute marks)
- Accept 7 as valid day-of-week value (Sunday) and normalize to 0 in parser
- Implement vixie-cron day matching: OR logic when both dom and dow are constrained, AND logic when only one is constrained
- Update tests to use every-minute cron expressions for faster execution and add coverage for new day matching behavior

This improves cron job reliability by using smarter jitter calculation based on job type and fixes day-of-week matching to follow standard vixie-cron behavior where either day field can trigger execution when both are specified.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 12:52:11 +08:00
tanzhenxin
69fff4337d feat(loop): add subcommands and improve cron display output
- Add list and clear subcommands to loop skill
- Create human-readable cron display utility for common patterns
- Update tool descriptions and return displays for better UX
- Separate LLM content from user-facing display in cron tools

This enhances the loop skill with convenient subcommands while making cron job displays more readable by converting common cron expressions into natural language (e.g., 'Every 5 minutes' instead of '*/5 * * * *').

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 12:28:57 +08:00
DennisYu07
01fa348c17 add cache for path 2026-03-29 12:10:50 +08:00
tanzhenxin
f063e7cd22 refactor(cron): simplify and improve cron tool output messages
- Update cron-create to validate cron expression before scheduling and improve success messages with clearer session-lifetime guidance
- Simplify cron-delete messages from 'deleted' to 'cancelled' for better clarity
- Streamline cron-list output to single-line format per job (ID — expression (type) [session-only]: prompt)
- Remove unused nextFireTime calculations from cron tools
- Update corresponding tests to match new output formats

This makes cron tool responses more concise and user-friendly while providing clearer information about session-only job lifetime.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 12:08:48 +08:00
DennisYu07
c2fe554e34 fix bash path for node-pty 2026-03-29 11:55:32 +08:00
tanzhenxin
023638fe0e docs(loop): improve /loop skill documentation with clearer parsing rules and examples
- Add detailed parsing priority order (leading token, trailing "every" clause, default)
- Include concrete examples for each parsing rule
- Clarify interval-to-cron conversion table with edge cases
- Document rounding behavior for non-divisible intervals
- Specify immediate execution after scheduling first cron fire
- Update action steps with clearer confirmation requirements

This enhances the /loop skill documentation to make interval parsing behavior more predictable and provides better guidance for handling edge cases.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 11:20:17 +08:00
tanzhenxin
57cf2b0bf2 refactor(cron): rename cron_expression param to cron and enhance documentation
- Rename cron_expression parameter to cron for brevity across CronCreateTool
- Expand tool description with comprehensive usage guidance for one-shot and recurring tasks
- Add best practices for avoiding :00/:30 minute marks to reduce API load spikes
- Document 3-day auto-expiration for recurring jobs and session-only lifetime
- Add additionalProperties: false to all cron tool schemas for stricter validation
- Update integration tests and loop SKILL to use renamed parameter

This improves the developer experience with clearer parameter names and provides users with detailed guidance on scheduling patterns and runtime behavior.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 11:05:37 +08:00
tanzhenxin
439a1a46e2 feat(cron): make cron tools opt-in via experimental settings
Change cron/loop tools from opt-out to opt-in. Cron tools are now
disabled by default and can be enabled via:
- settings.json: { "experimental": { "cron": true } }
- Environment variable: QWEN_CODE_ENABLE_CRON=1

This ensures experimental features are explicitly enabled by users
who want to try them.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-29 02:25:28 +00:00
wenshao
6fb752a823 fix: address all review feedback from Qwen-Code + GLM-5.1
Fixes for 7 issues raised in PR review:

1. [Critical] Extract exclusion criteria into shared "Exclusion Criteria"
   section, referenced by both Step 2 and Step 2.5 to prevent drift
2. [Suggestion] Specify exact token matching for --comment flag parsing
   (not substring match, ignore --commentary etc.)
3. [Suggestion] Replace `git rev-parse HEAD` with `gh pr view --json
   headRefOid` to get correct remote PR HEAD SHA
4. [Suggestion] Use heredoc to construct comment body with real newlines
   instead of broken \n escape in -f flag
5. [Nice to have] Add batch limit of 10 for parallel verification agents
6. [Nice to have] Add error handling: skip Step 4 if gh commands fail
7. [Suggestion] Issue #4 (endpoint) deferred — current approach documented

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 08:07:21 +08:00
tanzhenxin
aa4939111c feat(cron): add in-session loop scheduling with cron tools
Add session-scoped recurring jobs that fire while you work. Jobs live
inside the current Qwen Code process and are gone when you exit.

New tools:
- cron_create: schedule a prompt to run on a cron expression
- cron_list: list active cron jobs
- cron_delete: cancel a scheduled job

Components:
- CronScheduler service for in-process job management
- cronParser utility for 5-field cron expressions
- /loop skill for natural language scheduling
- Non-interactive mode integration to keep process alive

Constraints:
- Max 50 jobs per session
- 3-day expiry for recurring jobs
- Jitter to prevent thundering herd
- No catch-up for missed fire times

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-28 14:37:29 +00:00
tanzhenxin
3a157d1fec feat(extension): add npm registry support for extension installation
- Add new npm extension installation channel via scoped packages (@scope/name)
- Implement npm.ts module with registry resolution, authentication, and download logic
- Support version pinning, dist-tags (latest, beta), and custom registries
- Handle private registry auth via NPM_TOKEN env var and .npmrc _authToken entries
- Update CLI install command with --registry flag for npm extensions
- Add comprehensive tests for npm package parsing and registry operations
- Update documentation for releasing and installing from npm registries
- Integrate npm updates into extension manager and update checking flow

This enables teams using npm for package distribution to publish Qwen Code extensions through their existing infrastructure, with full support for private registries and access control.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 20:38:35 +08:00
qwen-code-ci-bot
070ec5b43e
chore: bump version to v0.13.1 (#2716)
Some checks failed
Qwen Code CI / Lint (push) Has been cancelled
Qwen Code CI / CodeQL (push) Has been cancelled
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Has been cancelled
E2E Tests / E2E Test (Linux) - sandbox:none (push) Has been cancelled
E2E Tests / E2E Test - macOS (push) Has been cancelled
Qwen Code CI / Test (push) Has been cancelled
Qwen Code CI / Test-1 (push) Has been cancelled
Qwen Code CI / Test-2 (push) Has been cancelled
Qwen Code CI / Test-3 (push) Has been cancelled
Qwen Code CI / Test-4 (push) Has been cancelled
Qwen Code CI / Test-5 (push) Has been cancelled
Qwen Code CI / Test-6 (push) Has been cancelled
Qwen Code CI / Test-7 (push) Has been cancelled
Qwen Code CI / Test-8 (push) Has been cancelled
Qwen Code CI / Post Coverage Comment (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 18:32:26 +08:00
Mingholy
f6c273d0a0
Merge pull request #2690 from LaZzyMan/fix/acp-permission-flow
fix(acp): align permission flow across clients
2026-03-27 17:19:46 +08:00
Mingholy
4f8c98576a
Merge pull request #2675 from LaZzyMan/fix-issue-2671
fix: use config working directory for OpenAI logger path resolution in ACP mode
2026-03-27 16:54:59 +08:00
LaZzyMan
f5349d80b9 fix: preserve original line endings (CRLF/LF) when editing files
- Add LineEnding type and detectLineEnding() function to fileSystemService
- Detect and record line ending format in readTextFile _meta
- Honor lineEnding from _meta in writeTextFile to restore original format
- Update edit.ts and write-file.ts to pass lineEnding through _meta
- Add comprehensive unit tests for line ending detection and preservation

Fixes: #2704
2026-03-27 16:28:41 +08:00
tanzhenxin
811ccdd02d Merge remote-tracking branch 'origin/main' into feat/channels-telegram 2026-03-27 08:21:41 +00:00
DennisYu07
8dfd981af0 Merge branch 'main' into feat/hooks-refactor-ui-event 2026-03-27 13:59:33 +08:00
LaZzyMan
7a6b725b0c feat: replace qwen-settings-config with bundled qc-helper skill
- Remove project-level qwen-settings-config skill and its references/
- Create bundled qc-helper skill at packages/core/src/skills/bundled/
  that references docs/users/ for answering usage/config questions
- Update copy_bundle_assets.js to copy docs/users/ into dist/bundled/qc-helper/docs/
- Update dev.js to create symlink for dev mode docs access
- Add bundled docs directory verification in prepare-package.js
- Revert doc-update skills (docs-audit-and-refresh, docs-update-from-diff)
  to main branch versions
2026-03-27 12:03:00 +08:00
tanzhenxin
ad20049a4e Merge remote-tracking branch 'origin/main' into refactor/subagent-model-selection 2026-03-27 11:56:29 +08:00
tanzhenxin
5d58b2f112 feat: simplify subagent model configuration with model selector
Refactor subagent model configuration from nested modelConfig object to a simple model string field for better UX and clarity.

Changes:
- Replace modelConfig object with model string in SubagentConfig interface
- Add model-selection.ts utility for parsing and validating model selectors
- Support 'inherit' keyword and bare model IDs (e.g., 'glm-5', 'claude-sonnet-4-6')
- Maintain backward compatibility by parsing legacy modelConfig frontmatter
- Update validation to reject cross-provider authType-prefixed selectors
- Update SDK types (TypeScript and Java) to reflect new schema
- Add comprehensive tests for model selection and validation
- Update documentation with model selection examples

Breaking changes:
- modelConfig.frontmatter field deprecated in favor of model field
- Cross-provider model selectors (e.g., 'openai:gpt-4') not supported for subagents

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 11:49:45 +08:00
DennisYu07
0c6b16c695 add check for userPromptSubmit 2026-03-27 11:27:33 +08:00
LaZzyMan
0fd6f3a78b Merge branch 'main' into fix/acp-permission-flow 2026-03-27 10:54:25 +08:00
DennisYu07
cf0b67ef8e refactor ui for stop hook reason and systemMessage 2026-03-27 10:54:16 +08:00
LaZzyMan
585bce06d2 Merge branch 'fix-permission-issues' into fix/acp-permission-flow 2026-03-27 10:05:01 +08:00
LaZzyMan
dd518de5b0 fix(acp): align permission flow across clients 2026-03-26 23:25:04 +08:00
tanzhenxin
06ccc80c48 feat(channels): allow extensions to register channel plugins
- Add ExtensionChannelConfig interface for declaring channels in extension manifests
- Add loadChannelsFromExtensions() to discover and register channel plugins from active extensions
- Integrate extension channel loading into channel start commands

This enables extensions to contribute new channel types (e.g., Telegram, Slack) without modifying core code.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 13:59:32 +00:00
Mingholy
26e0128dc6
Merge pull request #2631 from QwenLM/fix/issue-1203-subagent-diff-tab-stuck
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(acp-integration/agent): clear stale subagent diff confirmation after IDE accept
2026-03-26 21:44:16 +08:00
Mingholy
d6502dd352
Merge pull request #2637 from LaZzyMan/fix-permission-issues
feat: human-readable permission labels, deny rule feedback, and multi-dir search improvements
2026-03-26 21:44:00 +08:00
Mingholy
be32213973
Merge pull request #2611 from QwenLM/mingholy/fix/node-pty-errors
fix(shell): handle PTY race condition errors gracefully
2026-03-26 21:43:33 +08:00
wenshao
3ce0d42c83 fix: resolve review feedback issues in /review skill
- Add `side="RIGHT"` param and multi-line support (start_line + line) to gh api calls
- Add fallback: if inline comment fails, include finding in overall review summary
- Warn user when `--comment` is used with non-PR target instead of silently ignoring
- Move environment restoration from Step 3 to new Step 5, after Step 4 posts comments,
  to ensure `git rev-parse HEAD` returns the correct PR commit SHA

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:53:40 +08:00
wenshao
b24b9e191d enhance /review: add verification step, false positive control, and PR comment integration
Add three enhancements to the /review skill to improve review quality and
GitHub integration:

- False positive exclusion list and structured output format for review agents
- Step 2.5: deduplicate findings then verify each with independent parallel agents
- Step 4: post inline comments on PRs via `gh api` when `--comment` flag is set

Closes #2684

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:46:24 +08:00
Mingholy
00447356ad
Merge pull request #2602 from QwenLM/feat/hooks-refactor-hooks-ui
feat(hooks ui): refactor ui for Qwen Code hooks
2026-03-26 20:11:50 +08:00
LaZzyMan
460c81a7b6 fix(tools): fix glob ignore base path and add dedup for grep/ripgrep
- glob: compute relativePaths relative to projectRoot (config.getTargetDir())
  instead of searchDir so that FileDiscoveryService evaluates .gitignore /
  .qwenignore rules against the correct paths when path option is used or
  when searching across multiple workspace directories

- grep: deduplicate rawMatches by filePath:lineNumber key when searching
  multiple workspace directories to prevent duplicate results from
  overlapping search roots (e.g. parent dir + child dir in workspace)

- ripGrep: deduplicate output lines by filepath:linenum prefix when
  searching multiple workspace paths to handle the same edge case

- tests: add regression tests covering
  - glob ignores files matching .gitignore/.qwenignore when path option
    points to a subdirectory
  - grep deduplication with parent+child overlapping workspace dirs
  - ripgrep deduplication when raw output contains duplicate lines
2026-03-26 17:54:38 +08:00
DennisYu07
db7ec117c2
Merge pull request #2645 from QwenLM/fix/git_bash_change_windows
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(windows): support git bash/MSYS2 shell detection on Windows
2026-03-26 13:04:38 +08:00
LaZzyMan
64b83a102c fix: use config working directory for OpenAI logger path resolution in ACP mode
In ACP mode (e.g., Zed editor), process.cwd() may return '/' (filesystem root),
causing OpenAILogger to attempt creating '/logs/openai' which fails with ENOENT.

Add an optional 'cwd' parameter to OpenAILogger constructor and pass
config.getWorkingDir() from LoggingContentGenerator so that log directories
are resolved relative to the project working directory instead of process.cwd().

Fixes #2671
2026-03-26 11:51:22 +08:00
Mingholy
9cd4434fe2
Merge pull request #2547 from QwenLM/fix/lsp-cpp-java-support-v2
fix(lsp): improve C++/Java/Python language server support
2026-03-26 10:22:41 +08:00
Mingholy
51123ca024
Merge pull request #2421 from QwenLM/feat/hooks-telemetry
feat(hooks): Add comprehensive hook execution telemetry
2026-03-26 10:10:11 +08:00
DennisYu07
a5c6084222 refactor ui for stop hook and userPromptSubmit 2026-03-25 20:44:55 +08:00
LaZzyMan
ea3a2d6f5b fix: improve /compress split point selection for tool-heavy conversations
When conversation history is near the context window limit and dominated by
tool call/response cycles, findCompressSplitPoint would return a near-zero
split point because it only considered non-functionResponse user messages as
valid split points. This caused /compress to send almost no history to the
compression API (e.g. 29 tokens), producing a useless summary that inflated
token count instead of reducing it.

Changes:
- Track tool completion boundaries (positions after functionResponse) as
  fallback split points in findCompressSplitPoint
- Add user-with-functionResponse to the compress-everything safety check
- Use Math.max of primary and fallback split points for better coverage
- Add minimum content guard (5% threshold) to prevent futile API calls
- Add 4 new test cases covering tool-heavy conversation scenarios

Fixes #2647
2026-03-25 15:13:10 +08:00
LaZzyMan
05062fd689 fix: resolve /clear command and ESC key lag caused by hooks system
- Make hook events fire-and-forget in clearCommand to avoid blocking UI
- Move context.ui.clear() before resetChat for immediate responsiveness
- Add hasHooksForEvent() fast-path check to HookSystem and Config
- Skip MessageBus round-trips in client.ts when no hooks are registered
- Add comprehensive unit tests for all changes

Fixes #2651
2026-03-25 14:01:24 +08:00
DennisYu07
50ade83e4d fix comment 2026-03-25 11:08:23 +08:00
胡玮文
6ad990e1e7 fix(mcp): restore trust+isTrustedFolder permission check in getDefaultPermission
The trust/isTrustedFolder logic was accidentally dropped during the
permission system refactor in feat/support-permission (PR #2283).

Previously, shouldConfirmExecute() returned false (no confirmation) when
both conditions were met:
  - MCP server config has trust: true
  - The workspace folder is trusted (isTrustedFolder())

The refactor replaced shouldConfirmExecute() with getDefaultPermission() but
left out the trust check entirely, adding a comment claiming 'trust logic is
now handled by PM rules' — however no PM rules were ever generated from the
trust setting, making trust: true completely non-functional.

This fix restores the original behavior: MCP tools from a trusted server
(trust: true) auto-approve only when the workspace is also trusted, preserving
the security gate that prevents trust settings from bypassing confirmation in
untrusted folders.
2026-03-24 21:11:43 +08:00