name: Bug Report
description: Report a bug or issue with the plugin
labels: ["bug", "needs-triage"]
body:
  - type: markdown
    attributes:
      value: |
        ## Before opening an issue

        > ⚠️ **PLEASE READ THE TROUBLESHOOTING GUIDE FIRST**
        > 
        > Most issues (rate limits, hanging prompts, auth errors) are covered in our troubleshooting guide.
        > **Your issue may already have a solution!**

        **Please write a descriptive title above** (e.g., "Auth fails with invalid_grant after token refresh")

        > 🌐 **ENGLISH ONLY**
        > 
        > Issues must be written in English. Issues in other languages will be closed immediately.

        Check the following resources first:
        - **[📋 Troubleshooting Guide](https://github.com/NoeFabris/opencode-antigravity-auth/blob/main/docs/TROUBLESHOOTING.md)** - common issues and solutions
        - [Existing issues](https://github.com/NoeFabris/opencode-antigravity-auth/issues?q=is%3Aissue) - your issue may already be reported

        **Issues without debug logs will be closed.**

  - type: checkboxes
    id: prerequisites
    attributes:
      label: Pre-submission checklist
      options:
        - label: I have searched existing issues for duplicates
          required: true
        - label: I have read the [📋 Troubleshooting Guide](https://github.com/NoeFabris/opencode-antigravity-auth/blob/main/docs/TROUBLESHOOTING.md)
          required: true
        - label: I have read the [README](https://github.com/NoeFabris/opencode-antigravity-auth#readme) installation instructions

  - type: dropdown
    id: model
    attributes:
      label: Model used
      description: Which model were you using when the issue occurred?
      options:
        - antigravity-gemini-3-pro
        - antigravity-gemini-3-flash
        - antigravity-claude-sonnet-4-6
        - antigravity-claude-opus-4-6-thinking
        - gemini-2.5-flash
        - gemini-2.5-pro
        - gemini-3-flash-preview
        - gemini-3-pro-preview
        - Other (specify in description)
        - Not applicable
    validations:
      required: true

  - type: textarea
    id: error-message
    attributes:
      label: Exact error message
      description: Copy-paste the exact error message. Do not paraphrase.
      placeholder: |
        Paste the exact error message here.
        Include any error codes or stack traces if available.
      render: text
    validations:
      required: true

  - type: textarea
    id: description
    attributes:
      label: Bug description
      description: A clear and concise description of what the bug is.
      placeholder: Describe the bug...
    validations:
      required: true

  - type: textarea
    id: steps
    attributes:
      label: Steps to reproduce
      description: How can we reproduce this issue?
      placeholder: |
        1. Run command...
        2. Click on...
        3. See error...
    validations:
      required: true

  - type: dropdown
    id: worked-before
    attributes:
      label: Did this ever work?
      description: Has this feature worked for you before?
      options:
        - First time setup (never worked)
        - Worked before, now broken (regression)
        - Not sure
    validations:
      required: true

  - type: dropdown
    id: num-accounts
    attributes:
      label: Number of Google accounts configured
      options:
        - "1"
        - "2-3"
        - "4+"
    validations:
      required: true

  - type: dropdown
    id: reproducibility
    attributes:
      label: Reproducibility
      description: How often does this issue occur?
      options:
        - Always (100%)
        - Often (>50%)
        - Sometimes (<50%)
        - Once (cannot reproduce)
    validations:
      required: true

  - type: input
    id: plugin-version
    attributes:
      label: Plugin version
      description: "Run: `npm list opencode-antigravity-auth -g 2>/dev/null || npm list opencode-antigravity-auth`"
      placeholder: "e.g., 1.2.9-beta.5"
    validations:
      required: true

  - type: input
    id: opencode-version
    attributes:
      label: OpenCode version
      description: "Run: `opencode --version`"
      placeholder: "e.g., 0.3.0"
    validations:
      required: true

  - type: input
    id: os
    attributes:
      label: Operating System
      placeholder: "e.g., macOS 15.2, Ubuntu 24.04, Windows 11"
    validations:
      required: true

  - type: input
    id: node-version
    attributes:
      label: Node.js version
      description: "Run: `node --version`"
      placeholder: "e.g., v22.12.0"
    validations:
      required: true

  - type: dropdown
    id: environment
    attributes:
      label: Environment type
      description: Are you running in a special environment?
      options:
        - Standard (native terminal)
        - WSL2
        - Docker
        - SSH / Remote
        - VS Code Remote
        - Other (specify in additional context)
    validations:
      required: true

  - type: textarea
    id: mcp-servers
    attributes:
      label: MCP servers installed
      description: List any MCP (Model Context Protocol) servers you have configured. This helps us identify potential interactions or conflicts.
      placeholder: |
        Example:
        - chrome-devtools
        - figma
    validations:
      required: false

  - type: textarea
    id: logs
    attributes:
      label: Debug logs (REQUIRED)
      description: |
        **Issues without logs will be closed.**

        1. Enable debug logging: `export OPENCODE_ANTIGRAVITY_DEBUG=2`
        2. Reproduce the issue
        3. Find log file at:
           - macOS/Linux: `~/.config/opencode/antigravity-logs/antigravity-debug-<timestamp>.log`
           - Windows: `%APPDATA%\opencode\antigravity-logs\antigravity-debug-<timestamp>.log`
        4. Paste relevant sections or attach the file
      placeholder: Paste your debug logs here...
      render: text
    validations:
      required: true

  - type: textarea
    id: config
    attributes:
      label: Configuration (optional)
      description: Share your antigravity.json if relevant (remove sensitive data)
      placeholder: |
        {
          "quiet_mode": false,
          "debug": false
        }
      render: json
    validations:
      required: false

  - type: checkboxes
    id: compliance
    attributes:
      label: Compliance
      options:
        - label: I'm using this plugin for personal development only
          required: true
        - label: This issue is not related to commercial use or TOS violations
          required: true

  - type: textarea
    id: additional
    attributes:
      label: Additional context
      description: Any other relevant information
    validations:
      required: false
