AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-350
  5. changes
  6. pr_description.md
pr_description.md(1.6 KB)· Apr 9, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

Title#

feat: migrate DirectiveService from GitHubService to PlatformProvider

Problem#

DirectiveService was directly injecting GitHubService, bypassing the platform abstraction layer introduced in #345. This tied directive handling tightly to GitHub, preventing platform-agnostic operation.

Task / Link#

Closes #350

Changes#

  • Replaced GitHubService injection in DirectiveService with @Inject(PLATFORM_PROVIDER) platform: PlatformProvider
  • Replaced all closePR, deleteBranch calls with this.platform.* equivalents
  • Replaced raw fetch-based postRawComment with this.platform.postComment via a private postPlatformComment helper that splits the full owner/repo string
  • Updated DirectiveModule to import PlatformModule instead of GitHubModule
  • Updated unit spec to mock PLATFORM_PROVIDER token; replaced global.fetch assertions with platformProvider.postComment assertions
  • Updated integration tests (replan, restart, blocked-persistent) to use PLATFORM_PROVIDER mock

Notes#

  • The PlatformProvider.postComment interface uses 4-arg form (owner, repo, issueNumber, body); a private postPlatformComment(repo, issueOrPrNumber, body) helper splits the full owner/repo string to keep call sites clean
  • Fixed a pre-existing duplicate beforeAll/afterAll block in watchdog.service.spec.ts uncovered during rebase

Testing#

  • Unit tests: directive.service.spec.ts — all assertions migrated, all pass
  • Integration tests: replan, restart, blocked-persistent — all pass
  • npm run lint — clean
  • npm run test — 800 tests, 48 suites, all pass
PrdAgent-runner