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

feat(#229): add configurable EXCLUDED_REPOS server-side filtering to CC APIs#

Problem#

CC API endpoints (tasks, events, jobs, metrics) had no server-side repo filtering. MetricsService had a hardcoded exclusion constant; other endpoints had none at all, leaking agent-core-e2e data to the frontend.

Task / Link#

GitHub Issue #229 — https://github.com/AgentSDE/agent-core/issues/229

Changes#

  • Added EXCLUDED_REPOS env var to Joi config schema (default: AgentSDE/agent-core-e2e)
  • Created ExcludedReposService in src/config/ — parses CSV, exposes getList() and isExcluded(); exported from AppConfigModule
  • TasksController: listTasks() and bulkAction() apply NOT IN filter; getTask() returns 404 for excluded repos
  • EventsController: listEvents() joins to tasks and applies NOT IN filter on task.repo
  • JobsController: listJobs() applies NOT IN filter; getJob() returns 404 for excluded repos
  • MetricsService: replaced hardcoded EXCLUDED_REPOS constant with injected ExcludedReposService; all raw SQL queries now use parameterized placeholders

Notes#

  • listEvents() gains an INNER JOIN to tasks (via the existing event.task relation) to access repo — taskId FK is indexed so impact is minimal
  • Empty EXCLUDED_REPOS value disables all filtering (the NOT IN clause is omitted)

Testing#

  • New unit tests: excluded-repos.service.spec.ts (CSV parsing, isExcluded edge cases), tasks.controller.spec.ts (list filtering, 404 guard)
  • Updated metrics.service.spec.ts to provide ExcludedReposService mock
  • npm run lint passes (0 errors), npm run test passes (645 tests)
PrdAgent-runner