debug: clean up Windows repro scenarios
This commit is contained in:
parent
086697d46c
commit
f00fa4d760
3 changed files with 24 additions and 7 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -173,8 +173,6 @@ jobs:
|
||||||
host: windows-latest
|
host: windows-latest
|
||||||
- version: "1.17.10"
|
- version: "1.17.10"
|
||||||
host: windows-2022
|
host: windows-2022
|
||||||
- version: "1.17.10"
|
|
||||||
host: blacksmith-4vcpu-windows-2025
|
|
||||||
runs-on: ${{ matrix.host }}
|
runs-on: ${{ matrix.host }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,8 @@ function Invoke-PtyScenario {
|
||||||
|
|
||||||
node (Join-Path $PSScriptRoot "repro-windows-opentui-pty-session.mjs") -- --exe $Exe --project $Project --version $Version --seconds $Seconds --scenario $Scenario
|
node (Join-Path $PSScriptRoot "repro-windows-opentui-pty-session.mjs") -- --exe $Exe --project $Project --version $Version --seconds $Seconds --scenario $Scenario
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "PTY scenario '$Scenario' failed with exit code $LASTEXITCODE"
|
$script:PtyFailures += "PTY scenario '$Scenario' failed with exit code $LASTEXITCODE"
|
||||||
|
Write-Host "::error::$($script:PtyFailures[-1])"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,6 +126,9 @@ Write-Host "PROCESSOR_ARCHITECTURE=$env:PROCESSOR_ARCHITECTURE"
|
||||||
Write-Section "Install opencode-ai@$Version"
|
Write-Section "Install opencode-ai@$Version"
|
||||||
npm uninstall -g opencode-ai opencode-windows-x64 2>$null | Out-Host
|
npm uninstall -g opencode-ai opencode-windows-x64 2>$null | Out-Host
|
||||||
npm install -g "opencode-ai@$Version"
|
npm install -g "opencode-ai@$Version"
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "npm install opencode-ai@$Version failed with exit code $LASTEXITCODE"
|
||||||
|
}
|
||||||
|
|
||||||
$npmRoot = (npm root -g).Trim()
|
$npmRoot = (npm root -g).Trim()
|
||||||
$exe = Join-Path $npmRoot "opencode-ai\bin\opencode.exe"
|
$exe = Join-Path $npmRoot "opencode-ai\bin\opencode.exe"
|
||||||
|
|
@ -190,16 +194,30 @@ New-Item -ItemType Directory -Force $ptyRoot | Out-Null
|
||||||
Push-Location $ptyRoot
|
Push-Location $ptyRoot
|
||||||
try {
|
try {
|
||||||
npm init -y | Out-Host
|
npm init -y | Out-Host
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "npm init for PTY harness failed with exit code $LASTEXITCODE"
|
||||||
|
}
|
||||||
npm install "@lydell/node-pty@1.2.0-beta.12" | Out-Host
|
npm install "@lydell/node-pty@1.2.0-beta.12" | Out-Host
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "npm install @lydell/node-pty failed with exit code $LASTEXITCODE"
|
||||||
|
}
|
||||||
|
$script:PtyFailures = @()
|
||||||
Invoke-PtyScenario -Scenario "text" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "text" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
|
if ($Version -eq "1.17.10") {
|
||||||
|
Invoke-PtyScenario -Scenario "markdown-no-native-render" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
|
}
|
||||||
Invoke-PtyScenario -Scenario "markdown" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "markdown" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
Invoke-PtyScenario -Scenario "bash-auto" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
|
||||||
Invoke-PtyScenario -Scenario "bash-permission" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "bash-permission" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
Invoke-PtyScenario -Scenario "task-permission" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "task-permission" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
Invoke-PtyScenario -Scenario "mcp-npx" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "mcp-npx" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
if ($Version -eq "1.17.10") {
|
if ($Version -eq "1.17.10") {
|
||||||
Invoke-PtyScenario -Scenario "mcp-npx-no-native-render" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
Invoke-PtyScenario -Scenario "mcp-npx-no-native-render" -Exe $exe -Project $sessionProject -Version $Version -Seconds $PtySeconds
|
||||||
}
|
}
|
||||||
|
if ($script:PtyFailures.Count -gt 0) {
|
||||||
|
Write-Section "PTY Failures"
|
||||||
|
$script:PtyFailures | ForEach-Object { Write-Host $_ }
|
||||||
|
throw "$($script:PtyFailures.Count) PTY scenario(s) failed"
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ function responseText() {
|
||||||
return "The MCP npx spawn storm initialized and the session completed."
|
return "The MCP npx spawn storm initialized and the session completed."
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scenario === "markdown") {
|
if (scenario.startsWith("markdown")) {
|
||||||
const sections = []
|
const sections = []
|
||||||
for (let i = 0; i < 40; i++) {
|
for (let i = 0; i < 40; i++) {
|
||||||
sections.push(`## Section ${i + 1}`)
|
sections.push(`## Section ${i + 1}`)
|
||||||
|
|
@ -380,7 +380,6 @@ const proc = pty.spawn(
|
||||||
: scenario.startsWith("task-")
|
: scenario.startsWith("task-")
|
||||||
? "delegate a small task to a subagent, then summarize"
|
? "delegate a small task to a subagent, then summarize"
|
||||||
: "start a CI repro session and answer briefly",
|
: "start a CI repro session and answer briefly",
|
||||||
...(scenario === "bash-auto" ? ["--auto"] : []),
|
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
name: "xterm-256color",
|
name: "xterm-256color",
|
||||||
|
|
@ -411,10 +410,12 @@ proc.onExit((event) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const deadline = Date.now() + seconds * 1000
|
const deadline = Date.now() + seconds * 1000
|
||||||
|
let completedAt
|
||||||
while (Date.now() < deadline) {
|
while (Date.now() < deadline) {
|
||||||
if (crashPattern.test(output)) break
|
if (crashPattern.test(output)) break
|
||||||
if (exited) break
|
if (exited) break
|
||||||
if (providerRequests > 0 && output.includes("fake provider")) break
|
if (!completedAt && output.includes("message=\"exiting loop\"")) completedAt = Date.now()
|
||||||
|
if (completedAt && Date.now() - completedAt > 8000) break
|
||||||
await delay(500)
|
await delay(500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue