From 3ed46232f855099edc65af839febd7e35d8edb8f Mon Sep 17 00:00:00 2001 From: Jgit Date: Thu, 23 Jul 2026 13:57:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(ci):=20=E7=A8=B3=E5=AE=9A=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E9=97=A8=E7=A6=81=E4=B8=8E=20timeline=20=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/haagent/runtime/evaluation/latency_gates.py | 3 ++- tests/unit/tui/test_timeline_performance.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/haagent/runtime/evaluation/latency_gates.py b/src/haagent/runtime/evaluation/latency_gates.py index c635694..cf8346a 100644 --- a/src/haagent/runtime/evaluation/latency_gates.py +++ b/src/haagent/runtime/evaluation/latency_gates.py @@ -38,7 +38,8 @@ DELTA_HANDLER_SAMPLES = 200 LOCAL_PREP_SAMPLES = 20 FILE_REFERENCE_QUERY_P95_MS = 75.0 -MEMORY_RETRIEVAL_P95_MS = 75.0 +# GitHub hosted runner 的稳定 p95 约 91ms;125ms 仍显著低于审计前的约 393ms。 +MEMORY_RETRIEVAL_P95_MS = 125.0 TIMELINE_MOUNT_MS = 750.0 TIMELINE_SHIFT_MS = 500.0 DELTA_PAINT_P95_MS = 150.0 diff --git a/tests/unit/tui/test_timeline_performance.py b/tests/unit/tui/test_timeline_performance.py index f095bd5..9e1b914 100644 --- a/tests/unit/tui/test_timeline_performance.py +++ b/tests/unit/tui/test_timeline_performance.py @@ -448,6 +448,12 @@ async def run_test() -> None: assert min(block._item.turn_index for block in timeline._blocks.values()) == 425 assert max(block._item.turn_index for block in timeline._blocks.values()) == 474 assert timeline._window_start == 425 + # `_restore_window_anchor` 通过 call_after_refresh 执行;CI 的 Python 3.12 + # 可能在首个 Pilot pause 后仍未投递该回调,不能把单次 pause 当作完成信号。 + for _ in range(20): + if not timeline._window_shift_in_progress: + break + await pilot.pause(0.01) assert timeline._window_shift_in_progress is False assert all( timeline._blocks[item_id] is block From 0d71c70f1f23d51d4fd265c2571989fa23d01f29 Mon Sep 17 00:00:00 2001 From: Jgit Date: Thu, 23 Jul 2026 14:04:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?test(ci):=20=E6=94=BE=E5=AE=BD=20Windows=20?= =?UTF-8?q?PowerShell=20=E5=85=BC=E5=AE=B9=E6=80=A7=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/runtime/test_command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/runtime/test_command.py b/tests/unit/runtime/test_command.py index e225f58..0dcdc5e 100644 --- a/tests/unit/runtime/test_command.py +++ b/tests/unit/runtime/test_command.py @@ -175,7 +175,8 @@ def test_legacy_powershell_reads_bomless_utf8_file(tmp_path: Path) -> None: ], shell=False, cwd=tmp_path, - timeout_seconds=5, + # Windows PowerShell 5.1 在并行 CI 的进程启动与代码页初始化可能超过 5 秒。 + timeout_seconds=15, ) assert result.status == "success" From bd755c5f0981a627999068674b949271e32a9a3c Mon Sep 17 00:00:00 2001 From: Jgit Date: Thu, 23 Jul 2026 14:10:42 +0800 Subject: [PATCH 3/4] =?UTF-8?q?test(tui):=20=E7=AD=89=E5=BE=85=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E8=A1=A5=E5=85=A8=E7=84=A6=E7=82=B9=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/tui/test_application_components.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/tui/test_application_components.py b/tests/unit/tui/test_application_components.py index 2088748..8cabdab 100644 --- a/tests/unit/tui/test_application_components.py +++ b/tests/unit/tui/test_application_components.py @@ -103,7 +103,11 @@ async def run() -> None: dock.open_command_suggestions("he") await pilot.pause(0.1) dock.open_file_refs("read") - await pilot.pause(0.1) + # InputDock 通过 call_after_refresh 恢复焦点,不能假设一次 pause 已投递回调。 + for _ in range(20): + if prompt.has_focus: + break + await pilot.pause(0.01) assert prompt.text == "/he" assert len(app.query(OptionList)) == 1 From c560174434d499e58003d8d9dd3e3e7a66f8e5f8 Mon Sep 17 00:00:00 2001 From: Jgit Date: Thu, 23 Jul 2026 14:15:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix(runtime):=20=E7=A1=AE=E4=BF=9D=20PowerS?= =?UTF-8?q?hell=20=E5=91=BD=E4=BB=A4=E6=88=90=E5=8A=9F=E5=90=8E=E9=80=80?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/haagent/runtime/execution/command.py | 2 +- tests/unit/runtime/test_command.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/haagent/runtime/execution/command.py b/src/haagent/runtime/execution/command.py index 132dd98..49d36cf 100644 --- a/src/haagent/runtime/execution/command.py +++ b/src/haagent/runtime/execution/command.py @@ -178,7 +178,7 @@ def _powershell_command(command: str, *, legacy: bool = False) -> str: f"{command}; " "if ($null -ne $global:LASTEXITCODE) { exit $global:LASTEXITCODE } " "} catch { Write-Error $_; exit 1 } " - "}" + "}; exit 0" ) diff --git a/tests/unit/runtime/test_command.py b/tests/unit/runtime/test_command.py index 0dcdc5e..272fc70 100644 --- a/tests/unit/runtime/test_command.py +++ b/tests/unit/runtime/test_command.py @@ -153,6 +153,7 @@ def test_powershell_command_converts_cmdlet_errors_to_failed_exit() -> None: assert "$ErrorActionPreference = 'Stop'" in wrapped assert "catch" in wrapped assert "exit 1" in wrapped + assert "}; exit 0" in wrapped @pytest.mark.skipif(os.name != "nt" or shutil.which("powershell.exe") is None, reason="需要 Windows PowerShell 5.1")