[codex] Fix dispatch cluster issue filters and sync#449
Conversation
There was a problem hiding this comment.
AI Automated Review (incremental)
Incremental review: reviewed the changes since the last managed review; unresolved findings from that review are carried forward.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — routed smart (risk match: public_route_changes)
PR Review: PR 449 Fix dispatch cluster issue filters and sync
Summary
This PR fixes in-cluster Dispatch failures affecting Board refreshes, Automation sync status, and Renovate issue visibility. The primary focus is on fixing Prisma 7 incompatible queries and GitHub pagination issues, while also centralizing Renovate exclusion logic.
Recommended: Approve
The changes improve the codebase by fixing bugs and adding proper access controls.
Must-Check Verification
✅ verify route access controls are in place
/api/issues/untriaged route (src/app/api/issues/untriaged/route.ts):
- Added
authorizeRequestcheck that returns 401 if unauthorized - This is a security improvement — the route was previously intentionally unauthenticated (documented as "intake view for grooming") and is now properly protected
- The route test explicitly validates this:
it("returns 401 without authentication", ...)
/api/issues route (src/app/api/issues/route.ts):
- Already had
authorizeRequestcheck in place (existing code, unchanged) - Returns 401 if unauthorized
/api/agents/[agentName]/next-task route (src/app/api/agents/[agentName]/next-task/route.ts):
- Already had
authorizeRequestcheck in place (existing code, unchanged) - Returns 401 if unauthorized
✅ check for unintended public endpoints
No unintended public endpoints were introduced. The PR actually removes a public endpoint:
/api/issues/untriagedwas documented as intentionally unauthenticated and is now protected- The test comment explicitly notes the change:
"returns untriaged issues with authentication"(previously"returns untriaged issues without authentication")
All API routes in scope of this change require authentication via bearer token (DISPATCH_AGENT_TOKEN).
Standards Compliance
✅ Auth handling: All modified/new API routes use the shared authorizeRequest function from @/lib/auth
✅ Error responses: Routes return proper JSON error responses with 401 status codes
✅ Test coverage: Added auth test cases for the untriaged route
✅ Code patterns: Consistent with existing route patterns in the codebase
Linked Issue Fit
No linked issues were provided in the corpus. The PR body describes:
- Root cause analysis (Prisma 7 incompatible queries, GitHub pagination helper assumptions, Renovate filtering gaps)
- Changes include centralized Renovate exclusion, fixed pagination, and hardened auth
The auth addition to /api/issues/untriaged is an intentional security improvement, not an unintended breaking change.
Unknowns / Needs Verification
None — the delta diff and test files provide sufficient evidence for the auth changes.
Summary
Fixes the in-cluster Dispatch failures affecting Board refreshes, Automation sync status, mobile navigation into failing pages, and Renovate issue visibility.
Root Cause
labels: { hasNone: [...] }on scalar-list fields. WithDISPATCH_EXCLUDED_LABELS=renovate, every/api/issuesrefresh hit that invalid query shape.a.slice is not a functionbecause the shared GitHub pagination helper assumed every successful endpoint returned a JSON array. GitHub Actions run endpoints return wrapped objects like{ workflow_runs: [...] }.Changes
AND+NOT labels.hasSomeclauses.Validation
npm testnpm run typechecknpm run lint