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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): don't read "no checks reported" as green, inherit provider pins
[._.]/ Adam Eivy4f7b4db37c2b
diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.jsindex 3fc7431d9c..5d96d782b4 100644--- a/server/services/agentPromptBuilder.js+++ b/server/services/agentPromptBuilder.js@@ -621,7 +621,7 @@ function buildCiMergeGateSteps(startStep, { prRef, mrRef = '<MR_NUMBER>', forge? `\`gh pr view ${prRef} --json state -q .state\` must return \`MERGED\`${glab ? ' (GitLab: `glab mr view ' + mrRef + '` must show it merged)' : ''}`: `\`glab mr view ${mrRef}\` must show it merged`;const lines = [- `${startStep}. **Wait for CI to finish**: ${checksCmd}. A repo with no checks configured reports "no checks reported" — treat that as green.`,+ `${startStep}. **Wait for CI to finish**: ${checksCmd}. "No checks reported" is AMBIGUOUS — a just-opened PR reports it while Actions is still attaching check runs, and merging on it races CI. Only treat it as green after you have confirmed the repo genuinely has no CI (${gh ? '`gh workflow list` is empty / no `.github/workflows` triggers on pull_request' : 'no `.gitlab-ci.yml` / no pipeline is configured'}); otherwise wait 30s and re-check, for up to 5 minutes, before concluding there is nothing to wait for.`,`${startStep + 1}. **Clear whatever blocks the merge, then re-check.** If a check failed, read the failing job's log (${gh ? `\`gh run view --log-failed\`${glab ? ' on GitHub, `glab ci trace` on GitLab' : ''}` : '`glab ci trace`'}), fix the cause here, run the project's tests, commit (\`fix:\` prefix, no Co-Authored-By), push, and go back to the previous step — cap this at 5 rounds. If ${mergeableCmd}, \`git fetch origin\`, rebase onto the base branch, resolve the conflicts keeping BOTH sides' intent, re-run the tests, \`git push --force-with-lease\`, and re-check.`,`${startStep + 2}. **Merge** with exactly these flags, nothing else — a true merge commit keeps the branch tip in the base branch's history so automated worktree cleanup can prove the branch is merged, and any merge-deferral flag leaves the PR open after you exit. If it is already merged (a saved \`/do:pr\` default can merge it for you), skip to the next step:`,' ```bash',diff --git a/server/services/agentPromptBuilder.test.js b/server/services/agentPromptBuilder.test.jsindex 5b203a8d3a..a776ceea40 100644--- a/server/services/agentPromptBuilder.test.js+++ b/server/services/agentPromptBuilder.test.js@@ -328,6 +328,9 @@ describe('buildLightContextPrompt', () => {expect(prompt).toMatch(/gh pr checks "<PR_URL>" --watch --fail-fast/);// A repo that disallows merge commits must not dead-end the flow.expect(prompt).toMatch(/mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed/);+ // "no checks reported" is ambiguous on a just-opened PR — merging on it races CI.+ expect(prompt).toMatch(/AMBIGUOUS/);+ expect(prompt).toMatch(/gh workflow list/);expect(prompt).toMatch(/gh pr merge "<PR_URL>" --merge --delete-branch/);expect(prompt).not.toMatch(/gh pr merge[^\n]*--auto/);expect(prompt).toMatch(/gh pr view "<PR_URL>" --json state -q \.state/);diff --git a/server/services/agentWorktreeCleanup.js b/server/services/agentWorktreeCleanup.jsindex 2d5d2f5fd5..edd2fc9fb1 100644--- a/server/services/agentWorktreeCleanup.js+++ b/server/services/agentWorktreeCleanup.js@@ -308,6 +308,19 @@ export async function spawnReviewLoopFollowUp({ originalAgentId, originalTask, p? { title: 'Merge', label: 'merge', reviewers: 'merge on green CI, no review' }: { title: 'Review Loop', label: 'review-loop', reviewers: [...effectiveReviewers, ...effectiveUsernames.map(u => `@${u}`)].join(', ') };+ // Inherit the source task's provider/model/effort pins. A follow-up runs a+ // coding harness (it fixes checks, resolves conflicts, drives reviewer CLIs),+ // so an install whose ACTIVE provider is api-only would permanently reject an+ // unpinned follow-up for lacking a harness — and the PR it was spawned to land+ // would sit open forever. Only copy what's actually pinned; an unpinned source+ // task still resolves through the normal active-provider path.+ const sourceMeta = originalTask?.metadata || {};+ const providerPins = {};+ if (sourceMeta.provider) providerPins.provider = sourceMeta.provider;+ if (sourceMeta.providerId) providerPins.providerId = sourceMeta.providerId;+ if (sourceMeta.model) providerPins.model = sourceMeta.model;+ if (sourceMeta.effort) providerPins.effort = sourceMeta.effort;+const appId = originalTask?.metadata?.app || null;const sourceTaskDesc = originalTask?.description || 'CoS automated task';const firstLine = sourceTaskDesc.split(/[\r\n]/).find(l => l.trim()) || sourceTaskDesc;@@ -322,6 +335,7 @@ export async function spawnReviewLoopFollowUp({ originalAgentId, originalTask, pdescription: followUpTitle,metadata: {app: appId,+ ...providerPins,// useWorktree is required so the follow-up runs in isolation; existingBranch// tells createWorktree to attach to the PR branch instead of cutting a new one.useWorktree: true,diff --git a/server/services/cleanupAgentWorktree.test.js b/server/services/cleanupAgentWorktree.test.jsindex 8bb003b493..ded44865c4 100644--- a/server/services/cleanupAgentWorktree.test.js+++ b/server/services/cleanupAgentWorktree.test.js@@ -535,6 +535,30 @@ describe('cleanupAgentWorktree - openPR path', () => {expect(removeWorktree).toHaveBeenCalled();});+ it('inherits the source task provider/model pins so the follow-up can actually run', async () => {+ // A follow-up needs a coding harness. On an install whose ACTIVE provider is+ // api-only, an unpinned follow-up is permanently rejected and the PR it was+ // spawned to land never merges.+ git.push.mockResolvedValue(undefined);+ git.createPR.mockResolvedValue({ success: true, url: 'https://github.com/test/repo/pull/99' });+ addTask.mockResolvedValue({ id: 'sys-rl-p' });++ await cleanupAgentWorktree('agent-1', true, {+ openPR: true, requestCopilotReview: false, description: 'X',+ originalTask: {+ id: 'task-orig',+ metadata: { provider: 'claude-code', providerId: 'claude-code', model: 'claude-opus-5', effort: 'high' },+ description: 'X'+ }+ });++ const [followUp] = addTask.mock.calls[0];+ expect(followUp.metadata.provider).toBe('claude-code');+ expect(followUp.metadata.providerId).toBe('claude-code');+ expect(followUp.metadata.model).toBe('claude-opus-5');+ expect(followUp.metadata.effort).toBe('high');+ });+it('leaves a jira-sprint-manager PR open — no follow-up merges behind the board', async () => {// That task type transitions its ticket to "In Review" and hands the PR to a// human; merging here would land the work while JIRA still shows it in review,@@ -598,6 +622,8 @@ describe('cleanupAgentWorktree - openPR path', () => {expect(addTask).toHaveBeenCalledTimes(1);const [followUp] = addTask.mock.calls[0];expect(followUp.metadata.reviewLoopMergeOnly).toBe(true);+ // Unpinned source task → no provider pins to inherit.+ expect(followUp.metadata.provider).toBeUndefined();// No reviewer may be defaulted back in — this PR was never meant to be reviewed.expect(followUp.metadata.reviewLoopReviewers).toEqual([]);expect(followUp.metadata.reviewLoopReviewerUsernames).toEqual([]);