refactor: extract _do_register_agent to eliminate register agent logic redundancy by cf3901646 · Pull Request #19 · smithd36/biomata-engine · GitHub
Skip to content

refactor: extract _do_register_agent to eliminate register agent logic redundancy - #19

Merged
smithd36 merged 1 commit into
smithd36:mainfrom
cf3901646:fix/duplicate-register-agent-handler
Jun 2, 2026
Merged

smithd36 merged 1 commit into
smithd36:mainfrom
cf3901646:fix/duplicate-register-agent-handler

Conversation

@cf3901646

Copy link
Copy Markdown
Contributor

Closes #7. Extracted the shared core agent registration logic into a helper method _do_register_agent. This eliminates the duplicate code between _handle_register_agent (v1) and _handle_agent_register (v2) while preserving backwards compatibility.

@smithd36 smithd36 left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor. This addresses a significant part of the issue, and _do_register_agent() is a solid extraction.

That said, some duplication still remains since only _handle_register_agent() was updated to use the new helper. _handle_agent_register() continues to implement its own reconnect, validation, registration, and error-handling flow. I view this as more of a broader architectural concern around supporting parallel v1/v2 registration APIs than something that necessarily needs to be fully solved in this PR.

Thanks for the contribution and the help, @cf3901646! Much appreciated.

@smithd36
smithd36 merged commit bd1e19f into smithd36:main Jun 2, 2026
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.

[MEDIUM] Duplicate register_agent / agent.register Handler Logic

2 participants