qwen-code/integration-tests/cli
jinye af25c45e80
fix(cli): Recover sessions across archive races (#9513)
* fix(cli): report a conversation directory deleted mid-inspection as already gone

A child deleted between the lstat and the realpath, or a root that
vanished mid-inspection, was rewritten as 'identity_changed' and then
surfaced as 'Live conversation directory must be an owned direct child'
— a plain Error with no .code pointing at permissions and symlinks when
the directory was simply deleted. Restore the ENOENT-race -> false
contract of discardEmptyConversationDirectory (QwenLM/qwen-code#9489,
item 4).

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

* fix(cli): keep conversation metadata reads race-free and parent ids storage-aligned

Item 2 of QwenLM/qwen-code#9489: readExistingMetadata read the location,
read the metadata, then re-read the location and returned undefined on
mismatch, so an archive landing between the probes made lock-free
resolvers report a healthy session as session_not_found. Creation
metadata is immutable, so one tolerant read per state (active first,
then archived) decides deterministically; the location probes are gone
and a path-safety charset gate keeps the joined transcript path a
single segment.

Item 3: the parent-lineage gate required strict RFC-4122 v1-v5 ids
while the store resolves far looser names, so persisted parents written
by older builds (nil, v6/v7, agent-suffixed ids) turned loadable
children into SessionNotFoundError, and the -agent- allowance could
never resolve. Drop the shape gate and let storage resolution decide,
keeping only the self-reference rejection.

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

* fix(core): let loads resolve both-states sessions and drop the pre-lock restore scans

Items 1 and 5 of QwenLM/qwen-code#9489.

Item 1: a session persisted in both active and archived states — left
behind by a crash inside archiveSessions — hard-failed ACP session/load
and session/resume with session_conflict while plain CLI --resume kept
loading the active copy. findSessionIdIgnoringCase now resolves the
requested spelling first (and a single both-states candidate) instead
of throwing, and assertSessionLoadable treats 'conflict' as loadable
from the active copy. Mutating surfaces keep refusing: unarchive still
conflicts via assertSessionArchived, and multi-runtime ownership
arbitration stays strict so a conflicted internal copy cannot claim a
session an ordinary workspace serves.

Item 5: both restore handlers ran findSessionIdIgnoringCase twice per
request — once as a pre-lock guard whose result REST discarded and the
ACP twin kept as a stale storageSessionId fallback consumed exactly in
the TOCTOU where the in-lock resolve returned undefined. The pre-lock
guards are gone (the in-lock resolve is authoritative and both handlers
now agree), the exact-spelling fast path removes directory scans from
the common case entirely, and the remaining scan uses async readdir so
a large chats tree no longer blocks the daemon event loop.

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

* fix(cli): preserve canonical restore conflicts

Canonicalize live task keys before resident bridge operations, and keep known case-conflict responses when the optional storage recheck fails.

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

* fix(serve): handle case-variant session follow-ups

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

* fix(serve): preserve mixed-case live task identity

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

* fix(serve): resolve canonical persisted session ids

Batch case-insensitive transcript lookups for multi-thread waits and preserve organization metadata when live and persisted session IDs differ only by case.

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

* fix(serve): preserve canonical session restore state

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

* fix(serve): complete canonical session reads

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

* fix(serve): address canonical review findings

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

* fix(serve): preserve aliased session organization

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

* fix(serve): close canonical session review gaps

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

* fix(serve): close canonical task ownership gaps

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

* fix(serve): keep case twins distinct across session pages

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

* fix(serve): isolate alias verification failures

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

* test(integration): align both-states transcript expectation

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

* fix(cli): preserve mixed-case session ownership

Arbitrate noncanonical live task IDs across workspace runtimes and retain the newest legacy organization alias only for uniquely persisted sessions.

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

* fix(cli): preserve live task ownership during refresh

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

* fix(serve): handle session alias races

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

* codex: address PR review feedback (#9513)

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

* test(e2e): normalize generated session ids

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

* fix(cli): narrow PR 9513 to restore regressions

Drop the review-driven mixed-case expansion and retain only the five regressions tracked by #9489.

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

* fix(cli): complete active transcript conflict recovery

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

* test(cli): align session conflict assertions

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

* test(cli): align transcript conflict e2e

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

* codex: address PR review feedback (#9513)

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

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-08-22 14:01:59 +00:00
..
_daemon-benchmark-helpers.ts test(cli): add daemon startup benchmark (#5825) 2026-06-25 06:56:13 +00:00
_daemon-harness.ts feat(mcp): reconcile MCP servers live on settings change (#5561) 2026-06-25 14:50:37 +00:00
_daemon-perf-report.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
_first-output-benchmark.test.ts test(integration): Measure immediate prompt dispatch stages (#7994) 2026-07-29 23:37:46 +00:00
_first-output-benchmark.ts test(integration): Measure immediate prompt dispatch stages (#7994) 2026-07-29 23:37:46 +00:00
acp-cron.test.ts fix(tests): retry acp-cron cleanup rm on transient ENOTEMPTY (#9559) 2026-08-20 08:26:34 +00:00
acp-integration.test.ts perf(review): extend the convergence pair to 3B (chunked) reviews (#8903) 2026-08-12 01:36:42 +00:00
cron-tools.test.ts feat(core): enable loop/cron tools by default (#4950) 2026-06-10 23:21:53 +08:00
daemon-invocation-context.test.ts feat(core): propagate trusted daemon invocation context (#7279) 2026-07-23 06:49:11 +00:00
edit.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
extensions-install.test.ts fix(tests): await rig setup in Qoder plugin install integration test (#8793) 2026-08-09 08:31:39 +00:00
file-system.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
gen-ai-telemetry.test.ts feat(telemetry): Trace main agent invocations (#9107) 2026-08-14 02:50:22 +00:00
json-output.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
json-schema.test.ts fix(test): repair stale --json-schema integration assertion (#4075) 2026-05-12 12:00:57 +08:00
list_directory.test.ts feat(core): make list_directory opt-in (disabled by default) (#9424) 2026-08-21 07:24:05 +00:00
mcp_server_cyclic_schema.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
mock-acp-typecheck.test.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
monitor.test.ts ci(e2e): stabilize MCP/CLI flows and cancel stale main runs (#4039) 2026-05-12 16:09:30 +08:00
notebook-edit.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
qwen-config-dir.test.ts fix(tests): avoid blocking integration test cleanup (#8688) 2026-08-08 02:17:17 +00:00
qwen-daemon-first-output-benchmark.test.ts test(integration): Measure immediate prompt dispatch stages (#7994) 2026-07-29 23:37:46 +00:00
qwen-daemon-loadtest.test.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
qwen-daemon-startup-benchmark.test.ts test(cli): add daemon startup benchmark (#5825) 2026-06-25 06:56:13 +00:00
qwen-daemon-vs-cli-benchmark.test.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
qwen-serve-baseline.test.ts refactor(cli): Remove serve bridge re-export shims (#5955) 2026-06-28 13:20:44 +00:00
qwen-serve-channel-workers.test.ts fix(cli): Preserve channel startup failure details (#6950) 2026-07-16 01:17:19 +00:00
qwen-serve-client-mcp.test.ts fix(ci): cover release integration regressions (#5994) 2026-06-29 11:54:11 +00:00
qwen-serve-live-journal-recovery.test.ts fix(integration-tests): ack daemon tool-guard handshake in the mock ACP child (#9159) (#9161) 2026-08-15 18:28:01 +00:00
qwen-serve-routes.test.ts fix(cli): Recover sessions across archive races (#9513) 2026-08-22 14:01:59 +00:00
qwen-serve-streaming.test.ts feat(serve): add pollable daemon turn status (#9080) 2026-08-18 06:35:17 +00:00
qwen-serve-webui-live-journal-recovery.test.ts fix(acp-bridge): bound live journal replay chunks (#8801) 2026-08-10 09:52:17 +00:00
read_many_files.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
run_shell_command.test.ts ci(e2e): stabilize MCP/CLI flows and cancel stale main runs (#4039) 2026-05-12 16:09:30 +08:00
save_memory.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
settings-migration.test.ts fix(tests): avoid blocking integration test cleanup (#8688) 2026-08-08 02:17:17 +00:00
simple-mcp-server.test.ts fix(ci): restore release integration env controls (#5121) 2026-06-15 15:56:29 +08:00
sleep-interception.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
stdin-context.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
telemetry.test.ts fix(tests): avoid blocking integration test cleanup (#8688) 2026-08-08 02:17:17 +00:00
todo_write.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
tool-search.test.ts feat(core): enable loop/cron tools by default (#4950) 2026-06-10 23:21:53 +08:00
utf-bom-encoding.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
write_file.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00