Repository navigation
Wait for the Windows shell condition Herdr checks before a fixture agent start - #730
Merged
Merged
Conversation
On Windows the pinned Herdr counts a pane's shell as available only while no process in the process table names it as its parent, by pid alone, which `pane process-info` does not show. The fixture waited on the foreground job instead, so a shell whose pid Windows had reused from the exited smss.exe that csrss.exe and winlogon.exe still name looked alone while Herdr refused it for the rest of the run. startAgentAtShell now reads that condition with hide-children.exe and fails at once when an older process claims the shell. The workspace replacement startHerdr used for its own two shells is one helper, unclaimedWorkspace, which every `workspace create` sent through fixture.run now goes through as well.
startHerdr's setup wait still read the macOS and Linux condition on Windows while startAgentAtShell read the Windows one. Both now call shellAvailability, so the two waits cannot drift apart again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #726
Summary
Windows에서 fixture는
pane process-info로 "shell이 혼자"인지 보고 agent를 시작했습니다. 하지만 고정된 Herdr(v0.9.1)의 Windowsagent.start는 다른 조건을 씁니다: 프로세스 표에서 shell pid를 부모로 적은 프로세스가 하나도 없어야 합니다(시작 시각 비교 없이 pid만, 후손까지).#726 run에서 pane의
cmd.exe(7964)는 세션을 만들고 끝난smss.exe의 pid를 다시 받았고,csrss.exe·winlogon.exe가 아직 그 pid를 부모로 적고 있었습니다. process-info는 shell 혼자로 보였지만 Herdr는 그 pane을 끝까지 busy로 거절했습니다(재시도는 다른 pid를 받은 새 pane이라 통과).shellAvailability)로 두고,startHerdr의 setup 대기와startAgentAtShell이 둘 다 부릅니다. Windows에서는 Herdr의 조건 그대로(hide-children.exe로 shell을 부모로 적은 프로세스를 읽음), macOS·Linux는 전과 같이 foreground group입니다.startHerdr의 두 shell에만 하던 교체를 helper 하나(unclaimedWorkspace)로 합쳐, spec이fixture.run으로 보내는workspace create(spawnAgent포함)도 같은 코드를 씁니다.docs/TESTING.md와docs/ARCHITECTURE.md(Starting an agent)에 Windows 조건을 적었습니다.Review
agent_start::start_at_shell은 30초 뒤 실패). Herdr의 결함이라 upstream issue 초안을 운영자 승인 대기로 남겼습니다(제안: 후손 판정에 시작 시각 비교).web/e2e/herdr-fixture.tsrun- 모든 spec의workspace create가 지나갑니다. Windows가 아니면 그대로 반환하고, Windows에서는 만든 직후 pane마다hide-children.exe를 한 번 돌립니다.startHerdr- 교체 검사가 prompt 대기 뒤에서 앞(만든 직후)으로 옮겨졌습니다. Herdr는 create에 답하기 전에 shell pid를 저장하므로(src/pane.rsspawn) 대기가 필요 없습니다.tab create·pane split로 만든 pane은 교체하지 않습니다(그런 pane에서 Windows agent를 시작하는 spec은 지금 없음). 그런 pane의 agent start는 프로세스를 적고 바로 실패합니다.desktop/e2e/agent-spawn-fixture.ts의waitForSpawnShell도 같은 판정이지만agent-spawn.spec.ts가@platform이 아니라 Windows에서 돌지 않아 손대지 않았습니다.Evidence
7976 ... older csrss.exe, 8024 ... older winlogon.exe. issue 본문은 600자에서 잘려 이 부분이 빠져 있었습니다.src/app/agents.rs(available_shell_name이platform::available_pane_shell호출, 없으면agent_pane_busy),src/platform/windows.rs(available_pane_shell→descendant_entries,th32ParentProcessID만 비교). upstream #3485에서 maintainer가 "Windows process-info는 shell만 보여도 agent start는 후손이 있으면 거절"이라고 확인.web/e2e/herdr-fixture.ts·checkout-pr.spec.ts를 바꾸지 않았고, 실패는 spec이 hided를 시작하기 전workspaceAt안이었습니다.desktop/e2e가 이 fixture를 import,tsc -p e2e), policy 검사 5개, design-contract, script tests 168개 통과.windows e2elane에서 agent start마다 돕니다.