From 89406bac443ce60392dc2a57fb2eee46da71a6c0 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Wed, 30 Oct 2024 00:10:47 -0500 Subject: [PATCH] feat: provide directory information to the agent from FE (#4622) Co-authored-by: Engel Nyst --- frontend/src/routes/_oh.app.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/_oh.app.tsx b/frontend/src/routes/_oh.app.tsx index e80bf5e21651..64d83d66f88a 100644 --- a/frontend/src/routes/_oh.app.tsx +++ b/frontend/src/routes/_oh.app.tsx @@ -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 } }