Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[bug] Copying Ask response to the clipboard embeds links to source files as relative paths #576

@brendan-kellam

Description

@brendan-kellam

Describe the bug

Copying a Ask response as Markdown will return source file links that are relative and not absolute. This makes things non-portable, depending on where the Markdown is pasted. For example, here is a snippet produced by ask. Try clicking on the IndexBuilder.Add() link. It will 404.


You're absolutely correct! The primary reason PDFs and other binary files are skipped is because they contain null bytes (0x00), not just because of size limits or trigram counts.

The Null Byte Check

In IndexBuilder.Add() indexbuilder.go:428-431:


To reproduce

Create a Ask response with a source link

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1): Latest

Additional information

We should resolve these links as absolute links within the code host, that way they are portable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ask_sbIssue related to Ask Sourcebot. https://docs.sourcebot.dev/docs/features/ask/overviewbugSomething isn't workingtriage needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions