feat(daemon): add session artifact content retention#3
Conversation
|
This PR is intentionally stacked on QwenLM#6259. Please review it as the content-retention delta only; metadata persistence remains in the base PR. Current stacked diff: Scope in this PR: pin/unpin, retained content reads, content refs and hashes, quota/GC behavior, and REST/ACP/SDK exposure for retained content. Local validation passed: cd packages/acp-bridge && npm run typecheck
cd packages/sdk-typescript && npm run typecheck
cd packages/acp-bridge && npm run build
cd packages/cli && npm run typecheck
cd packages/sdk-typescript && npx vitest run test/unit/DaemonClient.test.ts test/unit/DaemonSessionClient.test.ts test/unit/acpRouteTable.test.ts
cd packages/cli && npx vitest run src/serve/server.test.ts -t "session artifact routes" --coverage.enabled=false
cd packages/cli && npx vitest run src/serve/acp-http/transport.test.ts -t "_qwen/session/artifacts" --coverage.enabled=false
cd packages/acp-bridge && npx vitest run src/bridge.test.ts src/sessionArtifacts.test.ts
npx prettier --check packages/acp-bridge/src/bridge.test.ts
git diff --check |
|
CI note: the current failing check is the fork auto-review workflow, not a code/test failure. The failed job exits before reviewing with: I am leaving the code unchanged. Local targeted validation for this stacked diff passed as listed above; the failure appears to be fork workflow/auth configuration for |
|
Superseded by the corrected upstream stacked PR: https://github.com/QwenLM/qwen-code/pull/6346\n\nClosing this fork-only PR because review should happen in QwenLM/qwen-code, with QwenLM#6259 as the stack base. |
What this PR does
This is the stacked content-retention follow-up to QwenLM#6259. It restores artifact content retention on top of the metadata-persistence base: content pinning and unpinning, retained content reads, quota and cleanup behavior, hash-backed content references, REST/ACP/SDK exposure, and focused coverage for the content-retention paths.
Why it's needed
QwenLM#6259 has been narrowed to metadata persistence so reviewers can validate restart recovery, journal rebuild, and fork-remap behavior separately from filesystem content retention. This PR isolates the higher-risk content surface so path safety, ownership, quota, content hashing, lease, and garbage-collection behavior can be reviewed on their own.
Reviewer Test Plan
How to verify
Review this PR as a stacked delta on top of QwenLM#6259. Confirm metadata persistence remains in the base PR, then verify this PR adds only content-retention behavior: pinning content, reading retained content after source changes, unpin cleanup behavior, quota rejection, GC warnings, and REST/ACP/SDK routing for retained content.
Evidence (Before & After)
N/A for UI. Local checks passed on macOS:
Tested on
Environment (optional)
Local Node/npm workspace; no sandbox runtime required for the targeted checks above.
Risk & Scope
Linked Issues
Stacked on QwenLM#6259.
中文说明
这个 PR 做什么
这是 QwenLM#6259 之后的 stacked content-retention PR。在 metadata persistence 基础上恢复 artifact content retention:content pin/unpin、保留内容读取、quota 和清理行为、基于 hash 的 content reference、REST/ACP/SDK 暴露,以及 content-retention 路径的重点覆盖。
为什么需要
QwenLM#6259 已经收窄为 metadata persistence,方便 reviewer 单独验证 restart recovery、journal rebuild 和 fork-remap。这个 PR 把风险更高的 content surface 单独拆出,让 path safety、ownership、quota、content hashing、lease 和 garbage collection 行为可以独立 review。
Reviewer Test Plan
请把这个 PR 作为基于 QwenLM#6259 的 stacked delta review。先确认 metadata persistence 留在 base PR,再验证这个 PR 只增加 content-retention 行为:pin content、源文件变化后读取 retained content、unpin cleanup、quota rejection、GC warning,以及 retained content 的 REST/ACP/SDK routing。
Evidence (Before & After)
UI 不适用。macOS 本地已通过上面列出的 targeted checks。
Risk & Scope
主要风险是 retained artifact content 触及 filesystem safety、quota、deletion/GC 和 SDK/API compatibility,所以它从 metadata persistence PR 中拆出单独 review。未覆盖完整跨平台 CI 和更完整的交互式 E2E。没有预期 breaking change;这个 PR stacked on QwenLM#6259,不应脱离 base 独立合并。