-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add coder_workspace_ls MCP tool #19652
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
base: main
Are you sure you want to change the base?
Conversation
577ae7e
to
a5b63d6
Compare
d82a0ff
to
1f7ae1f
Compare
a5b63d6
to
fd0c2fe
Compare
There was a problem hiding this 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.
@ethanndickson I think you added the |
fd0c2fe
to
d0f190a
Compare
Yikes, sorry all for the pings, it happened when I was changing the base... |
There was a problem hiding this 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() |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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..
A continuation from #19629