Skip to content

Move StreamingProxy room lifecycle orchestration behind an application command surface #463

@louis4li

Description

@louis4li

Context

PR #452 refines GAgent registry command/query/admission semantics for issue #348. During review, StreamingProxy room creation still has host/endpoint code directly orchestrating business lifecycle work.

StreamingProxyEndpoints.HandleCreateRoomAsync currently performs the full lifecycle from the HTTP surface:

  • validate caller scope
  • create the room actor through IActorRuntime
  • send the initialization envelope
  • register scope ownership in the registry
  • perform rollback across registry and actor runtime

The new registry ownership canon says HTTP endpoints should validate caller scope and delegate to an application command surface. CLAUDE.md / AGENTS.md also state that API/Host should be composition-only and should not own core business orchestration.

Problem

The endpoint currently owns business lifecycle sequencing and depends directly on actor runtime details. That makes the host layer responsible for command-side lifecycle semantics and rollback ordering, rather than delegating to an application command contract.

Desired direction

Introduce a focused application command surface for StreamingProxy room lifecycle, for example a room creation/preparation command port/service that owns:

  • actor creation
  • room initialization command/envelope construction
  • registry registration and admission-visible receipt handling
  • rollback semantics

The HTTP endpoint should remain responsible for caller-scope validation, request/response mapping, and delegating to that command surface.

Acceptance criteria

  • StreamingProxy room create endpoint no longer directly calls IActorRuntime.CreateAsync or constructs initialization envelopes
  • room lifecycle sequencing lives behind an application-layer command/service abstraction
  • rollback semantics remain ownership-first: unregister registry membership before destroying actor when cleanup is needed
  • endpoint tests continue to cover HTTP behavior, while application tests cover lifecycle orchestration
  • behavior remains aligned with issue Refine GAgent actor registry into explicit command/query/ownership ports #348 registry command/query/admission consistency semantics

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions