Plan: Fix E2E failures after multi-tenant RC release#
Summary#
The multi-tenant RC merged several PRs (MT-1 through MT-12) that introduced regressions: DirectiveService's PlatformProvider is wired to a no-op default, PhaseRouterService doesn't apply mode directive changes via the webhook path, the webhook secret uses getOrThrow breaking E2E environments, and duplicate DI tokens create confusion.
Files#
| File | Action | Description |
|---|---|---|
src/platform/github-platform.provider.ts | create | Real GitHubPlatformProvider that delegates to GitHubService |
src/platform/platform.module.ts | modify | Register GitHubPlatformProvider with useClass instead of no-op default |
src/phase-router/phase-router.service.ts | modify | Apply mode directive changes (auto/quick/careful) in webhook path |
src/webhook/webhook.controller.ts | modify | Change getOrThrow to get for GITHUB_WEBHOOK_SECRET, skip verification when unset |
src/tenant/tenant.constants.ts | modify | Remove duplicate PLATFORM_PROVIDER, re-export from platform-provider.interface |
src/tenant/tenant.module.ts | modify | Remove local PLATFORM_PROVIDER provision, import PlatformModule |
src/platform/github-platform.provider.spec.ts | create | Unit tests for GitHubPlatformProvider |
src/phase-router/phase-router.service.spec.ts | modify | Add test for mode directive handling in webhook path |
src/directive/directive.service.spec.ts | modify | Update mock to verify real platform provider calls |
Steps#
- Create
GitHubPlatformProviderimplementingPlatformProviderby delegatingpostComment,closePR,deleteBranchtoGitHubService. - Wire
GitHubPlatformProviderinPlatformModuleusinguseClass; remove no-op default. ImportGitHubModuleinPlatformModule. - Add mode directive handling in
PhaseRouterService.route()step 2d — forauto/quick/careful, settask.directiveand save before gate clearing. - Change
GITHUB_WEBHOOK_SECRETfromgetOrThrowtogetinwebhook.controller.ts; skip signature verification when secret is empty/undefined. - Remove duplicate
PLATFORM_PROVIDERfromtenant.constants.ts; updatetenant.module.tsto import fromplatform-provider.interface.tsand remove local provider. - Add unit tests for
GitHubPlatformProvider, mode directive handling, and webhook secret skip logic.
Verification#
npm run test— all existing + new unit tests passnpm run lint— zero warningsnpm run build— compiles cleanly
Risks#
- Replacing the no-op PlatformProvider with a real one means DirectiveService now makes live GitHub API calls — ensure all spec mocks are updated to prevent real API calls in tests.
- PhaseRouterService directive change is a behavior change:
/agent autovia webhook now properly switches the task to auto mode, which changes downstream gating behavior.