Skip to content

fix: Antigravity and Cursor agent chat integration and skill sync#1

Open
ravikiranp123 wants to merge 2 commits into
NikkyAmresh:mainfrom
ravikiranp123:fix/agent-chat-integration
Open

fix: Antigravity and Cursor agent chat integration and skill sync#1
ravikiranp123 wants to merge 2 commits into
NikkyAmresh:mainfrom
ravikiranp123:fix/agent-chat-integration

Conversation

@ravikiranp123

@ravikiranp123 ravikiranp123 commented Jul 7, 2026

Copy link
Copy Markdown

Description

This PR addresses several integration issues across different IDE environments (Antigravity, Cursor, and VS Code) to ensure AI agent chat features and custom agent skills trigger and sync correctly. It also improves compatibility with official LeetCode submission extensions.

Changes Made

  • Cross-IDE Chat Integration (src/extension.ts):
    • Refactored openChatWithPrompt to reliably trigger the chat panel across environments.
    • Fixed an issue in Antigravity where the chat wouldn't open by routing it through the native antigravity.sendPromptToAgentPanel command.
    • Improved clipboard paste fallbacks for environments where direct query passing isn't supported.
  • AI Agent Skill Syncing (CursorLcexPluginInstall.ts):
    • Expanded the agent rule installer to automatically sync customized LeetCode skills across IDE formats:
      • Antigravity: .agents/skills/
      • VS Code Copilot: .github/copilot-instructions.md
      • Cursor: .cursor/rules/
  • Native Submission Compatibility (TemplateEngine.ts):
    • Added standard @lc app=leetcode, @lc code=start, and @lc code=end metadata comments to the generated solution templates. This allows the official LeetCode VS Code extension (or browser extensions) to recognize the file for submission.
  • Documentation (README.md):
    • Added a "Known Limitations" note detailing that Cloudflare 403s block automated remote submissions and officially recommending the use of native LeetCode extensions for final submissions.
      Additional Feature: Fallback Editor Matching for Code Execution
  • Enhanced executeCode() (in ProblemView.ts) to gracefully fall back if the currently active tab isn't a supported language file (e.g., if you are currently reading the problem description Markdown file).
  • It now scans through other visible editor tabs to find a solution file matching the problem slug. This allows you to click the "Run" or "Submit" buttons from the problem view without needing to manually focus your code tab first.

@NikkyAmresh

Copy link
Copy Markdown
Owner

Thanks for this one, the chat integration restructure, the @lc template markers, and the README note are all solid, and the branch builds cleanly. There is one blocking issue and two risky behaviors I would like addressed before merge.

Blocking

  1. The skill sync silently overwrites files in the user's project. ensureCursorLcexPluginInstalled() now writes .agents/skills/* and .github/copilot-instructions.md into the workspace root on every activation. writeIfDifferent overwrites when content differs, and copilot-instructions.md is a file many real projects already have, so anyone opening a .leetcode workspace that also uses Copilot gets their instructions clobbered with no prompt and no opt-out. It also only handles workspaceFolders[0] and does not verify that folder contains the .leetcode marker. Please gate the workspace-level sync behind a config flag (default off), never replace a pre-existing file the extension did not create (append a clearly marked section, or skip with a warning), and target the folder that actually has the marker.

Risky

  1. The executeCode fallback can run or submit the wrong file. The slug-match stage in ProblemView.ts is a good idea, but the second stage falls back to any visible editor with a supported extension. Clicking Run on problem X while a solution for problem Y is visible would silently execute Y's code against X. Please keep the slug match and drop the any-editor fallback.

  2. Chat command ordering may regress Cursor. workbench.action.chat.open is now tried before aichat.newchat and cursor.chat.new. If Cursor registers that command, it will "succeed" and be treated as auto-submitted, so the Cursor-native path is never reached. Please confirm the Ask Agent flow still works in Cursor with this ordering, or keep the Cursor commands first.

Minor

  • The committed .agents/skills/* and .github/copilot-instructions.md files are generated artifacts of the sync code and will drift from the constants in CursorLcexPluginInstall.ts; I would gitignore them instead of committing them.
  • submitted in openChatWithPrompt is assigned but never read.
  • activate() gained stray blank lines and a debug log that should be tidied.

Happy to merge once the blocking item is resolved and the Cursor flow is confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants