Skip to content

test: 2 delegate tests fail because 'Agent' alias is recorded as action instead of canonical 'delegate_agent' #33

@manolitnora

Description

@manolitnora

Repro

```
git checkout main
pytest tests/test_agent_runtime.py::AgentRuntimeTests::test_agent_can_delegate_to_nested_agent
pytest tests/test_agent_runtime.py::AgentRuntimeTests::test_agent_can_delegate_with_topological_batches
```

Both fail on origin/main alone (no local changes).

Symptom

```
AssertionError: 'Agent' != 'delegate_agent'

  • Agent
  • delegate_agent
    ```

Root cause

Origin/main introduced `'Agent'` as an alias for `'delegate_agent'` in the tool dispatch path (`src/agent_runtime.py` around line 1258 in current main: `if tool_call.name in ('Agent', 'delegate_agent')`). When the alias `'Agent'` is the actual tool name used by the model, the action recorded in metadata / file_history is `'Agent'`, but the tests assert the canonical `'delegate_agent'`.

Two fixes possible

  1. Test-side: update `test_agent_can_delegate_to_nested_agent` and `test_agent_can_delegate_with_topological_batches` to accept either alias (`metadata.get('action') in ('Agent', 'delegate_agent')`).
  2. Source-side: normalize the recorded action to the canonical form (`'delegate_agent'`) regardless of which alias the model used. Probably the right call since the alias is a model-facing convenience, not a runtime-state distinction.

Why I'm filing

Hit this while verifying merge-conflict resolutions on a feature branch (PR #32). Failures reproduce on pure origin/main with no local changes, so they're not from my work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions