Commit graph

16 commits

Author SHA1 Message Date
DragonnZhang
0d22a60847 feat(desktop): add workspace skeleton 2026-04-25 02:34:39 +08:00
euxaristia
5facd8738b
feat(core): detect tool validation retry loops and inject stop directive (#3178)
Primary change: prevent the model from burning tokens in an infinite retry
loop when a tool call repeatedly fails schema validation with the same
error (observed with ask_user_question and a malformed `questions`
parameter retrying 10+ times with the same validation error).

- Track consecutive validation failures per (tool name, error message)
  pair in CoreToolScheduler via a `validationRetryCounts` Map.
- After 3 consecutive failures for the same (tool, error) pair, append a
  RETRY LOOP DETECTED directive to the error response instructing the
  model to stop, re-examine the schema, try a fundamentally different
  approach, or surface the issue to the user.
- Reset per-tool counters when the tool invocation succeeds; reset
  globally when an incoming batch shares no tool name with any
  previously failing tool; reset the per-tool counter when the tool
  returns a different validation error so unrelated mistakes do not
  accumulate toward the threshold.
- Distinct from LoopDetectionService, which tracks model-behavior loops
  (repeated thoughts, stagnant actions); this change catches tool-API
  misuse loops at the scheduler layer.

Piggyback fixes bundled in the same PR:

- packages/cli/index.ts, packages/core/src/services/shellExecutionService.ts:
  treat PTY `EAGAIN` on the read path as an expected read error alongside
  `EIO`, avoiding noisy surface-level failures from transient
  non-blocking reads.
- scripts/build.js: switch the settings-schema generation step from
  `npx tsx` to `node --import tsx/esm` for Bun compatibility.

Tests:

- Unit tests in coreToolScheduler.test.ts cover: directive injection on
  the 3rd consecutive failure, counter reset when a different tool is
  called, and counter reset after a successful invocation of the same
  tool (fail → fail → succeed → fail → fail must not trip the directive).
2026-04-18 10:24:46 +08:00
pomelo
338c0b1e9e
refactor: merge test-utils package into core (#3200)
* refactor: merge test-utils package into core

Consolidate the standalone @qwen-code/qwen-code-test-utils package
into packages/core/src/test-utils/, eliminating the need for a
separate package that only provided createTmpDir, cleanupTmpDir,
and FileSystemStructure type.

Changes:
- Move file-system-test-helpers.ts into core/src/test-utils/
- Re-export from core's test-utils index
- Update 3 core test files to use relative imports
- Update cli useAtCompletion test to import from @qwen-code/qwen-code-core
- Remove test-utils devDependency from core and cli package.json
- Delete packages/test-utils/ directory

All affected tests pass (fileSearch, crawler, ignore, useAtCompletion).

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix: remove deleted test-utils from build order

The test-utils package was merged into core but the build script still
tried to build it separately, causing CI failures.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 17:11:03 +08:00
tanzhenxin
f61517c40c chore(channels): add plugin-example to build pipeline and prepublish script
- Add plugin-example to build order in scripts/build.js
- Add prepublishOnly script to auto-build before npm publish

This ensures the plugin-example package is built during the main build process and automatically compiled before publishing to npm.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-01 12:22:33 +08:00
tanzhenxin
dea144918b feat(channels): configure channel adapters for compiled distribution
- Update package.json exports to point to dist directory
- Add TypeScript build scripts to each channel adapter
- Include channel adapters in build order

This enables proper TypeScript compilation and distribution of channel
adapter packages.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 08:46:54 +00:00
tanzhenxin
5dfcfd63c0 feat(build): add channel-base package to build order
This adds the new channel-base package to the build order, positioned
before cli since cli depends on it.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 08:17:00 +00:00
易良
f027fdf621
Merge branch 'main' into feat/add-vscode-settings-json-schema 2026-03-03 11:21:57 +08:00
tanzhenxin
9e4c5ee891 refactor: Extract web-templates package and unify build/pack workflow
Moves export-html and insight templates from cli/assets to a new
dedicated web-templates package. Updates Dockerfile and build scripts
to use consolidated bundle/prepare:package/pack workflow.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 21:02:46 +08:00
DragonnZhang
01c66ca333 feat: add JSON Schema validation for VS Code settings
Add JSON Schema generation for settings.json files to provide IntelliSense
and validation support in VS Code. The schema is automatically generated
from the internal SETTINGS_SCHEMA definition during the build process.

- Add generate-settings-schema.ts script to convert TypeScript schema to JSON Schema
- Add jsonValidation contribution to vscode-ide-companion package.json
- Include schemas directory in .vscodeignore for packaging
- Integrate schema generation into build process

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-13 17:32:18 +08:00
tanzhenxin
9304bc4b4d fix(build): Fix workspace build order to respect dependencies
VSCode IDE Companion depends on @qwen-code/webui, but npm workspaces
build packages in alphabetical order, causing webui to be built after
its dependent.

Fixed by explicitly defining the build order:
1. test-utils
2. core
3. cli
4. webui
5. sdk
6. vscode-ide-companion

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-01 12:11:12 +08:00
Pascal Birchler
ee4feea006
chore: consistently import node modules with prefix (#3013)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-08-25 20:11:27 +00:00
christine betts
e05173d9cc
Move vscode extension build into its own command (#4799) 2025-07-24 18:40:50 +00:00
Shreya Keshive
e4ed1aabac
Include companion VS Code extension VSIX as part of build/release (#4254) 2025-07-16 19:06:39 +00:00
DongJin Jeong
a943cee45d
Fix typos and formatting issues (#1480) 2025-06-27 10:31:42 +00:00
Billy Biggs
e717c51aa1
Avoid import.meta.dirname to be backwards compatible to Node.js 18+ (#1058) 2025-06-15 05:30:00 +00:00
matt korwel
3b943c1582
Windows: Refactor Shell Scripts to Node.js for Cross-Platform Compatibility (#784) 2025-06-09 12:19:42 -07:00