fix(agent99): use Windows-safe callback files

This commit is contained in:
ogt
2026-07-14 09:29:44 +08:00
parent c463fdc9ef
commit ae6be9db4d
2 changed files with 23 additions and 2 deletions

View File

@@ -242,6 +242,18 @@ def test_agent99_object_reader_preserves_ordered_callback_identity() -> None:
assert "elseif ($Data -and $Data.PSObject.Properties[$Name])" in helper
def test_agent99_callback_queue_uses_windows_safe_file_keys() -> None:
source = CONTROL.read_text(encoding="utf-8")
helper = source[source.index("function Convert-AgentSafeFileName") :]
helper = helper[: helper.index("function New-AgentOutcomeCheck")]
assert '"[^A-Za-z0-9_.-]"' in helper
assert '"[^A-Za-z0-9_.:-]"' not in helper
assert "$callbackFileKey = Convert-AgentSafeFileName $callbackId" in source
assert 'Join-Path $pendingDir "$callbackFileKey.json"' in source
assert "$safeCallbackId = Convert-AgentSafeFileName $callbackIdValue" in source
def test_agent99_completion_token_is_bound_without_reusing_telegram_secret() -> None:
api_deployment = (ROOT / "k8s/awoooi-prod/06-deployment-api.yaml").read_text()
worker_deployment = (