-
Notifications
You must be signed in to change notification settings - Fork 7k
feat: /add-dir command
#8943
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: dev
Are you sure you want to change the base?
feat: /add-dir command
#8943
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: Related PR:
This PR is closely related since PR #8943 adds a The other PRs that appeared in results (#7378, #6714, #5841, #7515) are related to directory permissions but don't appear to be duplicates—they address different aspects like the |
|
This is actually pretty clean dang, ig let's fix typechecks and tests and should be mostly good. |
|
Wonder if we should inject something into context tho about the dir, like running the ls against it and sending as a user message that doesnt trigger generation (using noReply) |
|
Thought about that. Could add it in. |
|
Feel like we should yeah |
how do you feel about re-using ListTool for this? It has all the formatting etc. but the only downside is it needs a sort of a dummy ctx created for it. Or we just use ripgrep in it directly. const ctx = {
sessionID: body.sessionID,
messageID: "",
agent: "",
abort: new AbortController().signal,
extra: { bypassCwdCheck: true },
metadata: () => {},
ask: async () => {},
}
const result = await ListTool.init().then((t) => t.execute({ path: resolved }, ctx))
await SessionPrompt.prompt({
sessionID: body.sessionID,
noReply: true,
parts: [{ type: "text", text: `Added directory to context:\n\n${result.output}` }],
})EDIT: Probably an anti-pattern tbh, I think just using ripgrep is fine. |
Added this. The only blocker now is the |
|
Merged ur other pr in basically |
Should be good to merge, resolved merge conflict. |
|
I think this one is basically good, going to tweak the prompting of it a bit and prolly make the endpoint experimental (but we will keep it hooked up, may change routing / structure in future) |
What does this PR do?
Adds a
/add-dircommand, which gives the agent permissions to that directory in the existing session.How did you verify your code works?
Tested locally.