a2a/errors: add tests for missing error code constants DUPLICATE_ENTITY, BUDGET_EXCEEDED, VERSION_MISMATCH and A2aVersionMismatchError mapping #10305

Open
opened 2026-04-18 08:28:02 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message: test(a2a/errors): add TDD tests for missing DUPLICATE_ENTITY, BUDGET_EXCEEDED, VERSION_MISMATCH constants and A2aVersionMismatchError mapping
  • Branch name: test/a2a-errors-missing-constants-tdd

Background and Context

The src/cleveragents/a2a/errors.py module documents three error codes in its taxonomy comments but does not define them as constants, and map_domain_error() does not handle A2aVersionMismatchError specifically.

The module comment (lines 43–47) documents:

#   -32005  Duplicate entity
#   -32006  Budget exceeded
#   -32007  Version mismatch

But only these constants are defined (lines 50–57):

NOT_FOUND: int = -32001
AUTH_ERROR: int = -32002
FORBIDDEN: int = -32003
INVALID_STATE: int = -32004
PLAN_ERROR: int = -32008
CONFIGURATION_ERROR: int = -32009
VALIDATION_ERROR: int = -32602
INTERNAL_ERROR: int = -32603

Constants DUPLICATE_ENTITY = -32005, BUDGET_EXCEEDED = -32006, and VERSION_MISMATCH = -32007 are absent. Additionally, A2aVersionMismatchError is defined in errors.py but map_domain_error() has no branch for it — it falls through to INTERNAL_ERROR (-32603) instead of the documented -32007.

Expected Behavior

  • errors.DUPLICATE_ENTITY is defined and equals -32005
  • errors.BUDGET_EXCEEDED is defined and equals -32006
  • errors.VERSION_MISMATCH is defined and equals -32007
  • map_domain_error(A2aVersionMismatchError(...)) returns a tuple with VERSION_MISMATCH (-32007), not INTERNAL_ERROR (-32603)
  • All three new constants are exported in __all__

Acceptance Criteria

  • errors.DUPLICATE_ENTITY == -32005 is verifiable via test
  • errors.BUDGET_EXCEEDED == -32006 is verifiable via test
  • errors.VERSION_MISMATCH == -32007 is verifiable via test
  • map_domain_error(A2aVersionMismatchError("v mismatch", "1.0", ["2.0"])) returns (VERSION_MISMATCH, ...) not INTERNAL_ERROR
  • All three new constants appear in __all__
  • Tests are tagged @tdd_issue, @tdd_issue_1, @tdd_expected_fail
  • Tests fail before the fix is applied and pass after

Subtasks

  • Write Behave/pytest scenario: DUPLICATE_ENTITY constant equals -32005
  • Write Behave/pytest scenario: BUDGET_EXCEEDED constant equals -32006
  • Write Behave/pytest scenario: VERSION_MISMATCH constant equals -32007
  • Write Behave/pytest scenario: map_domain_error(A2aVersionMismatchError(...)) returns VERSION_MISMATCH
  • Write Behave/pytest scenario: new constants appear in __all__

Definition of Done

  • All tests tagged @tdd_expected_fail fail before the fix
  • All tests pass after the fix is applied
  • nox -s unit_tests passes with coverage ≥ 97%

Automated by CleverAgents Bot
Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message**: `test(a2a/errors): add TDD tests for missing DUPLICATE_ENTITY, BUDGET_EXCEEDED, VERSION_MISMATCH constants and A2aVersionMismatchError mapping` - **Branch name**: `test/a2a-errors-missing-constants-tdd` ## Background and Context The `src/cleveragents/a2a/errors.py` module documents three error codes in its taxonomy comments but does not define them as constants, and `map_domain_error()` does not handle `A2aVersionMismatchError` specifically. The module comment (lines 43–47) documents: ``` # -32005 Duplicate entity # -32006 Budget exceeded # -32007 Version mismatch ``` But only these constants are defined (lines 50–57): ```python NOT_FOUND: int = -32001 AUTH_ERROR: int = -32002 FORBIDDEN: int = -32003 INVALID_STATE: int = -32004 PLAN_ERROR: int = -32008 CONFIGURATION_ERROR: int = -32009 VALIDATION_ERROR: int = -32602 INTERNAL_ERROR: int = -32603 ``` Constants `DUPLICATE_ENTITY = -32005`, `BUDGET_EXCEEDED = -32006`, and `VERSION_MISMATCH = -32007` are absent. Additionally, `A2aVersionMismatchError` is defined in `errors.py` but `map_domain_error()` has no branch for it — it falls through to `INTERNAL_ERROR` (-32603) instead of the documented `-32007`. ## Expected Behavior - `errors.DUPLICATE_ENTITY` is defined and equals `-32005` - `errors.BUDGET_EXCEEDED` is defined and equals `-32006` - `errors.VERSION_MISMATCH` is defined and equals `-32007` - `map_domain_error(A2aVersionMismatchError(...))` returns a tuple with `VERSION_MISMATCH` (-32007), not `INTERNAL_ERROR` (-32603) - All three new constants are exported in `__all__` ## Acceptance Criteria - [ ] `errors.DUPLICATE_ENTITY == -32005` is verifiable via test - [ ] `errors.BUDGET_EXCEEDED == -32006` is verifiable via test - [ ] `errors.VERSION_MISMATCH == -32007` is verifiable via test - [ ] `map_domain_error(A2aVersionMismatchError("v mismatch", "1.0", ["2.0"]))` returns `(VERSION_MISMATCH, ...)` not `INTERNAL_ERROR` - [ ] All three new constants appear in `__all__` - [ ] Tests are tagged `@tdd_issue`, `@tdd_issue_1`, `@tdd_expected_fail` - [ ] Tests fail before the fix is applied and pass after ## Subtasks - [ ] Write Behave/pytest scenario: `DUPLICATE_ENTITY` constant equals `-32005` - [ ] Write Behave/pytest scenario: `BUDGET_EXCEEDED` constant equals `-32006` - [ ] Write Behave/pytest scenario: `VERSION_MISMATCH` constant equals `-32007` - [ ] Write Behave/pytest scenario: `map_domain_error(A2aVersionMismatchError(...))` returns `VERSION_MISMATCH` - [ ] Write Behave/pytest scenario: new constants appear in `__all__` ## Definition of Done - [ ] All tests tagged `@tdd_expected_fail` fail before the fix - [ ] All tests pass after the fix is applied - [ ] `nox -s unit_tests` passes with coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

[GROOMED] ✓ Issue #10305 Quality Analysis Complete

Analysis Summary

Issue Validity: ✓ VALID
This is a well-defined, actionable testing task with clear acceptance criteria and subtasks.

Current Labels: ✓ CORRECT

  • State/Unverified ✓ (appropriate for new issues)
  • Type/Testing ✓ (correct - adding tests for missing error constants)
  • Priority/High ✓ (reasonable priority for a2a/errors module testing)

Issue Details:

  • Title: a2a/errors: add tests for missing error code constants DUPLICATE_ENTITY, BUDGET_EXCEEDED, VERSION_MISMATCH and A2aVersionMismatchError mapping
  • Status: Open
  • Assignee: Unassigned
  • Milestone: None assigned

Findings

✓ All required labels are present and correct
✓ Issue has clear acceptance criteria (5 items)
✓ Issue has well-defined subtasks (5 items)
✓ Definition of Done is explicit
✓ No [GROOMED] marker found - first grooming
✓ Issue is ready for implementation

Recommendations

  1. Milestone Assignment (Optional): Consider assigning to v3.6.0 (M6: Advanced Concepts & Deferred Features) since it mentions "ACP to A2A module rename and symbol standardization"
  2. Epic Assignment: Verify if this belongs to an Epic for a2a module work
  3. Ready for Work: Issue is properly triaged and ready for assignment to a developer

Automated by CleverAgents Bot
Supervisor: Grooming | Agent: grooming-pool-supervisor

[GROOMED] ✓ Issue #10305 Quality Analysis Complete ## Analysis Summary **Issue Validity**: ✓ VALID This is a well-defined, actionable testing task with clear acceptance criteria and subtasks. **Current Labels**: ✓ CORRECT - State/Unverified ✓ (appropriate for new issues) - Type/Testing ✓ (correct - adding tests for missing error constants) - Priority/High ✓ (reasonable priority for a2a/errors module testing) **Issue Details**: - **Title**: a2a/errors: add tests for missing error code constants DUPLICATE_ENTITY, BUDGET_EXCEEDED, VERSION_MISMATCH and A2aVersionMismatchError mapping - **Status**: Open - **Assignee**: Unassigned - **Milestone**: None assigned ## Findings ✓ All required labels are present and correct ✓ Issue has clear acceptance criteria (5 items) ✓ Issue has well-defined subtasks (5 items) ✓ Definition of Done is explicit ✓ No [GROOMED] marker found - first grooming ✓ Issue is ready for implementation ## Recommendations 1. **Milestone Assignment** (Optional): Consider assigning to v3.6.0 (M6: Advanced Concepts & Deferred Features) since it mentions "ACP to A2A module rename and symbol standardization" 2. **Epic Assignment**: Verify if this belongs to an Epic for a2a module work 3. **Ready for Work**: Issue is properly triaged and ready for assignment to a developer --- **Automated by CleverAgents Bot** Supervisor: Grooming | Agent: grooming-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10305
No description provided.