Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ public async Task<List<IdName>> GetAgentOptions(List<string>? agentIdsOrNames, b
[SharpCache(10)]
public async Task<Agent> GetAgent(string id)
{
if (string.IsNullOrWhiteSpace(id))
{
return null;
}

var profile = _db.GetAgent(id);
if (profile == null)
{
_logger.LogError($"Can't find agent {id}");
return null;
}
if (string.IsNullOrWhiteSpace(id) || id == Guid.Empty.ToString())
{
_logger.LogWarning($"Can't find agent {id}, AgentId is empty.");
return null;
}

var profile = _db.GetAgent(id);
if (profile == null)
{
_logger.LogError($"Can't find agent {id}");
return null;
}

// Load llm config
var agentSetting = _services.GetRequiredService<AgentSettings>();
Expand Down
Loading