Skip to content

Structure kernel create stage with event delivery guarantee #11651

@HyeockJinKim

Description

@HyeockJinKim

Refactor the create phase of create_kernel() into a dedicated Handler under agent/stage/kernel_lifecycle/docker/.

Scope:

  • Extract container creation logic (container prepared → container started → kernel object initialized) into a CreateStageHandler
  • Guarantee that KernelCreatingAnycastEvent is emitted at stage entry and that no silent failure path bypasses the event
  • On failure, emit an appropriate error event so the Manager is never left waiting
  • Target files: agent/stage/kernel_lifecycle/docker/bootstrap.py, kernel_object.py, agent/agent.py

Success Criteria:

  • Container creation logic runs through CreateStageHandler, not inline in create_kernel()
  • KernelCreatingAnycastEvent is always emitted at stage start
  • Failure path emits error event; no silent drop
  • Existing create_kernel() behavior unchanged end-to-end
  • pants test passes for affected packages

JIRA Issue: BA-6077

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Story.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions