File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
tui/internal/components/chat Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -419,9 +419,7 @@ export namespace Session {
419419 case "file:" :
420420 // have to normalize, symbol search returns absolute paths
421421 // Decode the pathname since URL constructor doesn't automatically decode it
422- const pathname = decodeURIComponent ( url . pathname )
423- const relativePath = pathname . replace ( app . path . cwd , "." )
424- const filePath = path . join ( app . path . cwd , relativePath )
422+ const filePath = decodeURIComponent ( url . pathname )
425423
426424 if ( part . mime === "text/plain" ) {
427425 let offset : number | undefined = undefined
@@ -501,7 +499,7 @@ export namespace Session {
501499 messageID : userMsg . id ,
502500 sessionID : input . sessionID ,
503501 type : "text" ,
504- text : `Called the Read tool with the following input: {\"filePath\":\"${ pathname } \"}` ,
502+ text : `Called the Read tool with the following input: {\"filePath\":\"${ filePath } \"}` ,
505503 synthetic : true ,
506504 } ,
507505 {
Original file line number Diff line number Diff line change 44 "encoding/base64"
55 "fmt"
66 "log/slog"
7- "net/url"
87 "os"
98 "path/filepath"
109 "strconv"
@@ -732,7 +731,7 @@ func (m *editorComponent) createAttachmentFromFile(filePath string) *attachment.
732731 ID : uuid .NewString (),
733732 Type : "file" ,
734733 Display : "@" + filePath ,
735- URL : fmt .Sprintf ("file://./ %s" , filePath ),
734+ URL : fmt .Sprintf ("file://%s" , absolutePath ),
736735 Filename : filePath ,
737736 MediaType : mediaType ,
738737 Source : & attachment.FileSource {
@@ -783,7 +782,7 @@ func (m *editorComponent) createAttachmentFromPath(filePath string) *attachment.
783782 ID : uuid .NewString (),
784783 Type : "file" ,
785784 Display : "@" + filePath ,
786- URL : fmt .Sprintf ("file://./ %s" , url . PathEscape ( filePath ) ),
785+ URL : fmt .Sprintf ("file://%s" , absolutePath ),
787786 Filename : filePath ,
788787 MediaType : mediaType ,
789788 Source : & attachment.FileSource {
You can’t perform that action at this time.
0 commit comments