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

fix(cos): disambiguate a configured exclude label that collides with a non-label structural skip cause

Adam Eivyffc1a35359a3
diff --git a/server/services/perpetualWork.js b/server/services/perpetualWork.js
index ae597b67f4..93a841ac12 100644
--- a/server/services/perpetualWork.js
+++ b/server/services/perpetualWork.js
@@ -56,6 +56,14 @@ export const NON_ACTIONABLE_ISSUE_LABELS = new Set([
IN_PROGRESS_LABEL, 'blocked', 'needs-input', 'future', 'wontfix', 'question', 'discussion'
]);
+// Structural skip causes that are NOT label names. A configured exclude label
+// colliding with one of these (`in-flight` especially — both UI consumers
+// suppress that cause because counts.inFlight already carries it) would be
+// indistinguishable from the structural skip, so the cause is prefixed on
+// collision. Label-shaped structural names need no entry: the structural label
+// check runs first and shadows a same-named configured label by design.
+const STRUCTURAL_NON_LABEL_CAUSES = new Set(['assigned', 'in-flight', 'decomposed-epic', 'malformed']);
+
// Exported so the timeout path is directly testable with fake timers rather
// than a real 15s wait.
export const CLI_TIMEOUT_MS = 15000;
@@ -290,7 +298,10 @@ function issueSkipCause(issue, inFlight = new Set(), excludeLabels = null, curre
if (structural) return structural;
if (excludeLabels) {
const excluded = labels.find((l) => excludeLabels.has(l));
- if (excluded) return excluded;
+ // Prefix only on collision with a non-label structural cause so the two
+ // remain distinguishable in the park breakdown; every other configured
+ // label keeps its bare name.
+ if (excluded) return STRUCTURAL_NON_LABEL_CAUSES.has(excluded) ? `excluded-label:${excluded}` : excluded;
}
// Marker first: the label scan is a 2–5 element array walk, while isEpicIssue
// lowercases and regex-tests the title. Only a decomposed issue needs the
diff --git a/server/services/perpetualWork.test.js b/server/services/perpetualWork.test.js
index ddbedfdfa1..7cc2b47edd 100644
--- a/server/services/perpetualWork.test.js
+++ b/server/services/perpetualWork.test.js
@@ -439,6 +439,22 @@ describe('perpetualWork', () => {
expect(out.skipCauses).toEqual({ constructor: 1 });
});
+ it('disambiguates a configured exclude label that collides with a non-label structural cause', async () => {
+ routeSpawn({
+ 'gh issue': { stdout: JSON.stringify([
+ { number: 1, title: 'reserved', assignees: [], labels: [{ name: 'in-flight' }] }
+ ]) },
+ 'git branch': { stdout: 'main\n' },
+ 'gh pr': { stdout: '' }
+ });
+ const out = await detectGithubIssues(app, { issueAuthorFilter: 'any', issueExcludeLabels: ['in-flight'] });
+ expect(out).toMatchObject({ actionable: false, count: 0, reason: 'no-actionable-issues' });
+ // A bare `in-flight` cause would be suppressed by both UI consumers
+ // (the toast and the picker exclude it because counts.inFlight carries
+ // the structural one) — the collision must stay distinguishable.
+ expect(out.skipCauses).toEqual({ 'excluded-label:in-flight': 1 });
+ });
+
it('keeps an issue assigned to the authenticated account claimable', async () => {
spawn.mockImplementation((cmd, args = []) => {
if (cmd === 'git' && args[0] === 'remote') return fakeChild('[email protected]:acme/widget.git\n');