The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(agent): the "on <X> via acpx" ack cue names only ACP agents
Teknium0615c90df8ca
diff --git a/agent/agent_runtime_helpers.py b/agent/agent_runtime_helpers.pyindex bf85ee21e27..5cce128d43a 100644--- a/agent/agent_runtime_helpers.py+++ b/agent/agent_runtime_helpers.py@@ -3182,7 +3182,7 @@ def looks_like_codex_intermediate_ack(return False# Some tool-using providers narrate the next action in terse log style: "Brief written. Creating the# session now." Bare gerunds are too ambiguous ("Reading the traceback explains the failure" is a final- # answer), so this path also requires an explicit transition cue such as "now", "on <provider> via acpx",+ # answer), so this path also requires an explicit transition cue such as "now", "on <ACP agent> via acpx",# "actual log", or "then launching". Completed reports and questions stay final.action_clause_pattern = re.compile(r"(?:^|[.!…—–]\s+|\n+\s*|,\s+then\s+)"@@ -3225,15 +3225,14 @@ def looks_like_codex_intermediate_ack(r"\s+now\s*[—–-]\s*see\s+https?://\S+"r"(?:\s+for\s+progress)?\s*$")- from providers import list_providers # "relaunching it on <any registered provider name or alias>"- provider_names = sorted({n.lower() for p in list_providers() for n in (p.name, *p.aliases) if n})+ from providers import list_providers # "relaunching it on <an ACP agent: its name, alias or binary>"+ provider_names = sorted({n.lower() for p in list_providers() if p.auth_type == "external_process"+ for n in (p.name, *p.aliases, p.process_command) if n})provider_tail_pattern = re.compile(r"\s+(?:it|(?:the\s+)?(?:session|worker|agent|job|process))\s+"rf"on\s+(?:{'|'.join(map(re.escape, provider_names)) or '(?!)'})(?:\s+via\s+acpx)?\s*$")- actual_log_tail_pattern = re.compile(- r"\s+(?:the\s+)?actual\s+(?:log|output)\s*$"- )+ actual_log_tail_pattern = re.compile(r"\s+(?:the\s+)?actual\s+(?:log|output)\s*$")health_check_tail_pattern = re.compile(r"\s+whether\b.*\b(?:healthy|ready|running|available|reachable|working)\s*$")diff --git a/tests/agent/test_profile_declared_core_sets.py b/tests/agent/test_profile_declared_core_sets.pyindex 1cdcfde660f..a66f0cd0e53 100644--- a/tests/agent/test_profile_declared_core_sets.py+++ b/tests/agent/test_profile_declared_core_sets.py@@ -33,18 +33,25 @@ def test_ambient_credential_profile_keeps_identity_when_catalog_fails():assert ac._preserve_provider_with_base_url("plain-key") is False-def test_ack_detector_transition_cue_names_any_registered_provider():+def test_ack_detector_transition_cue_names_only_acp_agents():+ """"Launching it on <X>" is a pending launch only for an ACP agent (an external_process profile: its+ name, alias or binary); "Launching it on Nous." names an inference provider and is a final answer."""from agent.agent_runtime_helpers import looks_like_codex_intermediate_ackagent = SimpleNamespace(_strip_think_blocks=lambda s: s)+ acp = ProviderProfile(name="acme-acp", aliases=("acme",), auth_type="external_process", process_command="acmecli")+ nous = ProviderProfile(name="nous", aliases=("nous-portal",), base_url="https://api.nous.test/v1")def ack(text):return looks_like_codex_intermediate_ack(agent, "go", text, [], require_workspace=False)- with patch("providers.list_providers", return_value=[ACME, PLAIN]):- assert ack("Launching it on acme-cloud via acpx.") is True+ with patch("providers.list_providers", return_value=[acp, nous, PLAIN]):+ assert ack("Launching it on acme-acp via acpx.") is Trueassert ack("Relaunching the session on acme.") is True+ assert ack("Launching it on acmecli via acpx.") is Trueassert ack("Starting the job on monday.") is False+ assert ack("Launching it on Nous.") is False+ assert ack("Relaunching the session on plain-key.") is Falsedef test_declared_message_carriers_are_unpriced():