Skip to content

Refactor streaming proxy room command - #505

Merged
louis4li merged 2 commits into
devfrom
refactor/2026-04-29_streaming-proxy-room-command
Apr 29, 2026
Merged

louis4li merged 2 commits into
devfrom
refactor/2026-04-29_streaming-proxy-room-command

Conversation

@louis4li

@louis4li louis4li commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Issue #463 calls out that the streaming proxy room creation endpoint was carrying core lifecycle orchestration directly in the host/API surface. That made the endpoint responsible for actor creation, initialization, registry admission, and rollback.

Solution

  • Add a typed application command surface for streaming proxy room creation.
  • Move actor creation, initialization envelope construction, registry admission, and rollback into StreamingProxyRoomCommandService.
  • Keep the endpoint focused on scope access checks and HTTP result mapping.
  • Register the command service through DI.
  • Update endpoint coverage tests to verify delegation and result mapping.
  • Add command service tests for success ordering, admission rollback, failure rollback, cancellation rollback, blank scope validation, and envelope target routing.

Impact

This keeps the host/API layer as composition and protocol mapping only, while the application layer owns the command lifecycle. Rollback now validates ownership first by unregistering registry ownership before destroying the actor.

Validation

  • dotnet test test/Aevatar.AI.Tests/Aevatar.AI.Tests.csproj --no-restore --filter "FullyQualifiedName~StreamingProxyRoomCommandServiceTests|FullyQualifiedName~StreamingProxyEndpointsCoverageTests|FullyQualifiedName~StreamingProxyCoverageTests" --nologo passed: 45/45.
  • dotnet build agents/Aevatar.GAgents.StreamingProxy/Aevatar.GAgents.StreamingProxy.csproj --no-restore --nologo passed with NuGet warnings only.
  • bash tools/ci/test_stability_guards.sh passed.
  • git diff --check passed.
  • Manual smoke with src/Aevatar.Mainnet.Host.Api in Development/InMemory/no-auth mode passed:
    • POST /api/scopes/smoke-scope/streaming-proxy/rooms returned 200 OK with roomId=streaming-proxy-8303b49646664caebadc98fe04c51238 and roomName=Review Smoke Room.
    • GET /api/scopes/smoke-scope/streaming-proxy/rooms returned 200 OK, stateVersion=1, and the created room in rooms.
  • bash tools/ci/architecture_guards.sh passed the C# architecture guards, then failed in the unrelated CLI playground asset build because @tanstack/react-virtual could not be resolved from tools/Aevatar.Tools.Cli/Frontend/src/runtime/ScopePage.tsx.

Review

Ran the superpowers:requesting-code-review flow. The reviewer found no critical issues and raised one P2 risk around blank ScopeId validation happening after actor creation. This PR includes the fix and a regression test that rejects blank scope before any actor side effect.

@louis4li
louis4li marked this pull request as ready for review April 29, 2026 03:31
@codecov

codecov Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.61%. Comparing base (d19862b) to head (7f34880).
⚠️ Report is 3 commits behind head on dev.

@@            Coverage Diff             @@
##              dev     #505      +/-   ##
==========================================
- Coverage   71.62%   71.61%   -0.01%     
==========================================
  Files        1236     1236              
  Lines       89573    89573              
  Branches    11713    11713              
==========================================
- Hits        64156    64152       -4     
- Misses      20819    20821       +2     
- Partials     4598     4600       +2     
Flag Coverage Δ
ci 71.61% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@louis4li
louis4li merged commit f792aa1 into dev Apr 29, 2026
13 checks passed
@loning
loning deleted the refactor/2026-04-29_streaming-proxy-room-command branch June 2, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant