Part of #1507 and master #1505
Parent
Dependencies
Summary
Replace remaining service-bag and factory construction inputs with the one host broker.
Current Limitation / Root Cause
Root/resumed/subagent sessions and repository, usage, MCP, Dev Tunnel, and VS Code composition can receive different acquisition dependencies.
Affected Files
| Path |
Change |
Phantom.Workspaces/Services/AgentServicesComposition.cs |
Implement the bounded production change owned by this issue. |
Phantom.Workspaces/Services/Access/AccessBrokerProvider.cs |
Implement the bounded production change owned by this issue. |
Phantom.Workspaces/ViewModels/MainWindowViewModel.cs |
Implement the bounded production change owned by this issue. |
| Focused test file |
Add only the tests listed below. |
Design / Fix
This slice implements the following exact contract:
public sealed record HostAgentServicesOptions
{
public required IAccessBroker AccessBroker { get; init; }
}
All launch and connection paths receive the exact same broker reference. No provider is constructed in a leaf composition site.
Use required-init properties and named object initializers. The commit must build and its focused tests must pass without relying on a second implementation slice landing in the same commit.
Security and Privacy Invariants
- Release/use authorization occurs before material access or provider interaction whenever this slice can reach either boundary.
- No token, secret value, OAuth state, verifier, authorization URL, signed URL, device code, callback, account name, unsafe identifier, or credential-bearing result enters UI-safe state, logs, notifications, entities, or persistence.
- Typed results remain caller-owned and disposable; provider/cache artifacts remain executor-owned.
- Errors are typed and sanitized; no broad catch or success-shaped fallback is introduced.
Exclusions
- No batch API, compatibility bridge, legacy-data migration, silent interactive renewal, or unrelated provider work.
- No production types beyond the bounded files/classes named here.
- No UI work unless this issue is explicitly a UI slice.
Commit Plan
Commit 1 — [access-host-threading] - Thread one broker through all production composition paths
Production scope: Phantom.Workspaces/Services/AgentServicesComposition.cs, Phantom.Workspaces/Services/Access/AccessBrokerProvider.cs, Phantom.Workspaces/ViewModels/MainWindowViewModel.cs.
Tests: AgentServicesCompositionTests methods listed below.
Acceptance: one small coherent commit; no opportunistic adjacent migration.
Expected Tests
| Test Name |
Class |
What It Verifies |
AgentServicesComposition_RootResumedAndSubagent_ReuseExactBroker |
AgentServicesCompositionTests |
Verifies the named contract and leaves adjacent slices independently testable. |
AccessBrokerProvider_RepositoryUsageMcpAndDevTunnel_ReturnExactHostBroker |
AgentServicesCompositionTests |
Verifies the named contract and leaves adjacent slices independently testable. |
MainWindowViewModel_VsCodeTool_UsesHostBroker |
AgentServicesCompositionTests |
Verifies the named contract and leaves adjacent slices independently testable. |
Part of #1507 and master #1505
Parent
Dependencies
Summary
Replace remaining service-bag and factory construction inputs with the one host broker.
Current Limitation / Root Cause
Root/resumed/subagent sessions and repository, usage, MCP, Dev Tunnel, and VS Code composition can receive different acquisition dependencies.
Affected Files
Phantom.Workspaces/Services/AgentServicesComposition.csPhantom.Workspaces/Services/Access/AccessBrokerProvider.csPhantom.Workspaces/ViewModels/MainWindowViewModel.csDesign / Fix
This slice implements the following exact contract:
All launch and connection paths receive the exact same broker reference. No provider is constructed in a leaf composition site.
Use required-init properties and named object initializers. The commit must build and its focused tests must pass without relying on a second implementation slice landing in the same commit.
Security and Privacy Invariants
Exclusions
Commit Plan
Commit 1 — [access-host-threading] - Thread one broker through all production composition paths
Production scope:
Phantom.Workspaces/Services/AgentServicesComposition.cs,Phantom.Workspaces/Services/Access/AccessBrokerProvider.cs,Phantom.Workspaces/ViewModels/MainWindowViewModel.cs.Tests:
AgentServicesCompositionTestsmethods listed below.Acceptance: one small coherent commit; no opportunistic adjacent migration.
Expected Tests
AgentServicesComposition_RootResumedAndSubagent_ReuseExactBrokerAgentServicesCompositionTestsAccessBrokerProvider_RepositoryUsageMcpAndDevTunnel_ReturnExactHostBrokerAgentServicesCompositionTestsMainWindowViewModel_VsCodeTool_UsesHostBrokerAgentServicesCompositionTests