Skip to content

fix(delegate): normalize ACP args before delegation#19472

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/delegate-acp-args-normalization
Open

fix(delegate): normalize ACP args before delegation#19472
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/delegate-acp-args-normalization

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • normalize ACP command args before they reach AIAgent, delegated child agents, or CopilotACPClient
  • handle non-iterable runtime objects such as SimpleNamespace without raising TypeError
  • add regressions for direct agent construction, delegate child construction, and ACP client initialization

Why

Fixes #19462. The failing path reports TypeError: types.SimpleNamespace object is not iterable before the ACP delegated task can complete. The fix keeps ACP arg handling list-shaped and drops invalid namespace/dict values instead of iterating them.

Test

  • scripts/run_tests.sh tests/run_agent/test_run_agent.py::test_aiagent_ignores_namespace_acp_args_alias tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_build_child_agent_drops_non_iterable_acp_args tests/agent/test_copilot_acp_client.py::CopilotACPClientSafetyTests::test_namespace_acp_args_do_not_crash_client_init

Note

  • Broader scripts/run_tests.sh tests/tools/test_delegate.py tests/agent/test_copilot_acp_client.py currently hits the existing heartbeat timing assertion TestDelegateHeartbeat::test_heartbeat_does_not_trip_idle_stale_while_inside_tool; the ACP regression tests above pass.

@alt-glitch alt-glitch added comp/acp Agent Communication Protocol adapter comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delegate_task(acp_command=...) fails with 'SimpleNamespace' object is not iterable

2 participants