Skip to content

docs: .env.example 补充 WORKSPACE_MAX_AGE_DAYS 说明 - #277

Merged
lishuceo merged 1 commit into
mainfrom
feat/claude-session-e9544f
Aug 8, 2026
Merged

docs: .env.example 补充 WORKSPACE_MAX_AGE_DAYS 说明#277
lishuceo merged 1 commit into
mainfrom
feat/claude-session-e9544f

Conversation

@lishuceo

@lishuceo lishuceo commented Aug 8, 2026

Copy link
Copy Markdown
Owner

背景

线上工作区被清理的实际窗口是 3 天src/config.tsWORKSPACE_MAX_AGE_DAYS 默认值),但 .env.example 里完全没有提到这个变量,容易被误认为是一周或更久。

改动

  • .env.example 工作区配置段补充 WORKSPACE_MAX_AGE_DAYS 注释,说明默认 3 天,且该值同时决定 thread session 的空闲过期时间(过期后其自动创建的工作区目录一并删除)。

纯文档改动,无代码逻辑变更。线上部署侧已单独把该值调整为 30 天(.env 不入库)。

🤖 Generated with Claude Code

该变量决定工作区目录与 thread session 的保留天数(代码默认 3 天),
之前未在 .env.example 中记录,容易被误认为默认一周。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Claude finished @lishuceo's task in 1m 2s —— View job


Claude Code Review

  • Check previous review comments (none found)
  • Read the diff
  • Verify claims in the new .env.example comment against source
  • Post review

✅ Approved

Pure documentation change. I verified every factual claim in the new comment against the source — all three are accurate.

Verification

Claim in .env.example Source Status
默认 3 src/config.ts:125parseInt(process.env.WORKSPACE_MAX_AGE_DAYS || '3', 10)
同时决定 thread session 的空闲过期时间 src/session/manager.ts:237-240threadMaxIdleMs = config.workspace.maxAgeDays * 24*60*60*1000, used as the cutoff for deleteExpiredThreadSessionsByCutoff
自动创建的工作区目录一并清理 src/session/manager.ts:245-261 — deletion is gated on isAutoWorkspacePath(thread.workingDir), so user-specified paths are preserved

The "自动创建的" qualifier is a good catch — without it the comment would over-promise, since manually-specified workingDir values are deliberately left alone. config.workspace.maxAgeDays has exactly one consumer (session/manager.ts:237), which also feeds cleanupOrphanWorkspaces() at line 267, so the documented scope is complete.

Placement inside the === 工作区配置 === block next to WORKSPACE_BASE_DIR / WORKSPACE_BRANCH_PREFIX is consistent with the file's existing convention (commented-out line preceded by an explanatory comment, default value inlined).

Notes (non-blocking, no action requested)

  • No tests needed — the repo's testing policy in CLAUDE.md applies to feat/fix commits, not docs-only changes.
  • Pre-existing gap, not introduced here: REPO_CACHE_MAX_AGE_DAYS (default 30, src/config.ts:133), REPO_CACHE_MAX_SIZE_GB, and REPO_CACHE_FETCH_INTERVAL_MIN are also undocumented in .env.example, which documents only REPO_CACHE_DIR. Worth a follow-up if you want the same clarity for the cache knobs. Fix this →

No issues found. Zero risk to merge.
· Branch: feat/claude-session-e9544f

@lishuceo
lishuceo merged commit 98135ef into main Aug 8, 2026
4 checks passed
@lishuceo
lishuceo deleted the feat/claude-session-e9544f branch August 8, 2026 17:15
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