Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

[WIP] Fix broken file links in Copilot chat#3834

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-broken-code-links
Draft

[WIP] Fix broken file links in Copilot chat#3834
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-broken-code-links

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 19, 2026

  • Fix ModelFilePathLinkifier to return display text instead of broken markdown link when file resolution fails for file paths (not URLs)
  • Fix un-linkifier in linkifier.ts to treat single-letter drive letters (c:, D:) as non-URI-scheme paths using /^\w{2,}:/
  • Add test for Windows drive-letter path de-linkification in linkifier.spec.ts
  • Add tests for unresolvable Windows backslash paths in modelFilePathLinkifier.spec.ts
  • Update test for invalid anchor syntax to match new fallback behavior
  • All 47 linkifier tests passing
  • TypeScript compilation clean
Original prompt

This section details on the original issue you should resolve

<issue_title>'Unable to open file' Copilot chat sends broken code links</issue_title>
<issue_description>Image

Metadata

requestType      : ChatCompletions
model            : claude-sonnet-4.5
maxPromptTokens  : 127997
maxResponseTokens: 16000
location         : 7
postOptions      : {"temperature":0,"top_p":1,"max_tokens":16000,"n":1,"stream":true}
intent           : undefined
startTime        : 2025-10-15T18:36:57.886Z
endTime          : 2025-10-15T18:37:17.331Z
duration         : 19445ms
ourRequestId     : 52ab05e5-e80d-47e6-a199-3975cecf40e8
requestId        : 52ab05e5-e80d-47e6-a199-3975cecf40e8
serverRequestId  : 52ab05e5-e80d-47e6-a199-3975cecf40e8
timeToFirstToken : 3490ms
usage            : {"completion_tokens":675,"prompt_tokens":33403,"prompt_tokens_details":{"cached_tokens":31721},"total_tokens":34078}
tools           : [
    {
        "function": {
            "name": "create_directory",
            "description": "Create a new directory structure in the workspace. Will recursively create all directories in the path, like mkdir -p. You do not need to use this tool before using create_file, that tool will automatically create the needed directories.",
            "parameters": {
                "type": "object",
                "properties": {
                    "dirPath": {
                        "type": "string",
                        "description": "The absolute path to the directory to create."
                    }
                },
                "required": [
                    "dirPath"
                ]
            }
        },
        "type": "function"
    },
    {
        "function": {
            "name": "create_file",
            "description": "This is a tool for creating a new file in the workspace. The file will be created with the specified content. The directory will be created if it does not already exist. Never use this tool to edit a file that already exists.",
            "parameters": {
                "type": "object",
                "properties": {
                    "filePath": {
                        "type": "string",
                        "description": "The absolute path to the file to create."
                    },
                    "content": {
                        "type": "string",
                        "description": "The content to write to the file."
                    }
                },
                "required": [
                    "filePath",
                    "content"
                ]
            }
        },
        "type": "function"
    },
    {
        "function": {
            "name": "create_new_jupyter_notebook",
            "description": "Generates a new Jupyter Notebook (.ipynb) in VS Code. Jupyter Notebooks are interactive documents commonly used for data exploration, analysis, visualization, and combining code with narrative text. Prefer creating plain Python files or similar unless a user explicitly requests creating a new Jupyter Notebook or already has a Jupyter Notebook opened or exists in the workspace.",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "The query to use to generate the jupyter notebook. This should be a clear and concise description of the notebook the user wants to create."
                    }
                },
                "required": [
                    "query"
                ]
            }
        },
        "type": "function"
    },
    {
        "function": {
            "name": "edit_notebook_file",
            "description": "This is a tool for editing an existing Notebook file in the workspace. Generate the \"explanation\" property first.\nThe system is very smart and can understand how to apply your edits to the notebooks.\nWhen updating the content of an existing cell, ensure newCode preserves whitespace and indentation exactly and does NOT include any code markers such as (...existing code...).",
            "parameters": {
                "type": "object",
                "properties": {
                    "filePath": {
                        "type": "string",
                        "description": "An absolute path to the notebook file to edit, or the URI of a untitled, not yet named, file, such as `untitled:Untitled-1."
                    },
                    "cellId": {
                        "type": "string",
                        "description": "Id of the cell that needs to be deleted or edited. Use the value `TOP`, `BOTTOM` when inserting a cell at the top or bottom of the notebook, else provide the id of the cell after which a new cell is to be inserted. Remember, if a cellId is provided and edi...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes microsoft/vscode#271573

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/vscode-copilot-chat/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants