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

Fix /agent refine no-op for non-gated tasks#

Problem#

/agent refine was falling through to the generic directive handler, which dispatched an event and posted a misleading confirmation comment even when the task was not in a gated state (where refine has no effect).

Task / Link#

Closes #233

Changes#

  • Added refine pre-validation block in DirectiveService.applyDirective() before the generic handler
  • Terminal tasks (succeeded/failed): post rejection comment, no dispatch/enqueue
  • Non-gated tasks: post rejection comment with current status, no dispatch/enqueue
  • Gated tasks only: clear gate, save, enqueue refine phase, post confirmation
  • Replaced single refine test with describe('refine directive') block covering 5 scenarios

Notes#

  • task.directive is not overwritten — preserves auto/careful/quick through the refine flow
  • clearGate is called before enqueuePhase, matching the existing retry/restart pattern

Testing#

  • Unit tests: new describe('refine directive') block with 5 tests (gated ✓, active ✗, succeeded ✗, failed ✗, directive-preserved ✓)
  • Full suite: 665 tests pass
  • Lint: zero errors in changed files
  • Build: compiles cleanly
PrdAgent-runner