Skip to content

feat(daemon): add session artifact content retention#3

Closed
chiga0 wants to merge 1 commit into
feat/session-artifacts-persistence-v2-designfrom
feat/session-artifacts-content-retention
Closed

feat(daemon): add session artifact content retention#3
chiga0 wants to merge 1 commit into
feat/session-artifacts-persistence-v2-designfrom
feat/session-artifacts-content-retention

Conversation

@chiga0

@chiga0 chiga0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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:

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

Tested on

OS Status
macOS tested
Windows not tested
Linux not tested

Environment (optional)

Local Node/npm workspace; no sandbox runtime required for the targeted checks above.

Risk & Scope

  • Main risk or tradeoff: retained artifact content touches filesystem safety, quota behavior, deletion/GC behavior, and SDK/API compatibility, which is why it is isolated from the metadata persistence PR.
  • Not validated / out of scope: full cross-platform CI and end-to-end interactive workflows beyond the targeted package checks above.
  • Breaking changes / migration notes: none intended. This PR is stacked on feat(daemon): persist session artifacts across restarts QwenLM/qwen-code#6259 and should not be merged independently of that base.

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 独立合并。

@chiga0

chiga0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

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: +3286/-47 across 24 files relative to feat/session-artifacts-persistence-v2-design.

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

@chiga0

chiga0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

CI note: the current failing check is the fork auto-review workflow, not a code/test failure. The failed job exits before reviewing with:

No auth type is selected. Please configure an auth type (e.g. via settings or `--auth-type`) before running in non-interactive mode.

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 review-pr.

@chiga0

chiga0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant