qwen-code/docs
Yan Shen 9b20c47f46
feat(core): respect configurable agent ignore files (#4653)
* Respect agent ignore conventions through configurable filtering

Constraint: Issue #1746 requests .agentignore/.aiignore compatibility and maintainer feedback asks for a custom ignore-file configuration path.
Rejected: Hardcode only .agentignore/.aiignore | would not satisfy the maintainer's configurable-ignore direction.
Confidence: high
Scope-risk: moderate
Directive: Keep .qwenignore always included when respectQwenIgnore is enabled; route extra filenames through customIgnoreFiles.
Tested: Core targeted vitest suite; CLI targeted vitest plus config integration; npm run build && npm run typecheck; targeted eslint; git diff --check.
Not-tested: Full repository test suite and model-driven end-to-end CLI integration tests.

* fix(cli): keep custom ignore settings type-safe and honest

The schema default otherwise narrows customIgnoreFiles to the built-in tuple and the UI text implies additive behavior that the implementation does not provide.

Constraint: Address wenshao's two review comments without changing replacement semantics.

Rejected: Merge user values with defaults | Larger behavior change was not requested for this follow-up.

Confidence: high

Scope-risk: narrow

Directive: Preserve replacement semantics unless a future change intentionally updates config merging and docs together.

Tested: cd packages/cli && npx vitest run src/config/config.test.ts src/config/settingsSchema.test.ts; npm run build; npm run typecheck; npm run lint; git diff --check

Not-tested: Full integration suite.

* fix(core): keep custom ignore settings consistent

Ensure review-sensitive file discovery paths, grep ignore resolution, and user-facing ignore names preserve the configured custom ignore behavior instead of falling back to defaults or search-directory-local files.

Constraint: PR #4653 review feedback requires customIgnoreFiles to behave consistently across secondary discovery and grep paths.

Rejected: Merge custom ignore files with defaults | The current PR documents replacement semantics and prior review feedback accepted that contract.

Confidence: high

Scope-risk: narrow

Directive: Keep .qwenignore always included, but treat customIgnoreFiles as the replacement list for additional AI ignore files.

Tested: packages/core targeted vitest for qwenIgnoreParser, fileDiscoveryService, ripGrep, config, read-file; packages/cli config vitest; targeted workspaceFileSystem custom-ignore vitest; Prettier check; ESLint on touched files; git diff --check.

Not-tested: Full workspace typecheck/build because current branch fails before this change on environmentContext.test.ts syntax and unrelated CLI type errors; full workspaceFileSystem suite on Windows because existing symlink tests fail with EPERM.

* test(core): cover subagent custom ignore inheritance

Keep the in-process backend tests aligned with the new per-agent file filtering contract so CI catches missing custom-ignore propagation.

Constraint: PR review fixes require subagents to inherit parent custom ignore settings.
Confidence: high
Scope-risk: narrow
Tested: npx vitest run src/agents/backends/InProcessBackend.test.ts
Tested: npx vitest run src/utils/qwenIgnoreParser.test.ts src/services/fileDiscoveryService.test.ts src/tools/ripGrep.test.ts src/config/config.test.ts src/tools/read-file.test.ts src/agents/backends/InProcessBackend.test.ts src/tools/agent/agent.test.ts
Tested: npx vitest run src/serve/fs/workspaceFileSystem.test.ts -t "uses configured custom ignore files"
Tested: npx prettier --check packages/core/src/agents/backends/InProcessBackend.test.ts
Tested: npx eslint packages/core/src/agents/backends/InProcessBackend.test.ts
Tested: git diff --check
Not-tested: full npm run typecheck remains blocked by existing branch-wide TypeScript errors outside this test change

* test(core): fix subagent custom ignore test typing

Keep the custom-ignore regression test type-checkable under the repo build, where createMockConfig is intentionally cast to never.

Constraint: CI runs package build during dependency installation and type-checks test files.
Confidence: high
Scope-risk: narrow
Tested: npx vitest run src/agents/backends/InProcessBackend.test.ts
Tested: npx prettier --check packages/core/src/agents/backends/InProcessBackend.test.ts
Tested: npx eslint packages/core/src/agents/backends/InProcessBackend.test.ts
Tested: git diff --check
Not-tested: npm run build --workspace=packages/core is still blocked locally by src/utils/environmentContext.test.ts(599,1): error TS1005: '}' expected

* test(core): align notebook ignore message expectation

Keep notebook ignore validation tests in sync with the comma-separated ignore file display used by the review fix.

Constraint: PR review fixes changed ignore file display text from slash-separated to comma-separated.
Confidence: high
Scope-risk: narrow
Tested: npx vitest run src/tools/notebook-edit.test.ts
Tested: npx vitest run src/utils/qwenIgnoreParser.test.ts src/services/fileDiscoveryService.test.ts src/tools/ripGrep.test.ts src/tools/read-file.test.ts src/tools/notebook-edit.test.ts src/config/config.test.ts src/agents/backends/InProcessBackend.test.ts src/tools/agent/agent.test.ts
Tested: npx prettier --check packages/core/src/tools/notebook-edit.test.ts
Tested: npx eslint packages/core/src/tools/notebook-edit.test.ts
Tested: git diff --check
Not-tested: full npm run build --workspace=packages/core remains blocked locally by src/utils/environmentContext.test.ts(599,1): error TS1005: '}' expected

* fix(core): keep ripgrep ignore roots canonical

Constraint: PR #4653 review 4453010590 requested absolute ignore-root fallback behavior.

Rejected: Broader customIgnoreFiles semantic changes | outside the review scope and replacement semantics stay unchanged.

Confidence: high

Scope-risk: narrow

Directive: Keep customIgnoreFiles as replacement for compatibility defaults while always including .qwenignore.

Tested: cd packages/core && npx vitest run src/tools/ripGrep.test.ts; npx prettier --check src/tools/ripGrep.ts src/tools/ripGrep.test.ts; git diff --check

Not-tested: npm run typecheck --workspace=packages/core fails on existing src/utils/environmentContext.test.ts parse error.

* test(core): align ripgrep ignore path expectation

Constraint: macOS canonicalizes temporary paths through /private/var after process.chdir.

Rejected: Changing ripgrep ignore-root behavior | implementation already uses path.resolve correctly.

Confidence: high

Scope-risk: narrow

Directive: Keep the regression test tied to path.resolve behavior rather than raw temp-dir spelling.

Tested: cd packages/core && npx vitest run src/tools/ripGrep.test.ts; npx prettier --check src/tools/ripGrep.test.ts src/tools/ripGrep.ts; git diff --check

Not-tested: Full CI rerun is remote-only after push.

* fix(core): make custom ignore feedback actionable

Review feedback for PR #4653 showed users could not tell which ignore file blocked a path, and worktree isolation lacked coverage for inherited custom ignore files. This also closes the existing environmentContext.test describe block so build can progress to the current unrelated converter type blocker.

Constraint: PR #4653 keeps replacement semantics for customIgnoreFiles and always includes .qwenignore.

Rejected: Exposing matching pattern text | merged ignore and negation semantics can make pattern-level attribution misleading.

Confidence: high

Scope-risk: moderate

Directive: Keep customIgnoreFiles as replacement semantics unless the config contract changes deliberately.

Tested: core targeted Vitest suite; ripGrep regression test; cli settingsSchema test; Prettier check.

Not-tested: npm run build && npm run typecheck blocked by existing FinishReason type errors in converter.ts.

* fix(core): isolate qwen ignore sources

* test(cli): mock qwen ignore defaults in acp test

* test(scripts): make dev launcher test path portable

* fix(core): prevent ripgrep ignore negation bypass

* fix(core): post-filter ripgrep qwenignore matches

* fix(core): preserve ignore negations in grep

- Preserve non-.qwenignore negation semantics for grep searches

- Skip workspace-external ignore-file discovery

- Add coverage for ignore diagnostics and addSource behavior

* test(core): update yaml nested parser expectations

* chore: remove unrelated formatting churn
2026-06-23 10:44:37 +08:00
..
design refactor(cli): Finish serve kebab-case filenames (#5604) 2026-06-22 21:15:40 +08:00
developers feat(core): respect configurable agent ignore files (#4653) 2026-06-23 10:44:37 +08:00
e2e-tests feat(worktree): Phase D — startup --worktree flag + symlinkDirectories + PR refs (#4381) 2026-05-27 17:04:51 +08:00
plans feat(core)!: redesign auto-compaction thresholds with three-tier ladder (#4345) 2026-05-25 21:11:08 +08:00
superpowers feat(serve): add daemon idle detection to GET /health?deep=true (#4934) 2026-06-18 06:55:03 +00:00
users feat(core): respect configurable agent ignore files (#4653) 2026-06-23 10:44:37 +08:00
verification/abort-controller-refactor fix(core): stop AbortSignal listener leak in long sessions (MaxListenersExceededWarning) (#4366) 2026-05-26 14:21:49 +08:00
_meta.ts feat: refactor docs 2025-12-05 10:51:57 +08:00
declarative-agents-port.md feat(core): port declarative-agent mcpServers + hooks (CC 2.1.168 parity follow-up) (#4996) 2026-06-12 14:15:51 +08:00
index.md fix: lint issues 2025-12-19 15:52:11 +08:00
yaml-parser-replacement.md feat(core): port declarative-agent mcpServers + hooks (CC 2.1.168 parity follow-up) (#4996) 2026-06-12 14:15:51 +08:00