message: Bugfix: Check before picking task automatically.
diff: @@ -147,6 +147,7 @@ export class AgentScheduler extends Component implements IAgentScheduler {
  }
  private async pickNewTasks(ids: string[]) {
  + if (this.runtime.connected) {
  const possibleTasks: ITask[] = [];
  for (const id of ids) {
  if (this.localTaskMap.has(id)) {
  @@ -159,6 +160,7 @@ export class AgentScheduler extends Component implements IAgentScheduler {
  }
  return this.pickCore(possibleTasks);
  }
  + }
  private async registerCore(taskIds: string[]): Promise<void> {
  if (taskIds.length > 0) {
  @@ -236,7 +238,7 @@ export class AgentScheduler extends Component implements IAgentScheduler {
  }
  private async clearTasks(taskIds: string[]) {
  - if (taskIds.length > 0) {
  + if (this.runtime.connected && taskIds.length > 0) {
  const clearP = [];
  for (const id of taskIds) {
  debug(`Clearing ${id}`);
  