Agent Kernel Lifecycle Structuring
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Structure Agent kernel lifecycle (create/prepare/terminate) into state-machine-based handlers, mirroring the sokovan Coordinator pattern, and guarantee event delivery to the Manager at each stage transition.
Background: create_kernel() is a single monolithic function handling image pull → resource allocation → container creation → kernel init in hundreds of lines. Files under agent/stage/kernel_lifecycle/docker/ exist per stage but are not wired into a state machine. Task tracking is minimal (CreateTaskInfo holds only kernel_id and session_id). Agent CLAUDE.md states container state transitions MUST go through agent/stage/, but this is currently unimplemented.
JIRA Issue: BA-6074
Contributor guide
Research direction
Start at create_kernel() and inspect the per-stage files under agent/stage/kernel_lifecycle/docker/. Read the sokovan Coordinator pattern and agent/CLAUDE.md, then trace CreateTaskInfo and current Manager event handling. Done means create, prepare, and terminate use state-machine handlers and the Manager receives an event at each stage transition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend, distributed-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100