Skip to content

Commit

Permalink
feat: provide directory information to the agent from FE (All-Hands-A…
Browse files Browse the repository at this point in the history
…I#4622)

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
  • Loading branch information
xingyaoww and enyst authored Oct 30, 2024
1 parent 572b3ad commit 89406ba
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/src/routes/_oh.app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,23 @@ function App() {

// handle new session
if (!token) {
let additionalInfo = "";
if (ghToken && repo) {
send(getCloneRepoCommand(ghToken, repo));
additionalInfo = `Repository ${repo} has been cloned to /workspace. Please check the /workspace for files.`;
dispatch(clearSelectedRepository()); // reset selected repository; maybe better to move this to '/'?
}
// if there's an uploaded project zip, add it to the chat
else if (importedProjectZip) {
additionalInfo = `Files have been uploaded. Please check the /workspace for files.`;
}

if (q) {
sendInitialQuery(q, files);
if (additionalInfo) {
sendInitialQuery(`${q}\n\n[${additionalInfo}]`, files);
} else {
sendInitialQuery(q, files);
}
dispatch(clearFiles()); // reset selected files
}
}
Expand Down

0 comments on commit 89406ba

Please sign in to comment.