claude-task-worker 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -518,7 +518,7 @@ async function getRepoInfo() {
|
|
|
518
518
|
const parsed = JSON.parse(output);
|
|
519
519
|
return { owner: parsed.owner.login, name: parsed.name, defaultBranch: parsed.defaultBranchRef.name };
|
|
520
520
|
}
|
|
521
|
-
async function listIssuesByLabel(assignee, labels, excludeLabels = [], epicFilter) {
|
|
521
|
+
async function listIssuesByLabel(assignee, labels, excludeLabels = [], epicFilter, limit = 10) {
|
|
522
522
|
const labelArgs = labels.flatMap((label) => ["--label", label]);
|
|
523
523
|
const searchTerms = ["sort:created-asc", "-is:blocked", ...excludeLabels.map((label) => `-label:"${label}"`)];
|
|
524
524
|
if (epicFilter && epicFilter.numbers.length > 0) {
|
|
@@ -538,7 +538,7 @@ async function listIssuesByLabel(assignee, labels, excludeLabels = [], epicFilte
|
|
|
538
538
|
"--search",
|
|
539
539
|
search,
|
|
540
540
|
"--limit",
|
|
541
|
-
|
|
541
|
+
String(limit)
|
|
542
542
|
]);
|
|
543
543
|
return JSON.parse(output);
|
|
544
544
|
}
|
|
@@ -622,7 +622,7 @@ async function fetchPRChecks(prNumber) {
|
|
|
622
622
|
if (!output) return [];
|
|
623
623
|
return JSON.parse(output);
|
|
624
624
|
}
|
|
625
|
-
async function listPullRequestsWithChecks(assignee, label, excludeLabels = []) {
|
|
625
|
+
async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], limit = 5) {
|
|
626
626
|
const search = ["sort:created-asc", ...excludeLabels.map((l) => `-label:"${l}"`)].join(" ");
|
|
627
627
|
const args = [
|
|
628
628
|
"pr",
|
|
@@ -634,7 +634,7 @@ async function listPullRequestsWithChecks(assignee, label, excludeLabels = []) {
|
|
|
634
634
|
"--search",
|
|
635
635
|
search,
|
|
636
636
|
"--limit",
|
|
637
|
-
|
|
637
|
+
String(limit)
|
|
638
638
|
];
|
|
639
639
|
if (assignee) {
|
|
640
640
|
args.push("--assignee", assignee);
|
|
@@ -1706,6 +1706,7 @@ async function removeStaleWorktrees() {
|
|
|
1706
1706
|
|
|
1707
1707
|
// src/workers/issue-worker.ts
|
|
1708
1708
|
var LABEL_TRIAGE_SCOPE = "cc-triage-scope";
|
|
1709
|
+
var PREFLIGHT_SEARCH_LIMIT = 5;
|
|
1709
1710
|
function createIssuePollingWorker(config) {
|
|
1710
1711
|
return async () => {
|
|
1711
1712
|
const { owner, name, defaultBranch } = await getRepoInfo();
|
|
@@ -1724,7 +1725,9 @@ function createIssuePollingWorker(config) {
|
|
|
1724
1725
|
const excludeLabels = ["cc-in-progress", "cc-need-human-check", ...config.excludeLabels ?? []];
|
|
1725
1726
|
const epicFilter = config.epicFilters && config.epicFilters.length > 0 ? { owner, repo: name, numbers: config.epicFilters } : void 0;
|
|
1726
1727
|
const labels = config.labelFilters && config.labelFilters.length > 0 ? [...config.triggerLabels, ...config.labelFilters] : config.triggerLabels;
|
|
1727
|
-
const
|
|
1728
|
+
const { maxConcurrentTasks } = getWorkerConfig(config.name);
|
|
1729
|
+
const searchLimit = config.preflight ? PREFLIGHT_SEARCH_LIMIT : maxConcurrentTasks;
|
|
1730
|
+
const candidates = config.ownNumberFilters && config.ownNumberFilters.length > 0 ? await listIssuesByNumbers(user, labels, excludeLabels, config.ownNumberFilters) : await listIssuesByLabel(user, labels, excludeLabels, epicFilter, searchLimit);
|
|
1728
1731
|
for (const issue of candidates) {
|
|
1729
1732
|
if (isRunning(issue.number)) continue;
|
|
1730
1733
|
if (isWorkerAtCapacity(config.name)) break;
|