qwen-code/integration-tests
tanzhenxin 560e6103a9
feat(cli): review auto-generated skills with an inline preview, editor handoff, and an in-dialog off switch (#6393)
* feat(cli): skill review dialog — inline preview, open-in-editor, turn-off option

The auto-skill review dialog now shows the staged SKILL.md inline
(sanitized, bounded reads, wrap-aware height cap), opens it in the
configured editor without advancing (with watcher-based preview refresh
so non-blocking GUI editors work), and offers a visible last option to
turn the feature off — effective immediately in-session, persisted at
workspace scope, non-destructive to the pending batch. Bulk options
render only while at least two skills remain. Re-enabling auto-skill
from /memory can resurface a batch put aside by turn-off.

* test(integration): render harness + capture scenarios for the skill review dialog

Browser-free harness that renders the production dialog from source via
an ESM loader hook; its before mode renders the globally installed qwen
(no local fixture — the baseline is what actually shipped, or a loud
failure). Terminal-capture scenarios produce the PR's before/after
screenshots.

* fix(cli): address review findings on the skill review dialog

- Sanitize the model-generated name and description in the dialog header,
  same as the preview body — an escape sequence in the frontmatter must not
  reach the terminal through the header fields.
- Clamp the preview width to the dialog container cap (min(columns-4, 100),
  the same clamp DiffDialog uses) instead of the raw terminal width, which
  broke the wrapped-row accounting on terminals wider than ~106 columns.
- Catch settings persistence failures in the turn-off option: surface the
  error in the dialog and leave the feature untouched instead of letting the
  throw escape the keypress handler.
- Extract the auto-open gate into shouldAutoOpenSkillReview and cover it
  with a truth table (turn-off, /memory overlap, re-enable, Esc-dismiss).
- Cover the MemoryDialog auto-skill ON->OFF toggle direction.
- Release the capture harness temp dir with try/finally.

* fix(cli): guard the preview watcher against async errors and event bursts

An FSWatcher 'error' event after attach had no listener, so Node raised
it as an uncaught exception and the global handler exited the CLI.
Consume it and drop the watcher; the blocking-editor reload still works.

Also debounce the watch callback (300ms, same as SettingsWatcher): a
single editor save fires several raw events, and each one re-read the
file and re-attached the watcher.

* test(cli): drop white-box watcher tests, keep the end-to-end refresh test

The prototype-spy scaffolding tested implementation details (listener
registration, synthetic event bursts) and leaned on vite-node interop
quirks. The existing on-disk refresh test already exercises the watcher
path, debounce included.

* fix(cli): sanitize action errors, log preview read failures, cover key guards

- Render actionError through sanitizeMultilineForDisplay: error messages
  can embed the staged path, whose basename derives from the
  model-generated skill name.
- Log the underlying cause when the preview read fails; all failures
  render the same 'Preview unavailable' otherwise.
- Cover Ctrl+O/Cmd+O inertness and Esc dismissal with tests.
- Document that getAutoSkillEnabled() also gates on bare/safe mode.

---------

Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-07-08 01:36:11 +00:00
..
baselines test(perf): add daemon baseline harness (#4175 Wave 1 PR 1) (#4205) 2026-05-17 00:41:26 +08:00
cli docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
concurrent-runner refactor(tools): rename TodoWrite tool display name to TodoList (#5319) 2026-06-19 08:32:10 +08:00
fixtures feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
hook-integration feat(hooks): Add HTTP Hook, Function Hook and Async Hook support (#2827) 2026-04-16 10:10:33 +08:00
interactive fix(cli): switch TUI prefix ✦→◆ to fix glyph overflow on some terminals (#5974) 2026-06-30 22:44:34 +00:00
sdk-typescript test(e2e): make fake OpenAI reachable from Docker sandbox (#6302) 2026-07-04 11:06:53 +00:00
terminal-bench Terminal Bench Integration Test (#521) 2025-09-05 17:02:03 +08:00
terminal-capture feat(cli): review auto-generated skills with an inline preview, editor handoff, and an in-dialog off switch (#6393) 2026-07-08 01:36:11 +00:00
channel-plugin.test.ts docs(channels): add plugin developer guide and rename mock to plugin-example 2026-03-27 03:19:34 +00:00
fake-openai-server.test.ts test(e2e): make fake OpenAI reachable from Docker sandbox (#6302) 2026-07-04 11:06:53 +00:00
fake-openai-server.ts test(e2e): make fake OpenAI reachable from Docker sandbox (#6302) 2026-07-04 11:06:53 +00:00
globalSetup.ts feat(core): support QWEN_HOME env var to customize config directory (#2953) 2026-05-09 15:51:52 +08:00
test-helper.ts test(integration): harden flaky sleep-interception e2e against skipped tool calls (#4936) 2026-06-11 00:08:26 +08:00
test-mcp-server.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
tsconfig.json refactor(serve): 1 daemon = 1 workspace (#3803 §02) (#4113) 2026-05-15 12:44:36 +08:00
vitest.config.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
vitest.loadtest.config.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
vitest.terminal-bench.config.ts Fix E2E caused by Terminal Bench test (#529) 2025-09-08 10:51:14 +08:00