qwen-code/integration-tests
Shaojin Wen d119b60bf0
test(sdk): align tool-control E2E with prior-read enforcement (#3898)
* test(sdk): align tool-control E2E with prior-read enforcement

Three tests in tool-control.test.ts broke deterministically after the
prior-read enforcement landed. Each seeded test.txt then prompted a
direct write — the new guard now rejects the write before canUseTool
fires, with "File X has not been fully read in this session...".

- updatedInput-application + allowedTools-bypass tests: drop the seed
  so write_file takes the new-file path (exempt from enforcement).
- asyncGenerator-deny test: keep seed (assertion requires unchanged
  content), rewrite prompt to "Read X then write Y" — the pattern
  used by 27 passing tests in the same file. Also fix a latent bug
  where canUseTool returned `updatedInput: {}` for non-write tools,
  which would erase file_path on read_file (SDK `?? toolInput` only
  catches nullish, not empty objects).

* test(sdk): address self-review on #3898

- Fix the same `updatedInput: {}` reverse-pattern at line 1545 in
  the multi-turn asyncGenerator test. The CLI side at
  permissionController.ts:444 does `if (updatedInput && typeof
  updatedInput === 'object')` — an empty object is truthy, so it
  silently replaces args. Mirror the pass-through fix from line ~1457.
- In the deny test, add `expect(toolNames).toContain('read_file')`
  before the canUseTool-deny assertion. If the model skips the
  read-first instruction, prior-read enforcement would surface
  EDIT_REQUIRES_PRIOR_READ rather than the canUseTool deny message,
  causing a confusing toContain mismatch. Fail fast with a clear
  signal instead.
2026-05-07 19:35:51 +08:00
..
cli feat(core): event monitor tool with throttled stdout streaming (Phase C) (#3684) 2026-05-02 20:57:26 +08:00
concurrent-runner feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502) 2026-04-24 11:29:02 +08:00
fixtures/settings-migration refactor: remove summarizeToolOutput feature 2026-03-15 13:51:32 +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 test(integration): match new cron notification format in interactive tests (#3402) 2026-04-17 22:56:34 +08:00
sdk-typescript test(sdk): align tool-control E2E with prior-read enforcement (#3898) 2026-05-07 19:35:51 +08:00
terminal-bench Terminal Bench Integration Test (#521) 2025-09-05 17:02:03 +08:00
terminal-capture feat(cli): expand TUI markdown rendering (#3680) 2026-05-07 16:24:13 +08: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
globalSetup.ts feat(memory): managed auto-memory and auto-dream system (#3087) 2026-04-16 20:05:45 +08:00
test-helper.ts fix(integration-tests): honor stdinDoesNotEnd option (#2966) 2026-04-18 09:17:27 +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 chore: rename @qwen-code/sdk-typescript to @qwen-code/sdk 2025-12-05 21:47:26 +08:00
vitest.config.ts add doc for hooks and skip integration test 2026-03-12 07:44:26 -07:00
vitest.terminal-bench.config.ts Fix E2E caused by Terminal Bench test (#529) 2025-09-08 10:51:14 +08:00