Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit mode allows @file context but does not send context to server #2908

Open
3 tasks done
hamiltont opened this issue Nov 13, 2024 · 0 comments
Open
3 tasks done

Edit mode allows @file context but does not send context to server #2908

hamiltont opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"

Comments

@hamiltont
Copy link

Before submitting your bug report

Relevant environment info

- OS: macOS
- Continue version: v0.8.56
- IDE version: VSCode Version: 1.95.1 Commit: 65edc4939843c90c34d61f4ce11704f09d3e5cb6
- Model: Claude Sonnet 3.5
- config.json:
  
{
  "models": [
    {
      "model": "claude-3-5-sonnet-20240620",
      "provider": "anthropic",
      "apiKey": "<removed>",
      "title": "Claude 3.5 Sonnet",
      "apiBase": "https://anthropic.helicone.ai/v1",
      "requestOptions": {
        "headers": {
            "Helicone-Auth": "<removed>",
            "Helicone-User-Id": "vscode"
        }
      },
      "systemMessage": "Generate only new/modified code segments. For existing code, use '// ... existing code'. Format each code block with:\n1. Filename as a comment header\n2. Only changes/additions\n3. Clear indicators of where changes belong\n\nSkip full file contents unless explicitly requested. Use markdown code blocks with language tags"
    },
    {
      "model": "claude-3-haiku-20240307",
      "systemMessage": "Generate only new/modified code segments. For existing code, use '// ... existing code'. Format each code block with:\n1. Filename as a comment header\n2. Only changes/additions\n3. Clear indicators of where changes belong\n\nSkip full file contents unless explicitly requested. Use markdown code blocks with language tags",
      "provider": "anthropic",
      "apiKey": "<removed>",
      "title": "Claude 3 Haiku",
      "apiBase": "https://anthropic.helicone.ai/v1",
      "requestOptions": {
        "headers": {
            "Helicone-Auth": "<removed>",
            "Helicone-User-Id": "vscode"
        }
      }
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": ""
  },
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
        "name": "repo-map"
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
    "name": "os"
    },  
    {
        "name": "tree"
    },
    {
      "name": "folder",
      "params": {
        "nRetrieve": 100,
        "nFinal": 10,
        "useReranking": true
      }
    },
    {
      "name": "codebase",
      "params": {
        "nRetrieve": 100,
        "nFinal": 5,
        "useReranking": true
      }
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ],
  "experimental": {
    "modelRoles": {
      "repoMapFileSelection": "Claude 3 Haiku"
    }
  }
}

Description

Edit mode allows you to ender @file annotations, but the referenced files are not sent as context to the LLM

To reproduce

  1. Click Cmd+I to open chat in edit mode
  2. Reference a different file
  3. Note output API request does NOT include the @-referenced file
  4. Note the LLM response clearly shows it's not getting context

Example editing a schemas.py file was : Rewrite this sqlalchemy schema file to match the contents of @schema.sql

Outbound API request was:

{
  "max_tokens": 4096,
  "model": "claude-3-5-sonnet-20240620",
  "stream": true,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "```python\nimport logging\n\nlog = logging.getLogger(__name__)\n\nfrom sqlalchemy import JSON, Column, Integer, String\n\nfrom .storage import Base\n\n\nclass StoredProposal(Base):\n    __tablename__ = \"proposals\"\n\n    id = Column(Integer, primary_key=True, index=True)\n    core = Column(JSON)\n    tags = Column(JSON)\n    type = Column(String, default=\"tr\")\n[BLANK]\n```\n\nAbove is the file of code that the user is currently editing in. Their cursor is located at the \"[BLANK]\". They have requested that you fill in the \"[BLANK]\" with code that satisfies the following request:\n\n\"Rewrite this sqlalchemy schema file to match the contents of schema.sql \"\n\nPlease generate this code. Your output will be only the code that should replace the \"[BLANK]\", without repeating any of the prefix or suffix, without any natural language explanation, and without messing up indentation. Here is the code that will replace the \"[BLANK]\":"
        }
      ]
    }
  ]
}

Log output

No response

@dosubot dosubot bot added area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"
Projects
None yet
Development

No branches or pull requests

2 participants