qwen-code/integration-tests/cli
jinye aef35c390e
feat(serve): session metadata and close/delete lifecycle (#4175 Wave 2.5 PR 11) (#4240)
* feat(serve): session metadata and close/delete lifecycle (#4175 Wave 2.5 PR 11)

Add explicit session close and metadata management to the daemon serve
infrastructure, closing the Stage 1 limitation that sessions could only
end via child crash or daemon shutdown.

- DELETE /session/:id — force-closes a live session (cancels active
  prompt, resolves pending permissions, publishes session_closed event)
- PATCH /session/:id/metadata — update mutable displayName
- Enriched GET /workspace/:id/sessions with createdAt, displayName,
  clientCount, hasActivePrompt
- session_closed + session_metadata_updated SDK event types with
  validation, reducer, and terminal event priority
- DaemonClient.closeSession / updateSessionMetadata + session client
  wrappers
- Capabilities: session_close, session_metadata

* fix(serve): address review feedback on session lifecycle PR

- Fix JSDoc on closeSession: clarify that bridge throws SessionNotFoundError
  (SDK absorbs 404 for client-side idempotency)
- Tighten event validators: isSessionClosedData checks closedBy type,
  isSessionMetadataUpdatedData checks displayName type
- PATCH /session/:id/metadata now returns effective stored metadata
  instead of echoing request fields, avoiding ambiguous no-op responses
- Only publish session_metadata_updated event when displayName changes
- Update chooseTerminalEvent comment to reflect session_closed

* fix: address PR 4240 review feedback

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

* fix: address remaining PR 4240 suggestions

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

* fix: update serve sessions test mock

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

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-17 20:42:15 +08:00
..
_daemon-harness.ts test(perf): add daemon baseline harness (#4175 Wave 1 PR 1) (#4205) 2026-05-17 00:41:26 +08:00
acp-cron.test.ts feat(cron): integrate cron scheduling into ACP session lifecycle 2026-03-30 18:06:09 +08:00
acp-integration.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
cron-tools.test.ts test: stabilize main e2e flakes (#3992) 2026-05-10 21:50:04 +08:00
edit.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
extensions-install.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
file-system.test.ts test: stabilize main e2e flakes (#3992) 2026-05-10 21:50:04 +08: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 Merge remote-tracking branch 'origin/main' into feat/in-session-cron-loops 2026-03-30 19:08:25 +08:00
mcp_server_cyclic_schema.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
monitor.test.ts ci(e2e): stabilize MCP/CLI flows and cancel stale main runs (#4039) 2026-05-12 16:09:30 +08:00
qwen-config-dir.test.ts feat(core): support QWEN_HOME env var to customize config directory (#2953) 2026-05-09 15:51:52 +08:00
qwen-serve-baseline.test.ts test(perf): skip daemon baseline harness under sandbox (#4234) 2026-05-17 17:52:34 +08:00
qwen-serve-routes.test.ts feat(serve): session metadata and close/delete lifecycle (#4175 Wave 2.5 PR 11) (#4240) 2026-05-17 20:42:15 +08:00
qwen-serve-streaming.test.ts refactor(serve): 1 daemon = 1 workspace (#3803 §02) (#4113) 2026-05-15 12:44:36 +08: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 feat: add commit attribution with per-file AI contribution tracking (#3115) 2026-05-08 09:55:58 +08:00
simple-mcp-server.test.ts test(integration): pin simple-mcp-server to legacy MCP discovery path (#4164) 2026-05-15 11:35:17 +08:00
sleep-interception.test.ts feat(core): event monitor tool with throttled stdout streaming (Phase C) (#3684) 2026-05-02 20:57:26 +08:00
stdin-context.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
telemetry.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
todo_write.test.ts refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00
tool-search.test.ts feat(tools): add ToolSearch for on-demand loading of deferred tool schemas (#3589) 2026-05-10 14:29:25 +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 refactor(tests): reorganize integration tests by execution mode 2026-03-29 05:49:17 +00:00