Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): manual /do:next honors configured claim-work metadata

Adam Eivyd07c9f2a95a5
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 324bc3ff32..4de0fe45bd 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -47,7 +47,7 @@
## Fixed
-- **The `/do:next` Slashdo button now honors the app's Work Tracker.** Per-app Work Tracker (PLAN.md / GitHub / GitLab / JIRA) already routed the *scheduled* `claim-work` flow, but the manual `/do:next` button inlined the raw slashdo command body — which always drains PLAN.md unless `--issues` is passed. Clicking it for an app set to GitHub/GitLab/JIRA Issues silently worked the wrong queue. The button now resolves the app's Work Tracker and delegates to the same claim flow the scheduler uses (`plan-task` / `claim-issue` / `claim-issue-gitlab` / `jira-sprint-manager`, via a shared `buildClaimWorkTask` router that also drives the scheduled path), inheriting the JIRA flow's CoS-managed worktree+PR isolation. The task description and button tooltip now read generically ("claim the next work item per this app's Work Tracker") instead of naming PLAN.md.
+- **The `/do:next` Slashdo button now honors the app's Work Tracker.** Per-app Work Tracker (PLAN.md / GitHub / GitLab / JIRA) already routed the *scheduled* `claim-work` flow, but the manual `/do:next` button inlined the raw slashdo command body — which always drains PLAN.md unless `--issues` is passed. Clicking it for an app set to GitHub/GitLab/JIRA Issues silently worked the wrong queue. The button now resolves the app's Work Tracker and delegates to the same claim flow the scheduler uses (`plan-task` / `claim-issue` / `claim-issue-gitlab` / `jira-sprint-manager`, via a shared `buildClaimWorkTask` router that also drives the scheduled path), inheriting the JIRA flow's CoS-managed worktree+PR isolation. It also resolves the same configured `claim-work` metadata the scheduler does (global → per-app override → Code Review Defaults), so clicking it honors the app's `issueAuthorFilter` (e.g. claim any open issue, not just owner-filed) and configured reviewers instead of silently forcing owner-only + Copilot. The task description and button tooltip now read generically ("claim the next work item per this app's Work Tracker") instead of naming PLAN.md.
- **The GitHub Release workflow no longer crashes on a large changelog.** The v2.22.0 release (a ~175KB changelog) failed at the "Create Release" step with `Argument list too long`: the changelog was passed to `softprops/action-gh-release` as the `body:` input, which GitHub materializes as an `INPUT_BODY` environment variable, and a 175KB env var overflows `ARG_MAX` when the action's Node process is exec'd. The body also exceeds GitHub's hard 125,000-character release-note limit (a separate HTTP 422). The workflow now writes the (placeholder-substituted) changelog to a file and feeds it via `body_path:` instead of an env var, and caps it at 120,000 chars on a whole-line boundary — appending a pointer to the full changelog file at the tag when truncated. (`.github/workflows/release.yml`)
- Scheduled-task descriptions in the Automation UI no longer fall back to a raw dasherized label. `claim-work` (the single-source work-tracker router), `code-reviewer-a`/`code-reviewer-b`, and `do-replan` now show real one-line descriptions instead of "claim work" / "code reviewer a", which read as orphaned/legacy tasks. A parity guard test now keeps the description map in sync with the task-type list.
- PM2 standardization no longer assigns ports that are already in use. The analysis now feeds the AI the set of listening/reserved ports (plus the common Vite defaults 5173/5174) to avoid, and a deterministic post-pass reassigns any port that still collides into the 6000–6099 range — so standardizing an app never lands on a port another app already holds.
diff --git a/server/services/cosTaskGenerator.js b/server/services/cosTaskGenerator.js
index afcf3c69ec..c66447df67 100644
--- a/server/services/cosTaskGenerator.js
+++ b/server/services/cosTaskGenerator.js
@@ -184,9 +184,16 @@ export function resolveIssueAuthorFilterBlock(promptTaskType, mode = 'owner') {
* delegated flow's worktree/PR posture (jira-sprint-manager needs CoS-managed
* isolation; the plan/github/gitlab prompts self-manage their worktree + PR).
*
+ * `issueAuthorFilter` and `reviewers` default to the app's *configured*
+ * `claim-work` behavior (global schedule metadata → per-app override → Code
+ * Review Defaults), exactly as the scheduled `claim-work` router resolves them —
+ * so clicking the button honors `issueAuthorFilter: 'any'` and non-Copilot
+ * reviewers instead of silently forcing owner-only + Copilot. Explicit options
+ * still win when a caller passes them.
+ *
* @returns {Promise<{ tracker, source, promptTaskType, prompt, taskMetadata }>}
*/
-export async function buildClaimWorkTask(app, { issueAuthorFilter = 'owner', reviewers = ['copilot'] } = {}) {
+export async function buildClaimWorkTask(app, { issueAuthorFilter, reviewers } = {}) {
const { resolveAppWorkTracker, trackerToClaimTaskType } = await import('../lib/workTracker.js');
const { getTaskPrompt } = await import('./taskPromptService.js');
const taskSchedule = await import('./taskSchedule.js');
@@ -195,9 +202,39 @@ export async function buildClaimWorkTask(app, { issueAuthorFilter = 'owner', rev
const promptTaskType = trackerToClaimTaskType(wt.resolved) || 'plan-task';
const template = await getTaskPrompt(promptTaskType);
- const reviewersList = Array.isArray(reviewers) ? reviewers : [reviewers];
- const reviewersCsv = reviewersList.filter(Boolean).join(', ') || 'copilot';
- const issueAuthorFilterBlock = resolveIssueAuthorFilterBlock(promptTaskType, issueAuthorFilter);
+ // Resolve the app's configured claim-work metadata the same way the scheduled
+ // router does: global schedule metadata, then per-app overrides on top (managed
+ // agent fields stripped, both passes sanitized/value-constrained). This is what
+ // carries the user's `issueAuthorFilter` and reviewer choices into the prompt.
+ const interval = await taskSchedule.getTaskInterval('claim-work');
+ const metadata = {};
+ const sanitizedGlobalMeta = sanitizeTaskMetadata(interval.taskMetadata);
+ if (sanitizedGlobalMeta) Object.assign(metadata, sanitizedGlobalMeta);
+ const appOverrides = await getAppTaskTypeOverrides(app.id);
+ const strippedAppOverride = taskSchedule.stripManagedAgentOptionsFromOverride(
+ 'claim-work', appOverrides['claim-work']?.taskMetadata
+ );
+ const sanitizedAppMeta = sanitizeTaskMetadata(strippedAppOverride);
+ if (sanitizedAppMeta) Object.assign(metadata, sanitizedAppMeta);
+
+ // Explicit option > configured metadata > 'owner' default.
+ const resolvedAuthorFilter = issueAuthorFilter ?? metadata.issueAuthorFilter ?? 'owner';
+
+ // Reviewers: explicit option wins; otherwise mirror the scheduler — merge
+ // configured metadata reviewers with the user's Code Review Defaults, dropping
+ // local-LLM reviewers the claim prompts can't drive, falling back to the
+ // hardcoded default when filtering empties the list. A settings read error
+ // degrades to the default inside normalizeReviewers, so it never blocks.
+ let reviewersList;
+ if (reviewers !== undefined) {
+ reviewersList = (Array.isArray(reviewers) ? reviewers : [reviewers]).filter(Boolean);
+ } else {
+ const codeReviewDefaults = await getCodeReviewDefaults().catch(() => null);
+ reviewersList = normalizeReviewers(metadata, codeReviewDefaults?.reviewers)
+ .filter((r) => !LOCAL_LLM_REVIEWERS.includes(r));
+ }
+ const reviewersCsv = (reviewersList.length ? reviewersList : [...DEFAULT_REVIEWERS]).join(',');
+ const issueAuthorFilterBlock = resolveIssueAuthorFilterBlock(promptTaskType, resolvedAuthorFilter);
const prompt = template
.replace(/\{appName\}/g, app.name)
diff --git a/server/services/cosTaskGenerator.test.js b/server/services/cosTaskGenerator.test.js
index c0eb6023f2..e9cbb72e4d 100644
--- a/server/services/cosTaskGenerator.test.js
+++ b/server/services/cosTaskGenerator.test.js
@@ -126,6 +126,21 @@ describe('claim-work single-source routing', () => {
expect(GEN_SRC).toMatch(/buildClaimWorkTask[\s\S]*resolveAppWorkTracker, trackerToClaimTaskType/);
expect(GEN_SRC).toMatch(/buildClaimWorkTask[\s\S]*resolveIssueAuthorFilterBlock\(promptTaskType/);
});
+
+ it('buildClaimWorkTask resolves issueAuthorFilter + reviewers from configured claim-work metadata (parity with scheduler)', () => {
+ // The manual button must honor the app's configured Work Tracker behavior
+ // (issueAuthorFilter:'any', non-Copilot reviewers), not force owner+copilot.
+ const fn = GEN_SRC.slice(GEN_SRC.indexOf('export async function buildClaimWorkTask('));
+ // Merges global schedule metadata then per-app overrides, same as the scheduler.
+ expect(fn).toMatch(/getTaskInterval\('claim-work'\)/);
+ expect(fn).toMatch(/getAppTaskTypeOverrides\(app\.id\)/);
+ expect(fn).toMatch(/stripManagedAgentOptionsFromOverride\(\s*'claim-work'/);
+ // issueAuthorFilter: explicit option > configured metadata > 'owner'.
+ expect(fn).toMatch(/issueAuthorFilter \?\? metadata\.issueAuthorFilter \?\? 'owner'/);
+ // reviewers fall back to Code Review Defaults via normalizeReviewers, dropping local-LLM reviewers.
+ expect(fn).toMatch(/normalizeReviewers\(metadata, codeReviewDefaults\?\.reviewers\)/);
+ expect(fn).toMatch(/LOCAL_LLM_REVIEWERS\.includes/);
+ });
});
// The {issueAuthorFilter} directive is shared by the scheduled claim-work router