fix: Disable shown agent without selecting

This commit is contained in:
Petr Mironychev
2026-06-30 13:45:48 +02:00
parent 714b1367b7
commit c070d65366
7 changed files with 111 additions and 32 deletions

View File

@@ -155,6 +155,7 @@ void AgentFactory::reload()
QDir().mkpath(userAgentsDir());
auto result = Agents::AgentLoader::load(agentQrcPrefix(), userAgentsDir());
m_sourcePathByName = std::move(result.sourcePathByName);
for (const QString &err : result.errors)
LOG_MESSAGE(QString("[Agents] error: %1").arg(err));
for (const QString &warn : result.warnings)
@@ -212,6 +213,11 @@ const AgentConfig *AgentFactory::configByName(const QString &name) const
return &m_configs[it.value()];
}
QString AgentFactory::sourcePathForName(const QString &name) const
{
return m_sourcePathByName.value(name);
}
QStringList AgentFactory::configNames() const
{
QStringList out;
@@ -323,6 +329,7 @@ void AgentFactory::clear()
Q_ASSERT(thread() == QThread::currentThread());
m_configs.clear();
m_indexByName.clear();
m_sourcePathByName.clear();
m_baseModelByName.clear();
m_baseProviderByName.clear();
m_baseToolsByName.clear();