-
Notifications
You must be signed in to change notification settings - Fork 0
Description
📝 Description
Integrate the SignalController into the agent worker system to allow dynamic allocation, dispatch binding, and reserve-mode reuse of workers.
This integration is critical to unlock flexible lifecycle control, especially for agents involved in medium-duration or long-running work. It will allow agent threads to be managed, recycled, and signal-bound within orchestrated task groups.
🧠 Goals
- Workers must register themselves with the SignalController on deployment.
- SignalController should support dispatch tagging:
active_dispatch: Worker is actively participating.reserved_dispatch: Worker is on standby and available for reuse.
- Enable reuse logic for workers to avoid teardown/rebuild costs for long tasks.
- Allow for event-driven handoff between worker roles using signals such as
on_task_complete,on_waiting_period, oron_resource_ready.
📐 Key Design Constraints
- Must not violate current HelpRequest lifecycle guarantees.
- Must maintain full thread safety.
- Must ensure no memory leaks or ghosted thread handles after deallocation.
- Should integrate with current CommandGroup and AgentContainer structure cleanly.
🔧 Suggested Interfaces
Example: Worker auto-registering with SignalController
self._signal_controller.register_agent(
factory_id=self.factory_id,
role="reserved_dispatch",
on_signal=self._reactivate
)
In SignalController:
def tag_dispatch(factory_id: str, role: str): ...
def broadcast_to_role(role: str, signal: str): ...
✅ Acceptance Criteria
- Workers register themselves with the SignalController.
- Workers can be placed into a
reserved_dispatchrole. - Workers can be reactivated via signal broadcast (e.g., "reactivate_reserved").
- Reused workers do not trigger thread safety or double-registration warnings.
- Unit tests verify role switching, registration, and signal-based lifecycle management.
📎 Related
- #12: Add SignalController hooks to CommandCenter
- 🧠 Feature Request: Examples and Difficulty Scaling in Descriptions #4: Implement Agent Reuse Strategy
- Implement SignalGate and GateController primitives for centralized multi-signal synchronization threadfactory#9: Thread Safety Enforcement in Worker Pool
💬 Comments
“We need a way to allow for reuse of workers in conditions of medium or long work. These conditions are important to allow flexibility and inter-connectivity between workers.”
— @Synaptic724