[codex] Discover projects from transcript metadata#41
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds transcript-backed project discovery: server scans bounded transcript JSONL metadata under ~/.openclaude/projects/, aggregates cwd/usage/session/timestamp data, merges with configured projects, computes active projects by recency, exposes diagnostics, and updates tests and docs. ChangesTranscript-based project discovery
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 5❌ Failed checks (5 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e33e234e-4e8d-41e6-b129-e6160f8460e7
📒 Files selected for processing (8)
README.mdapps/server/README.mdapps/server/src/http/server.test.tsapps/server/src/services/openclaudeData.test.tsapps/server/src/services/openclaudeData.tsdocs/architecture.mddocs/privacy-and-redaction.mddocs/troubleshooting.md
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/server/src/services/openclaudeData.ts (1)
350-352:⚠️ Potential issue | 🟠 Major | ⚡ Quick winTighten worktree-root matching; the prefix fallback accepts spoofed roots.
isTranscriptRootForCwd()currently treats any directory named${encodeProjectPath(projectPath)}--claude-worktrees-*as valid, even when the rowcwdis only the parent project path. That weakens the “cwd must match transcript root” check and lets unrelated roots under~/.openclaude/projectsclaim a project. For real worktree transcripts,transcriptRootName === encodeProjectPath(cwd)already matches the encoded worktree path, so the prefix branch can be removed and covered with a regression test.Suggested fix
function isTranscriptRootForCwd( transcriptRootName: string, cwd: string, projectPath: string, ): boolean { const encodedProjectPath = encodeProjectPath(projectPath); return ( transcriptRootName === encodeProjectPath(cwd) || - transcriptRootName === encodedProjectPath || - transcriptRootName.startsWith(`${encodedProjectPath}--claude-worktrees-`) + transcriptRootName === encodedProjectPath ); }Based on learnings: pass only if file access stays inside expected OpenClaude data locations and fail on expanded read scope without a safety explanation.
Also applies to: 402-407
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 960f1785-a29f-43f7-9be1-aca078ca738e
📒 Files selected for processing (2)
apps/server/src/services/openclaudeData.test.tsapps/server/src/services/openclaudeData.ts
Summary
~/.openclaude/projects/when~/.openclaude.jsonomits projects..claude/worktrees/*transcript roots into their parent project, and reject mismatchedcwdrows.Root Cause
OpenClaude Studio built the project selector only from
~/.openclaude.json. OpenClaude can retain valid project transcript directories under~/.openclaude/projects/even when those projects are absent from the global config, so those projects did not appear in Studio.Validation
coderabbit review --agent -t uncommittednpm testnpm run buildnpm run lintnpm run test:e2egit diff --checkSecurity and Privacy
cwdmetadata must match the transcript root before a project is added.Purpose and impact
Adds transcript-backed project discovery to OpenClaude Studio so the server surfaces valid projects found in ~/.openclaude/projects/ when they are not listed in ~/.openclaude.json. Visible effect: transcript-only projects can appear in the project selector without manual config edits.
Technical changes
Compatibility, security, privacy, release notes
Validation
Tests and recommended validation commands included in the PR: coderabbit review --agent -t uncommitted; npm test; npm run build; npm run lint; npm run test:e2e; git diff --check.