Файли
openidea/src/features/agents/taskSearch.ts
T
Deng Liuтаdengliu ac68fbe39e feat(agents): organize automated runs in a dedicated Automations group (#7605)
Automated agent runs get their own Automations group in the Agents tool window (below Ready to Review, active runs first, then latest update); runs that need input, failed or hit a usage limit escalate to those groups with an Automated cue. The default automated-run filter becomes Latest & Active: the latest run per schedule plus active, urgent and unread runs, so reading a rolling SameTask session no longer hides it. SameTask sessions are titled with the automation name, rows show a #run tag, orphaned runs a Detached pill, and context menus gain Open Automation and Pause/Resume Schedule.

Co-authored-by: dengliu <[email protected]>
2026-12-03 06:03:27 +08:00

21 рядки
921 B
TypeScript

/** Filtering the Agents task list: fuzzy on the title (highlighted), word starts on the project folder and branch. */
import type { AgentTask } from "@/bindings";
import { fuzzyMatch, wordMatch } from "@/ui";
import { basename } from "@/platform/project";
import { taskDisplayTitle } from "./model";
/** Indices of `query` in the task's displayed title to highlight ([] when another field matched), or null when it doesn't match. */
export function matchTask(task: AgentTask, query: string): number[] | null {
const q = query.trim();
if (!q) return [];
const title = fuzzyMatch(taskDisplayTitle(task), q);
if (title) return title;
const others = [
task.projectRoot ? basename(task.projectRoot) : null,
task.branch,
task.automation ? `#${task.automation.runNumber}` : null,
task.automation?.automationName ?? null,
];
return others.some((text) => text && wordMatch(text, q)) ? [] : null;
}