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

refactor: format prompt block before dispatch log to preserve ordering (#2836)

[._.]/ Adam Eivyff2d87483be2
diff --git a/server/services/cosTaskGenerator.js b/server/services/cosTaskGenerator.js
index 37c831f6a8..4933d5aeda 100644
--- a/server/services/cosTaskGenerator.js
+++ b/server/services/cosTaskGenerator.js
@@ -1914,8 +1914,9 @@ async function resolveBranchReconcileBlock(app, taskType, metadata, taskSchedule
await taskSchedule.clearPerpetualPark(taskType, app.id);
await taskSchedule.setPerpetualSignature(taskType, app.id, signature);
metadata.perpetual = true;
+ const block = formatInFlightForPrompt(actionable, { defaultBranch: result.defaultBranch, actions });
emitLog('info', `🔀 branch-reconcile dispatching for ${app.name}: ${actionable.length} in-flight branch(es)`, { appId: app.id, analysisType: taskType });
- return { skip: false, block: formatInFlightForPrompt(actionable, { defaultBranch: result.defaultBranch, actions }) };
+ return { skip: false, block };
}
/**
@@ -1964,14 +1965,12 @@ async function resolveIssueReconcileBlock(app, taskType, metadata, taskSchedule)
await taskSchedule.clearPerpetualPark(taskType, app.id);
await taskSchedule.setPerpetualSignature(taskType, app.id, signature);
metadata.perpetual = true;
+ const block = formatZombiesForPrompt(result.zombies, {
+ fullName: result.fullName, forge: result.forge, autoClose,
+ projectKey: jira?.projectKey, instanceId: jira?.instanceId,
+ });
emitLog('info', `🧟 issue-reconcile dispatching for ${app.name}: ${result.zombies.length} zombie issue(s) on ${result.forge}`, { appId: app.id, analysisType: taskType });
- return {
- skip: false,
- block: formatZombiesForPrompt(result.zombies, {
- fullName: result.fullName, forge: result.forge, autoClose,
- projectKey: jira?.projectKey, instanceId: jira?.instanceId,
- })
- };
+ return { skip: false, block };
}
/**
@@ -2056,15 +2055,11 @@ async function resolvePrWatcherBlock(app, taskType, metadata, taskSchedule) {
return { skip: true };
}
+ const block = prWatcher.formatPullRequestsForPrompt(check.newPrs, {
+ repoFullName: check.repoFullName, defaultBranch: check.defaultBranch
+ });
emitLog('info', `pr-watcher dispatching for ${app.name}: ${check.newPrs.length} new PR(s)`, { appId: app.id, analysisType: taskType });
- return {
- skip: false,
- block: prWatcher.formatPullRequestsForPrompt(check.newPrs, {
- repoFullName: check.repoFullName, defaultBranch: check.defaultBranch
- }),
- repoFullName: check.repoFullName,
- defaultBranch: check.defaultBranch
- };
+ return { skip: false, block, repoFullName: check.repoFullName, defaultBranch: check.defaultBranch };
}
export async function generateManagedAppImprovementTaskForType(taskType, app, state, { skipPreconditions = false } = {}) {