Skip to content

Skip if agent if null #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ public PluginDef UpdatePluginStatus(IServiceProvider services, string id, bool e
foreach (var agentId in plugin.AgentIds)
{
var agent = agentService.LoadAgent(agentId).Result;
agent.Disabled = true;
agentService.UpdateAgent(agent, AgentField.Disabled);
if (agent != null)
{
agent.Disabled = true;
agentService.UpdateAgent(agent, AgentField.Disabled);
}
}
}
return plugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Use the TwoStagePlanner approach to plan the overall implementation steps, follow the below steps strictly.
1. call plan_primary_stage to generate the primary plan.
2. If need_additional_information is true, call plan_secondary_stage for the specific primary stage.
3. You must call plan_summary as the last planning step to summarize the final query.
3. You must call plan_summary for you final planned output.

*** IMPORTANT ***
Don't run the planning process repeatedly if you have already got the result of user's request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ VALUES ((SELECT MAX(Id) + 1 FROM data_Service), 'HVAC');
If the table structure didn't mention auto incremental, the data field id needs to insert id manually and you need to use max(id) instead of LAST_INSERT_ID function.
For example, you should use SET @id = select max(id) from table;

* the alias of the table name in the sql query should be identical.
*** the alias of the table name in the sql query should be identical. ***
*** the generated sql query MUST be basedd on the provided table structure. ***
*** All queries return a maximum of 20 records. ***
*** Only select user friendly columns. ***
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ The query must exactly based on the provided table structure. And carefully revi
Note: Output should be only the sql query with sql comments that can be directly run in SQL Server.

*** the alias of the table name in the sql query should be identical. ***
*** The generated sql query MUST be basedd on the provided table structure. ***
*** The generated sql query MUST be based on the provided table structure. ***
*** All queries return a maximum of 10 records. ***
*** Only select user friendly columns. ***
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<bool> Execute(RoleDialogModel message)
private IEnumerable<dynamic> RunQueryInMySql(string[] sqlTexts)
{
var settings = _services.GetRequiredService<SqlDriverSetting>();
using var connection = new MySqlConnection(settings.MySqlExecutionConnectionString);
using var connection = new MySqlConnection(settings.MySqlExecutionConnectionString ?? settings.MySqlConnectionString);
return connection.Query(string.Join(";\r\n", sqlTexts));
}

Expand Down