Skip to content

Conversation

code-asher
Copy link
Member

A continuation from #19629

@code-asher code-asher force-pushed the asher/mcp-file-list branch 5 times, most recently from 577ae7e to a5b63d6 Compare August 30, 2025 01:43
@github-actions github-actions bot added the stale This issue is like stale bread. label Sep 7, 2025
@Kira-Pilot Kira-Pilot requested a review from ThomasK33 September 8, 2025 18:23
@github-actions github-actions bot removed the stale This issue is like stale bread. label Sep 9, 2025
@code-asher code-asher force-pushed the asher/mcp-file-edit branch 2 times, most recently from d82a0ff to 1f7ae1f Compare September 10, 2025 01:09
Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but you might want to get a second opinion, though.

@code-asher
Copy link
Member Author

code-asher commented Sep 11, 2025

@ethanndickson I think you added the list-directoryagent endpoint, right? Just want to get your opinion to make sure I have not broken anything for Coder Desktop since I think it uses this endpoint too.

@code-asher code-asher changed the base branch from asher/mcp-file-edit to main September 11, 2025 23:27
@code-asher
Copy link
Member Author

Yikes, sorry all for the pings, it happened when I was changing the base...

Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it live w/ Coder Desktop & A Linux workspace, just in case of any subtle regressions, but it lgtm! (sans the compile error)

func TestListFilesNonExistentDirectory(t *testing.T) {
t.Parallel()

query := LSRequest{
fs := afero.NewMemMapFs()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for plumbing this through!

}

// `contents` may be partially populated even if the operation fails midway.
contents, _ := f.ReadDir(-1)
respContents := make([]LSFile, 0, len(contents))
contents, _ := f.Readdir(-1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame Afero doesn't expose ReadDir here :(

ctx, span := tracing.StartSpan(ctx)
defer span.End()

res, err := c.apiRequest(ctx, http.MethodPost, fmt.Sprintf("/api/v0/list-directory?path=%s", path), req)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails to compile - not sure why CI isn't running though..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants