Commit graph

8 commits

Author SHA1 Message Date
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
tt-a1i
3cecd667d5
fix(core): validate grep result limits (#5389)
Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
2026-06-19 13:47:13 +08:00
zhangxy-zju
ed14a33064
feat(core): add NotebookEdit tool for Jupyter notebooks
Some checks are pending
Qwen Code CI / Classify PR (push) Waiting to run
Qwen Code CI / CodeQL (push) Blocked by required conditions
Qwen Code CI / Lint (push) Blocked by required conditions
Qwen Code CI / Test (macos-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (ubuntu-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (windows-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
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
Adds NotebookEdit as the structured write counterpart to existing notebook read support.

Summary:
- Add `notebook_edit` for safe cell-level `.ipynb` replace/insert/delete operations.
- Integrate notebook editing with tool registration, permissions, Claude conversion, prior-read enforcement, IDE/inline modify flow, commit attribution, docs, and SDK permission docs.
- Harden notebook read/edit behavior for truncated notebook renders, ambiguous fallback cell IDs, internal modify metadata, compact JSON, UTF-8 BOM notebooks, and cache behavior after structural edits.
- Add unit and integration coverage for notebook read/edit behavior.

Follow-up work remains for tab-indented notebook formatting preservation, a few low-risk unit-test additions, and non-blocking hardening suggestions from review.
2026-05-21 00:06:15 +08:00
tanzhenxin
c3f5dd353d docs(tools): document file encoding and platform-specific behavior
Add documentation for encoding detection, default encoding settings,
CRLF handling for batch files, and UTF-8 BOM for PowerShell scripts on
Windows.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 23:03:50 +08:00
tanzhenxin
6997636ba4 fix(fileUtils): use config modalities instead of model-based defaults
This fixes session corruption issues where the modality check was based on
the model name rather than the actual resolved config, causing inconsistent
behavior when the config's modalities differed from the defaults.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-15 21:22:57 +08:00
Drew Duncan
de20bb12bd fix(core): reject PDF files to prevent session corruption (fixes #2020) 2026-02-28 10:23:36 -08:00
pomelo-nwu
60211b8180 feat: update docs 2025-12-15 09:47:03 +08:00
pomelo-nwu
17785c418d feat: restructure docs 2025-12-04 18:26:05 +08:00
Renamed from docs/tools/file-system.md (Browse further)