AI support copilot Phase 1: AI triage + frontend code PRs#3577
Merged
Conversation
Integrates Cursor AI into the support bot, replacing deterministic-only triage and adding an autonomous frontend fix path. - AI triage via the Cursor headless CLI (agent -p --output-format json), with the existing keyword rules kept as automatic fallback (TriageProvider + CursorCliTriageProvider; TriageAgentService merges AI over heuristic). - New code_change action: a Cursor Cloud Agent implements a frontend fix on a branch and opens a PR into dev, threaded through the existing dry-run -> APPROVE -> execute -> completion-email pipeline. Nothing deploys automatically. - Gated dev -> live release PR (pr_only) via GitHub API; never auto-merges. - support:ai:setup-check, support:ai:poll-agents, support:ai:promote-dev-to-live commands; poll scheduled every minute when enabled. - config/support_ai.php + .env.example keys; migration adds cursor_agent_id, cursor_agent_status, cursor_pr_url, live_promotion_pr_url to support_cases. - Docs: docs/support-copilot-ai.md; unit tests for the Cloud Agents client. All gated behind SUPPORT_AI_ENABLED (default false); writes still require an emailed APPROVE while SUPPORT_GMAIL_DRY_RUN=true. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates Cursor AI into the support copilot (Phase 1). All gated behind
SUPPORT_AI_ENABLED(defaultfalse); writes still require an emailed APPROVE whileSUPPORT_GMAIL_DRY_RUN=true. Nothing deploys automatically.agent -p --output-format json), with the existing keyword rules kept as automatic fallback (TriageProvider+CursorCliTriageProvider;TriageAgentServicemerges AI over heuristic).code_changeaction: a Cursor Cloud Agent implements a frontend fix on a branch and opens a PR intodev, threaded through the existing dry-run → APPROVE → execute → completion-email pipeline.pr_only) via the GitHub API — opens/reuses a PR for a human to merge; never auto-merges.support:ai:setup-check,support:ai:poll-agents(scheduled every minute when enabled),support:ai:promote-dev-to-live.config/support_ai.php+.env.examplekeys; migration addscursor_agent_id,cursor_agent_status,cursor_pr_url,live_promotion_pr_urltosupport_cases.docs/support-copilot-ai.md.How it's wired
One
CURSOR_API_KEYpowers both the CLI (triage brain) and the Cloud Agents API (code PRs). Verified oncodeweek-prod-1: CLI returns valid triage JSON;composer-2.5confirmed in/v1/models.Test plan
php artisan migrateadds the foursupport_casescolumnsphp artisan support:ai:setup-checkpasses (key, CLI binary path, cloud model, columns, allowed actions)SUPPORT_AI_ENABLED=true,SUPPORT_AI_CODE_CHANGE_ENABLED=false: a ticket gets AI triage; falls back to keywords if AI disabled/failscode_changeticket sends a dry-run email showing the exact agent prompt + target branchdev;support:ai:poll-agentsreports the PR linkvendor/bin/phpunit tests/Unit/Support/CursorAgentServiceTest.phpgreenNotes
artisanchanges: allowlist-first, dry-run + APPROVE) will follow in a separate PR.Made with Cursor