Skip to content

새 탭은 빈 View로 시작하고, View가 꽉 차면 가장 오래된 것을 닫기 - #1098

Merged
yansfil merged 3 commits into
mainfrom
view-cap-evict
Oct 14, 2026
Merged

yansfil merged 3 commits into
mainfrom
view-cap-evict

Conversation

@yansfil

@yansfil yansfil commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

터미널 링크를 클릭해도 옆 View에 페이지가 열리지 않던 문제를 고칩니다.
원인은 새 Agent 탭에 처음 들어갈 때 앞 탭의 View 목록을 통째로 복사하던 동작이었습니다(#1065).
복사본은 화면에 보이지 않는데도 체크아웃의 View 상한 64개에 같이 들어가서, 탭 몇 개만 오가도 상한이 차고 이후 모든 열기가 거절됐습니다.
거절 종류(browser.open_refused)가 알림 대상이 아니어서 클릭이 아무 반응 없이 무시된 것처럼 보였습니다.

이제 이렇게 동작합니다.

  • 처음 보는 탭은 빈 View로 시작하고 File Views도 꺼져 있습니다.
  • 상한에 닿은 열기는 체크아웃의 모든 탭을 통틀어 가장 오래 안 본 View를 먼저 닫습니다. 화면에 보이는 View와 저장 안 한 문서는 닫지 않습니다.
  • 닫을 수 있는 게 없을 때만 거절하고, 브라우저 열기 거절도 View 알림으로 보입니다.

Review

  • 판단해 주세요: 처음 보는 탭이 빈 View로 시작하면 그 탭으로 갈 때 File Views가 닫힙니다(운영자가 고른 방향). 기존 계약 D-04/B8, B22의 "탭 선택은 열을 바꾸지 않는다"가 Tools 열에만 남습니다.
  • 판단해 주세요: 자동으로 닫힌 파일은 Reopen Closed로 되돌릴 수 있지만, 브라우저 페이지는 되돌리기 스택에 들어가지 않습니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/view_areas.rs - make_view_room은 parked transaction 밖에서만 닫습니다. transaction의 rollback이 다른 presentation을 모두 되돌리기 때문에, 백그라운드 caller는 park 전에 자리를 만듭니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/view_bookmarks.rs - projected owner 자신의 백그라운드 호출은 지금처럼 자기 목록 복사본(owner_copy)으로 일합니다.
  • 비용 검토: 상한에 닿았을 때만, 닫는 View마다 체크아웃 display(최대 64개)를 한 번 더 훑습니다. 그 밖의 경로는 바뀌지 않습니다.

Evidence

  • 확인한 것: 운영자 로그(core.jsonl)에서 링크 클릭마다 browser.open_refused: This Workspace has 64 views open이 찍힌 것을 확인했습니다. 저장 상태는 보이는 13개 + 숨은 탭 복사본 12/12/16/11개였습니다.
  • 확인한 것: 그 상황을 web이 보내는 browser_open payload 그대로 재현한 core 테스트(a_link_opened_in_a_full_workspace_closes_the_oldest_hidden_view)를 추가했습니다. 페이지가 열리고, 숨은 탭에서 가장 오래된 View가 닫히고, 합계는 64로 유지됩니다.
  • 확인한 것: 백그라운드 caller 경로(repeated_hidden_select_is_a_noop_and_a_full_workspace_closes_its_oldest_view)와 닫을 것이 없을 때의 거절 및 그 kind(a_link_opened_with_nothing_to_close_is_refused_with_the_view_reason)를 테스트로 확인했습니다. 기존 거절-롤백 테스트는 닫을 수 없는 View만으로 상한을 채우도록 바꿨습니다.
  • 확인한 것: herdr-core nextest 2240개 통과, clippy -p herdr-core --all-targets -D warnings 통과, cargo fmt --check 통과.
  • 확인하지 못한 것: 패키징한 앱에서 실제로 클릭하는 native 확인은 하지 않았습니다. 설치된 앱을 바꾸려면 운영자 요청이 필요합니다.
  • 확인한 것: 첫 CI에서 Windows desktop e2e의 같은 URL 테스트가 실패했습니다. 새 탭이 첫 탭의 페이지를 물려받는다고 가정한 테스트였습니다. 그래서 desktop browser.spec.ts와 web view-bookmarks, file-view-visibility 스펙을 두 번째 탭의 에이전트가 직접 여는 흐름으로 고쳤습니다(ec8084ead).
  • 확인한 것: 두 번째 CI에서는 web s7.spec.ts의 64개 상한 테스트만 실패했습니다. 거절을 기대하던 테스트라, 가장 오래 본 기록이 이른 View(f10)가 닫히고 새 파일이 열리며 알림이 없는지 확인하도록 바꿨습니다(836f16cd6). 이름이 바뀐 테스트는 shard-durations.json이 다음에 갱신될 때까지 중앙값 시간으로 배정됩니다.
  • 확인하지 못한 것: web/desktop e2e는 로컬에서 돌리지 않았고 CI에 맡깁니다. 디스크 여유가 3 GiB라 로컬 debug 빌드를 생략했습니다.
  • 확인하지 못한 것: 이미 쌓인 복사본은 자동으로 정리되지 않습니다. 다음에 열 때부터 오래된 것부터 닫힙니다.

… Workspace is full

A tab seen for the first time copied every View of the tab in front, and the
copies counted against the checkout's 64-View cap while staying out of
sight, so after a few tab visits every open was refused. A browser open's
refusal also carried a kind the shell does not show, so a terminal link click
did nothing visible.

A new tab now starts with no Views. An open that would pass the cap first
closes the view looked at longest ago in any of the checkout's tabs, never a
view on screen or a document with unsaved work; only when nothing can close
is the open refused, and a browser open's layout refusal now carries the
View layout kind so the shell shows it.
A tab shown for the first time now starts with no Views, so the specs that
relied on it inheriting the first tab's page or file open it from the
second tab's own pane, and count only that tab's Views.
The cap e2e seeded 64 views and expected the 65th open to be refused; the
open now closes the view looked at longest ago, so the seed names it and the
test checks that it closed, the new file opened and no notice showed.
@yansfil
yansfil merged commit 5a956e4 into main Oct 14, 2026
21 checks passed
@yansfil
yansfil deleted the view-cap-evict branch October 14, 2026 09:38
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