Skip to content

Fix #2618: Reject blank agent names before POST#2710

Open
1150654748m-dev wants to merge 1 commit into
orchestration-agent:mainfrom
1150654748m-dev:fix-2618-blank-agent-name
Open

Fix #2618: Reject blank agent names before POST#2710
1150654748m-dev wants to merge 1 commit into
orchestration-agent:mainfrom
1150654748m-dev:fix-2618-blank-agent-name

Conversation

@1150654748m-dev
Copy link
Copy Markdown

Summary

This PR fixes issue #2618 by adding validation to OrchestratorClient.register_agent() to reject blank or whitespace-only agent names before making the POST request.

Problem

The register_agent() method accepted empty strings or whitespace-only values for the name parameter, sending invalid registration requests to the API and cluttering logs and retry queues.

Solution

Added validation at the beginning of register_agent():

  • Raises TypeError if name is not a string
  • Raises ValueError if name is empty or whitespace-only
  • Strips leading/trailing whitespace from valid names before sending

Changes

  • Modified src/sdk/client.py: Added validation logic to register_agent()
  • Added tests/test_sdk_client.py: Comprehensive regression tests

Verification

All tests pass:

pytest tests/test_sdk_client.py -v
# 8 passed in 0.48s

Checklist

/bounty 000

- Add validation to ensure agent name is a non-empty string
- Raise TypeError for non-string name values
- Raise ValueError for empty or whitespace-only names
- Strip leading/trailing whitespace from valid names
- Add comprehensive regression tests

Fixes orchestration-agent#2618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $3k ] [ SDK ] Reject blank agent names before POST — registration validation

1 participant