Skip to content

Commit

Permalink
feat: provide directory information to the agent from FE (#4622)
Browse files Browse the repository at this point in the history
Co-authored-by: Engel Nyst <[email protected]>
  • 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.