Skip to content

feat: 자동 생성 세션 필터와 워크트리 부모 묶기 - #43

Merged
jeongph merged 7 commits into
mainfrom
feature/wake-session-list
Aug 8, 2026
Merged

feat: 자동 생성 세션 필터와 워크트리 부모 묶기#43
jeongph merged 7 commits into
mainfrom
feature/wake-session-list

Conversation

@jeongph

@jeongph jeongph commented Aug 8, 2026

Copy link
Copy Markdown
Member

세션 목록에 섞여 들어오던 두 가지 잡음을 걷어낸다.

1. 자동 생성 세션 필터

도구가 백그라운드로 돌린 헤드리스 세션(브랜치명 자동 생성, 자동 리뷰 등)이 사람이 연 대화와 구분 없이 목록에 쌓였다. 실측 표본에서 전체 세션의 약 3분의 1을 차지했다.

세션 엔트리의 entrypoint 값으로 가른다. sdk- 로 시작하면 도구가 띄운 것, cli 면 사람이 연 것이다. 표본 전량에서 이 한 필드로 정확히 갈렸고, 프롬프트 문구를 추측하는 방식은 쓰지 않았다.

  • 설정 → 뷰어 → 자동 생성 세션 표시 토글로 되돌릴 수 있고 기본값은 숨김이다
  • 켜면 해당 세션에 자동 배지가 붙는다
  • 세션 목록·프로젝트 카운트·검색 결과에 같은 규칙이 적용된다
  • entrypoint 가 없는 예전 세션은 사람이 연 것으로 본다 — 자동 세션을 잘못 노출하는 편이 사람의 대화를 숨기는 것보다 낫다

판정은 메인에서 하고 숨길지 여부는 렌더러가 정한다. 메인에서 걸러 보내면 토글을 만질 때마다 전체 재스캔이 필요한데, 체크박스 하나에 치를 대가가 아니다. entrypoint 는 기존 파일 스캔이 이미 읽는 구간에 있어 I/O 가 늘지 않는다.

함께 고친 것

세션이 0개인 프로젝트를 상태에서 지워버리고 있었다. 이대로면 토글을 다시 켜도 그 프로젝트가 돌아오지 않는다. 상태에서 지우는 대신 렌더 시점에 거르도록 옮겼다.

2. 워크트리를 부모 저장소로 묶기

워크트리 세션을 부모 저장소 아래로 접어 넣는 로직이 특정 도구의 경로 규칙에만 걸려 있었다. 다른 도구가 만든 워크트리는 전부 별도 최상위 항목으로 흩어졌고, 실측 표본에서는 그쪽이 오히려 더 많았다.

도구명을 하드코딩하는 대신 /.<도구>/worktrees/ 패턴으로 감지한다. 새 도구가 생겨도 코드를 고칠 필요가 없다.

  • 마커 뒤 세그먼트가 하나면 그대로 이름, 둘인데 첫 세그먼트가 부모 저장소명과 같으면 중복이라 벗겨낸다
  • cwd 기록이 있으면 경로를 그대로 가르므로 하이픈이 든 저장소명도 정확하다
  • 기록이 없을 때만 디렉터리명으로 폴백하는데, 그쪽은 구분자가 뭉개져 있어 저장소명 경계를 알 수 없다. 그래서 추측해서 벗기지 않는다

판정을 scanner.ts 에서 worktree.ts 로 떼어냈다. 스캔·메타 읽기·워크트리 판정이 한 파일에 얽혀 있어 테스트가 어려웠다.

결과

실측 표본 기준으로 워크트리 인식률이 3배 가까이 오르고, 최상위 항목이 절반 수준으로 줄었다. 한 저장소의 워크트리들이 도구와 무관하게 한자리에 모인다.

검증

  • 테스트 49개 통과 (이번에 추가한 36개 포함), typecheck·lint 통과
  • 실제 세션 데이터로 필터 비율과 워크트리 묶기 결과를 확인했다
  • UI 렌더링은 눈으로 확인하지 못했다 — 배지 모양과 토글 배치는 리뷰에서 봐주면 좋겠다

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 새 기능
    • 자동 생성 세션과 사용자 세션을 구분해 표시합니다.
    • 설정에서 자동 생성 세션 표시 여부를 켜고 끌 수 있습니다.
    • 자동 생성 세션에 식별 배지가 표시됩니다.
    • 프로젝트와 워크트리의 세션 수를 사용자 세션 기준 또는 전체 기준으로 확인할 수 있습니다.
  • 개선
    • 세션 검색, 프로젝트 그룹화, 워크트리 인식이 더 정확해졌습니다.
    • 세션이 없는 프로젝트와 워크트리도 올바르게 처리됩니다.
  • 테스트
    • 세션 분류, 집계, 워크트리 인식에 대한 검증을 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jeongph, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c9829d6-8082-4699-b61f-2ee87ada5ad4

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef50dd and 6a97b05.

📒 Files selected for processing (3)
  • src/main/lib/scanner.test.ts
  • src/main/lib/worktree.test.ts
  • src/main/lib/worktree.ts
📝 Walkthrough

Walkthrough

세션 스캐너가 entrypoint에서 origin을 판정하고 사용자 세션 수를 집계합니다. 설정에 따라 에이전트 세션을 표시하며, 사이드바 검색·배지·워크트리 집계를 갱신합니다. 워크트리 감지와 관련 테스트를 추가했습니다.

Changes

에이전트 세션 표시

Layer / File(s) Summary
세션 출처 및 스캔 집계
src/shared/types.ts, src/main/lib/sessionOrigin.ts, src/main/lib/scanner.ts, src/main/lib/worktree.ts, src/main/lib/*test.ts
entrypointsdk- 접두사를 agent로 분류합니다. 세션 메타데이터에 origin을 저장하고 userSessionCount를 집계합니다. 워크트리 감지와 검증 테스트를 추가했습니다.
에이전트 세션 표시 설정
src/main/lib/settings.ts, src/renderer/src/prefs.ts, src/renderer/src/components/SettingsDialog.tsx, src/renderer/src/i18n.ts
showAgentSessions의 기본값과 로딩 검증을 추가했습니다. 설정 화면에서 값을 저장하고 한국어·영어 문구를 추가했습니다.
그룹 집계 및 사이드바 표시
src/renderer/src/lib/groups.ts, src/renderer/src/lib/groups.test.ts, src/renderer/src/components/Sidebar.tsx, src/renderer/src/styles/app.css
표시 설정에 따라 세션 수를 선택합니다. 검색 필터와 자동 세션 배지를 추가하고, 표시할 세션이 없는 그룹을 제외합니다.
프로젝트 상태 및 초기 로드 동기화
src/renderer/src/App.tsx
초기 로드와 세션 삭제 후 전체 세션 수 및 사용자 세션 수를 갱신합니다. 빈 프로젝트를 상태에서 유지하고 설정 변경 시 그룹을 다시 계산합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SettingsDialog
  participant Preferences
  participant App
  participant Sidebar
  participant buildGroups

  SettingsDialog->>Preferences: showAgentSessions 저장
  Preferences-->>App: 설정 로드
  App->>buildGroups: 프로젝트와 표시 설정 전달
  buildGroups-->>Sidebar: 표시 세션 그룹 반환
  Sidebar-->>Sidebar: 필터링된 세션과 agent 배지 렌더링
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 자동 생성 세션 필터링과 워크트리의 부모 저장소 그룹화를 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/wake-session-list

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/lib/scanner.test.ts`:
- Around line 39-41: Update the afterEach cleanup in the scanner tests to
recursively remove the temporary directory created by mkdtempSync, using the
existing root symbol, while preserving the CHV_DATA_DIR environment cleanup.

In `@src/main/lib/worktree.ts`:
- Line 10: Update DIR_MARKER and the fallback logic used when realPath is null
so encoded worktree paths with hyphenated tool names, such as
.my-tool/worktrees/..., match the marker boundary and extract the worktree name
correctly. Preserve existing behavior for non-hyphenated names, and add a
regression test covering .my-tool with realPath === null to ensure the session
is identified as a worktree and grouped under its parent repository.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 56cf4f7b-df65-4b2c-8ac3-df401022c3d1

📥 Commits

Reviewing files that changed from the base of the PR and between aeb9e44 and 0ef50dd.

📒 Files selected for processing (16)
  • src/main/lib/scanner.test.ts
  • src/main/lib/scanner.ts
  • src/main/lib/sessionOrigin.test.ts
  • src/main/lib/sessionOrigin.ts
  • src/main/lib/settings.ts
  • src/main/lib/worktree.test.ts
  • src/main/lib/worktree.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/SettingsDialog.tsx
  • src/renderer/src/components/Sidebar.tsx
  • src/renderer/src/i18n.ts
  • src/renderer/src/lib/groups.test.ts
  • src/renderer/src/lib/groups.ts
  • src/renderer/src/prefs.ts
  • src/renderer/src/styles/app.css
  • src/shared/types.ts

Comment thread src/main/lib/scanner.test.ts
Comment thread src/main/lib/worktree.ts Outdated
@jeongph
jeongph merged commit 29698d8 into main Aug 8, 2026
3 checks passed
@jeongph
jeongph deleted the feature/wake-session-list branch August 8, 2026 12:58
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