Previously, only shell scripts (.sh) had .claude -> .qwen path replacement.
Markdown files (.md) like cancel-ralph.md and help.md were missing this
conversion, causing incorrect paths like .claude/ralph-loop.local.md.
Now performVariableReplacement also replaces .claude directory references
in markdown files using the same regex pattern as shell scripts.
- Strip trailing orphaned funcCall (force=true) before split point calculation,
so normal compression logic runs cleanly on the remaining history instead of
requiring ad-hoc special-casing
- Remove redundant lastToolCompletionSplitPoint machinery: after fixing the
i+2 index bug, lastSplitPoint already subsumes it, making Math.max redundant
- Add MIN_COMPRESSION_FRACTION constant (0.05) to guard against futile API
calls when historyToCompress is too small relative to total history
- Add tests for orphaned funcCall handling (force=true compresses, force=false NOOP)
- Add test for MIN_COMPRESSION_FRACTION guard
Fixes#2647
- 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
- 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
- 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
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
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
- 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
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.
- Add buildHumanReadableRuleLabel() to convert raw permission rules into
natural-language descriptions for the 'Always Allow' UI options
- Add PermissionManager.findMatchingDenyRule() to surface which deny rule
caused a tool to be blocked, improving error messages in coreToolScheduler
- Update ToolConfirmationMessage to use friendly labels with i18n support
- Add comprehensive tests for new permission features and multi-directory
search in glob, grep, and ripGrep tools
- Fix integration test for tool-control allowedTools configuration
- Track pendingConfirmationCallId in AgentToolInvocation to properly clear stale prompts
- Clear pendingConfirmation when TOOL_RESULT arrives for the pending tool (IDE diff-tab path)
- Clear pendingConfirmation via onConfirm callback (terminal UI path)
- Ensure pendingConfirmation is NOT cleared when TOOL_RESULT is for a different tool
- Prefer filePath over fileName for diff content path in Session and SubAgentTracker
- Add comprehensive tests for IDE diff-tab and terminal UI confirmation flows
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Ignore EIO errors on PTY process exit (expected due to read/write race)
- Handle EBADF errors during resize operations (PTX fd already closed)
- Handle 'Cannot resize a pty that has already exited' message
- Add comprehensive tests for all error scenarios
These changes prevent app crashes from benign PTY race conditions
that occur on macOS/Linux when the process exits while I/O is pending.
Refs: https://github.com/microsoft/node-pty/issues/178
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add concise system instruction for web content processing
- Prevents glm-5 and other models from using main session's complex prompt
- Fixes issue where web_fetch returns AI greetings instead of web content
Resolves#2609