Refactor: Move graph tasks to operations and add agent loading#593
Conversation
- Introduced new worker tasks for graph creation, materialization, and subgraph creation, enhancing the graph operations framework. - Implemented load_adapter_agents and load_adapter_tasks functions to facilitate future adapter integrations for agent and task registration. - Updated agent registry to support loading agents from adapters, establishing a foundation for extensibility in agent management.
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 1m 34s —— View job PR Review: Refactor - Move graph tasks to operations and add agent loading
SummaryThis is a well-motivated refactor that improves the architectural separation between Architecture AssessmentThe direction is correct. Relocating graph tasks from Issues1.
|
- Added clear_registry function to both agent and task registries to facilitate testing by resetting their states. - Introduced logging for task registration overrides to improve visibility and debugging during task management.
|
@claude have we fixed the issues |
|
Claude finished @jfrench9's task in 26s —— View job Yes, all three issues from the previous review have been fixed.
Status: All Issues Resolved ✓
The This PR is good to merge. |
- Replaced global variable tracking for loaded adapters with a function attribute to manage state more cleanly in both agent and task registries. - Updated clear_registry functions to reset the loading state, enhancing testability and maintainability of the registries.
Summary
Restructures the worker module by relocating graph operation tasks into a dedicated
operations/graph/taskspackage and introduces agent loading/registry functionality. This refactor establishes a clearer separation of concerns between the worker orchestration layer and the domain-specific operation definitions.Key Changes
Graph Task Relocation
graph_creation.py,graph_materialization.py, andsubgraph_creation.pyfromrobosystems/worker/tasks/torobosystems/operations/graph/tasks/__init__.pyforoperations/graph/tasksto properly export and organize the relocated task modulesrobosystems/worker/tasks/__init__.pyto re-export or reference tasks from their new locations, preserving backward compatibility at the worker levelAgent Registry & Loading
robosystems/operations/agents/__init__.pywith new exportsrobosystems/operations/agents/agent_registry.pywith agent loading functionality, enabling dynamic discovery and registration of agentsWorker Module Updates
robosystems/worker/__init__.pyto align with the new import structure and integrate agent loading capabilitiesMotivation
The previous structure co-located task definitions within the worker package, coupling domain logic (graph operations, agent management) with worker infrastructure. This refactor moves toward a cleaner architecture where:
operations/owns the definition of domain tasks and agent registrationsworker/focuses on task execution, orchestration, and Celery integrationBreaking Changes
robosystems.worker.tasks.graph_creation,graph_materialization, orsubgraph_creationmay need to update imports. However, re-exports inrobosystems/worker/tasks/__init__.pyshould maintain backward compatibility for consumers importing from the package level.Testing Notes
operationsandworkerInfrastructure Considerations
operations.graph.taskslocation🤖 Generated with Claude Code
Branch Info:
refactor/worker-operations-importsmainCo-Authored-By: Claude noreply@anthropic.com