Skip to content

작업이 끝난 에이전트 pane이 남은 워크트리는 정리 시트에서 고를 수 없다 #394

Closed

Description

@yansfil

The task you are doing when you want this

머지가 끝난 워크트리를 디스크 정리 시트에서 한 번에 지우고 싶다.

What hide does today

정리 시트는 열린 pane이 하나라도 있는 워크트리를 고를 수 없게 한다(docs/UI_BEHAVIOR.md, Disk allocation and cleanup: "merged into local main, clean, has no open pane, …").
에이전트 CLI는 작업을 마친 뒤에도 pane의 foreground 프로그램으로 남아 있어, 끝난 에이전트 pane도 정리를 막는다.

2026-10-04 기준 HEAD가 이미 origin/main에 들어 있던 워크트리 28개 중 12개에 작업을 마친(done) 에이전트 pane이 남아 있었고, 작업 중인 에이전트가 있는 곳은 없었다.
우클릭 삭제(remove_worktree)는 pane을 먼저 닫고 지우지만, 정리 시트는 이런 워크트리를 제외만 한다.
이 판단은 문서와 herdr-core/src/worktree_cleanup.rs를 읽고 실제 상태에 대입한 것이며, 시트를 열어 확인하지는 않았다.

What it should do instead

  • 작업 중이거나 입력을 기다리는 에이전트, 셸이 아닌 프로그램을 돌리는 터미널, 열린 포트만 정리를 막는다.
  • 작업을 마친 에이전트 pane만 남은 워크트리는 고를 수 있고, 확인 단계에서 그 pane들이 함께 닫힌다고 보여준다.
  • 위임된 하위 에이전트가 작업 중이면 부모 워크트리도 막는다.

같은 계열 도구의 방식은 이렇다.

  • Orca는 foreground가 셸이거나, 알려진 에이전트 프로세스이면서 pane 제목이 idle이면 막지 않는다.
    "열린 터미널이 있으면 거부" 규칙 때문에 끝난 워크트리가 지워지지 않는 문제를 겪었다([Bug]: Fail-closed worktree delete + failed PTY kill turns finished automation worktrees into undeletable disk leaks stablyai/orca#21954, #22161).
  • Conductor는 에이전트가 실행 중일 때만 보관을 막는다(0.34.0 "Archiving is now blocked while agents are running").
  • Mux는 하위 에이전트가 활동 중이면 부모 보관을 거절한다("This workspace has active descendant sub-agents. Stop them before archiving their parent.").

Where the authority for it lives

사용 중 판정은 core의 read_in_use(herdr-core/src/worktree_cleanup.rs)가 가지고, 에이전트의 작업 중, 대기, 완료 상태는 이미 Herdr가 보고한다.
pane을 닫는 실행은 기존 remove_worktree 경로를 쓸 수 있다.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions