fix(agent99): harden Windows99 no-IME transport
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 2s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m29s
CD Pipeline / build-and-deploy (push) Successful in 29m59s
AI 技術雷達監控 / ai-technology-watch (push) Successful in 38s
CD Pipeline / post-deploy-checks (push) Successful in 4m20s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 1s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 18s

This commit is contained in:
Your Name
2026-07-17 13:47:59 +08:00
parent 30c2a1807c
commit 402d11fd82
9 changed files with 438 additions and 14 deletions

View File

@@ -554,6 +554,34 @@ def test_agent99_bounds_stale_ssh_processes_without_touching_tunnels() -> None:
}
def test_agent99_bounds_legacy_windows_probe_processes_without_command_capture() -> None:
source = CONTROL.read_text(encoding="utf-8")
config = json.loads((ROOT / "agent99.config.99.example.json").read_text())
deploy = DEPLOY.read_text(encoding="utf-8")
guard = source[source.index("function Get-AgentWindowsProbeProcessGuardConfig") :]
guard = guard[: guard.index("function Get-AgentObjectValue")]
assert "SELECT ProcessId,ParentProcessId,CreationDate,Name" in guard
assert "CommandLine LIKE '%scriptblock%Create%Console%ReadToEnd%'" in guard
assert "CommandLine LIKE '%-Mode $probeMode%'" in guard
assert 'parentName -ieq "cmd.exe"' in guard
assert "Select-Object -First $guard.maxStopsPerRun" in guard
assert "Stop-Process -Id $candidate.pid -Force" in guard
assert "commandLineCaptured = $false" in guard
assert "CommandLine =" not in guard
assert 'Record-AgentEvent "windows_probe_process_guard"' in guard
assert config["windowsProbeProcessGuard"] == {
"enabled": True,
"staleMinutes": 10,
"maxStopsPerRun": 20,
}
assert 'Add-DefaultProperty $config "windowsProbeProcessGuard"' in deploy
assert 'Add-DefaultProperty $config.windowsProbeProcessGuard "staleMinutes" 10' in deploy
assert 'Add-DefaultProperty $config.windowsProbeProcessGuard "maxStopsPerRun" 20' in deploy
assert "$windowsProbeProcesses = Get-AgentStaleWindowsProbeProcessReadback" in source
assert "windowsProbeProcessStaleCount = $windowsProbeProcesses.staleCount" in source
def test_agent99_serializes_ssh_across_scheduled_task_processes() -> None:
source = CONTROL.read_text(encoding="utf-8")
config = json.loads((ROOT / "agent99.config.99.example.json").read_text())