diff --git a/agent99-control-plane.ps1 b/agent99-control-plane.ps1 index e1e138604..050259013 100644 --- a/agent99-control-plane.ps1 +++ b/agent99-control-plane.ps1 @@ -514,11 +514,14 @@ function Get-AgentObjectValue { [string]$Name, [object]$Default = $null ) - if ($Data -and $Data.PSObject.Properties[$Name]) { + $value = $null + if ($Data -is [System.Collections.IDictionary] -and $Data.Contains($Name)) { + $value = $Data[$Name] + } elseif ($Data -and $Data.PSObject.Properties[$Name]) { $value = $Data.PSObject.Properties[$Name].Value - if ($null -ne $value -and [string]$value -ne "") { - return $value - } + } + if ($null -ne $value -and [string]$value -ne "") { + return $value } $Default } diff --git a/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py b/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py index 6b0243e4b..3d2fc4530 100644 --- a/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py +++ b/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py @@ -231,6 +231,17 @@ def test_agent99_completion_callback_waits_for_durable_same_trace_readback() -> assert 'secretValueLogged = $false' in source +def test_agent99_object_reader_preserves_ordered_callback_identity() -> None: + source = CONTROL.read_text(encoding="utf-8") + helper = source[source.index("function Get-AgentObjectValue") :] + helper = helper[: helper.index("function Limit-AgentTextLine")] + + assert "$Data -is [System.Collections.IDictionary]" in helper + assert "$Data.Contains($Name)" in helper + assert "$Data[$Name]" in helper + assert "elseif ($Data -and $Data.PSObject.Properties[$Name])" in helper + + 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 = (