issue-agent prep-host: Get-CimInstance wedges in runner context on PC-user #162
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens#162
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Paused for the night, picking up tomorrow. Captures everything we figured out so future-me / future-Claude doesn't re-do the diagnosis.
Symptom
Prepare issue-agent hoststep in the issue-agent workflow hangs on thenelsonpc-userrunner insideStop existing STS2 processes(theGet-CimInstance Win32_Process | … | Stop-Processblock in.github/scripts/prepare-issue-agent-job.ps1). Step rides thetimeout-minutes: 10cap to the end and fails. Reproducible across at least three runs:Stop existing STS2 processes, then ten minutes of silence. Game wasn't even running on the host — so the foreach iterates zero times and the only thing that can hang isGet-CimInstance Win32_Processitself.What we ruled out
Get-CimInstance Win32_Processinteractively on PC-user; it returned fine.2fc2a67(your commit, 2026-04-26). #161 just wrapped it inInvoke-LoggedStep.Likely cause
Runner context vs interactive context difference. WMI / DCOM behaves differently when called from a service / Session 0 / non-interactive shell vs an interactive desktop. Some providers stall on impersonation / message-pump waits that don't exist in the runner's session. Endpoint-protection products sometimes inspect WMI calls from background processes with extra scrutiny that turns into a stall.
Important contributing factor: #159 migrated
shell: powershell→shell: pwsh. Pre-#159, this exact code ran on Windows PowerShell 5.1 (DCOM transport, .NET Framework). Successful runs existed in that window (e.g. PR #155 Pocketwatch at 01:53Z on 2026-04-29). Post-#159,Get-CimInstanceruns under PS 7 / .NET 7+ / different defaults — which exposed whatever runner-context fragility was already latent.Open questions for tomorrow
services.msc→ look foractions.runner.*), service-context WMI is a well-known stall source. This is the single biggest "what changed" answer.nelsonlaptop? (All the recent failures were on PC-user; laptop's pwsh-availability fix is separate.)Proposed fix (~90% confidence)
Replace
Get-CimInstance Win32_ProcesswithGet-Process -Name 'SlayTheSpire2','crashpad_handler'in the kill block.Get-ProcesscallsNtQuerySystemInformationdirectly — no WMI / DCOM / impersonation involved, behaves identically in interactive and service sessions. Same shape exists in.github/scripts/restart-sts2.ps1(Get-Sts2Processeshelper) — should get the same treatment in one PR.Belt-and-suspenders for the kill itself: add
WaitForExit(5000)per process and escalate totaskkill /F /T /PIDif Stop-Process didn't terminate within the budget. Doesn't address the actual hang (which is in enumeration), but hardens the kill against legitimately wedged STS2 processes.Sketch:
What shipped today (already merged, no follow-up needed)
create_branch/create_or_update_file/delete_file; addedcommit_to_branch. Eliminates the "stale base SHA" PR-revert footgun by resolving refs server-side at call time. Memory: nevergit pushfrom session pods, all GitHub mutation via these MCP tools.list_workflow_run_jobs+get_workflow_job_logs. This is what let me read the prep-host log from chat instead of asking you to RDP and paste.Pickup checklist for tomorrow
commit_to_branchcall:prepare-issue-agent-job.ps1+restart-sts2.ps1).issue-agent. Verify prep-host completes in seconds.Start-ThreadJob+Wait-Job -Timeout 30around the kill block.