AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-382
  5. plan
  6. plan.md
plan.md(2.9 KB)· Apr 12, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

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#

FileActionDescription
src/platform/github-platform.provider.tscreateReal GitHubPlatformProvider that delegates to GitHubService
src/platform/platform.module.tsmodifyRegister GitHubPlatformProvider with useClass instead of no-op default
src/phase-router/phase-router.service.tsmodifyApply mode directive changes (auto/quick/careful) in webhook path
src/webhook/webhook.controller.tsmodifyChange getOrThrow to get for GITHUB_WEBHOOK_SECRET, skip verification when unset
src/tenant/tenant.constants.tsmodifyRemove duplicate PLATFORM_PROVIDER, re-export from platform-provider.interface
src/tenant/tenant.module.tsmodifyRemove local PLATFORM_PROVIDER provision, import PlatformModule
src/platform/github-platform.provider.spec.tscreateUnit tests for GitHubPlatformProvider
src/phase-router/phase-router.service.spec.tsmodifyAdd test for mode directive handling in webhook path
src/directive/directive.service.spec.tsmodifyUpdate mock to verify real platform provider calls

Steps#

  1. Create GitHubPlatformProvider implementing PlatformProvider by delegating postComment, closePR, deleteBranch to GitHubService.
  2. Wire GitHubPlatformProvider in PlatformModule using useClass; remove no-op default. Import GitHubModule in PlatformModule.
  3. Add mode directive handling in PhaseRouterService.route() step 2d — for auto/quick/careful, set task.directive and save before gate clearing.
  4. Change GITHUB_WEBHOOK_SECRET from getOrThrow to get in webhook.controller.ts; skip signature verification when secret is empty/undefined.
  5. Remove duplicate PLATFORM_PROVIDER from tenant.constants.ts; update tenant.module.ts to import from platform-provider.interface.ts and remove local provider.
  6. Add unit tests for GitHubPlatformProvider, mode directive handling, and webhook secret skip logic.

Verification#

  • npm run test — all existing + new unit tests pass
  • npm run lint — zero warnings
  • npm 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 auto via webhook now properly switches the task to auto mode, which changes downstream gating behavior.
ContextPrd