diff --git a/ChatView/ClientInterface.cpp b/ChatView/ClientInterface.cpp index a4083c0..6ff560e 100644 --- a/ChatView/ClientInterface.cpp +++ b/ChatView/ClientInterface.cpp @@ -99,13 +99,19 @@ void ClientInterface::sendMessage( QString systemPrompt = chatAssistantSettings.systemPrompt(); auto project = LLMCore::RulesLoader::getActiveProject(); + if (project) { + systemPrompt += QString("\n# Active project name: %1").arg(project->displayName()); + systemPrompt += QString("\n# Active Project path: %1").arg(project->projectDirectory().toUrlishString()); + QString projectRules = LLMCore::RulesLoader::loadRulesForProject(project, LLMCore::RulesContext::Chat); if (!projectRules.isEmpty()) { - systemPrompt += "\n# Project Rules\n\n" + projectRules; + systemPrompt += QString("\n# Project Rules\n\n") + projectRules; } + } else { + systemPrompt += QString("\n# No active project in IDE"); } if (!linkedFiles.isEmpty()) { diff --git a/tools/ListProjectFilesTool.cpp b/tools/ListProjectFilesTool.cpp index 4ad2d28..f39e45b 100644 --- a/tools/ListProjectFilesTool.cpp +++ b/tools/ListProjectFilesTool.cpp @@ -86,7 +86,7 @@ QFuture ListProjectFilesTool::executeAsync(const QJsonObject &input) return QtConcurrent::run([this]() -> QString { QList projects = ProjectExplorer::ProjectManager::projects(); if (projects.isEmpty()) { - QString error = "Error: No projects found"; + QString error = "No projects found"; throw ToolRuntimeError(error); }