@masslessai/push-todo 4.1.0 → 4.1.1
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/lib/context-engine.js +10 -1
- package/lib/daemon.js +42 -13
- package/package.json +1 -1
package/lib/context-engine.js
CHANGED
|
@@ -234,7 +234,16 @@ export function buildSmartPrompt(task, context) {
|
|
|
234
234
|
const sections = [];
|
|
235
235
|
|
|
236
236
|
// 1. Task section (always present)
|
|
237
|
-
|
|
237
|
+
// For follow-ups, frame as iteration on previous work
|
|
238
|
+
if (task.followUpRequest) {
|
|
239
|
+
sections.push(`## Task (Follow-Up Iteration #${task.followUpIteration || 2})\nContinue working on Push task #${task.displayNumber}.\n\nOriginal task:\n${task.content}\n\n**Follow-up request:**\n${task.followUpRequest}`);
|
|
240
|
+
// Include previous execution summary as context
|
|
241
|
+
if (task.previousSummary) {
|
|
242
|
+
sections.push(`## Previous Iteration Summary\nHere's what was accomplished in the previous iteration:\n\n${task.previousSummary}`);
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
sections.push(`## Task\nWork on Push task #${task.displayNumber}:\n\n${task.content}`);
|
|
246
|
+
}
|
|
238
247
|
|
|
239
248
|
// 2. Metadata section (conditional)
|
|
240
249
|
const metaParts = [];
|
package/lib/daemon.js
CHANGED
|
@@ -1521,10 +1521,21 @@ async function executeTask(task) {
|
|
|
1521
1521
|
log(`Task #${displayNumber}: claim failed, skipping`);
|
|
1522
1522
|
return null;
|
|
1523
1523
|
}
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1524
|
+
// Follow-up: skip auto-heal when follow_up_request is set — the existing
|
|
1525
|
+
// branch/PR is intentional context, not evidence of completion.
|
|
1526
|
+
const followUpRequest = task.followUpRequest || task.follow_up_request || null;
|
|
1527
|
+
const followUpIteration = task.followUpIteration || task.follow_up_iteration || 1;
|
|
1528
|
+
const previousSessionId = task.executionSessionId || task.execution_session_id || null;
|
|
1529
|
+
const previousSummary = task.executionSummary || task.execution_summary || null;
|
|
1530
|
+
|
|
1531
|
+
if (!followUpRequest) {
|
|
1532
|
+
const healed = await autoHealExistingWork(displayNumber, summary, projectPath, taskId);
|
|
1533
|
+
if (healed) {
|
|
1534
|
+
log(`Task #${displayNumber}: auto-healed from previous execution, skipping re-execution`);
|
|
1535
|
+
return null;
|
|
1536
|
+
}
|
|
1537
|
+
} else {
|
|
1538
|
+
log(`Task #${displayNumber}: follow-up iteration #${followUpIteration}, skipping auto-heal`);
|
|
1528
1539
|
}
|
|
1529
1540
|
|
|
1530
1541
|
// Track task details
|
|
@@ -1578,7 +1589,8 @@ async function executeTask(task) {
|
|
|
1578
1589
|
const projectContext = projectPath ? getProjectContext(projectPath) : { skills: [], state: {} };
|
|
1579
1590
|
const contextApp = task.contextApp || task.context_app || null;
|
|
1580
1591
|
const prompt = buildSmartPrompt(
|
|
1581
|
-
{ displayNumber, content, attachmentContext, actionName, contextApp
|
|
1592
|
+
{ displayNumber, content, attachmentContext, actionName, contextApp,
|
|
1593
|
+
followUpRequest, followUpIteration, previousSummary },
|
|
1582
1594
|
projectContext
|
|
1583
1595
|
);
|
|
1584
1596
|
|
|
@@ -1595,14 +1607,31 @@ async function executeTask(task) {
|
|
|
1595
1607
|
'Task'
|
|
1596
1608
|
].join(',');
|
|
1597
1609
|
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1610
|
+
// For follow-ups: try --continue with previous session for full context.
|
|
1611
|
+
// Falls back to new session with prompt context if session is stale/unavailable.
|
|
1612
|
+
const useResume = followUpRequest && previousSessionId;
|
|
1613
|
+
const claudeArgs = useResume
|
|
1614
|
+
? [
|
|
1615
|
+
'--continue', previousSessionId,
|
|
1616
|
+
'-p', prompt,
|
|
1617
|
+
'--worktree', worktreeName,
|
|
1618
|
+
'--allowedTools', allowedTools,
|
|
1619
|
+
'--output-format', 'json',
|
|
1620
|
+
'--permission-mode', 'bypassPermissions',
|
|
1621
|
+
'--session-id', preAssignedSessionId
|
|
1622
|
+
]
|
|
1623
|
+
: [
|
|
1624
|
+
'-p', prompt,
|
|
1625
|
+
'--worktree', worktreeName,
|
|
1626
|
+
'--allowedTools', allowedTools,
|
|
1627
|
+
'--output-format', 'json',
|
|
1628
|
+
'--permission-mode', 'bypassPermissions',
|
|
1629
|
+
'--session-id', preAssignedSessionId
|
|
1630
|
+
];
|
|
1631
|
+
|
|
1632
|
+
if (useResume) {
|
|
1633
|
+
log(`Task #${displayNumber}: resuming session ${previousSessionId} for follow-up`);
|
|
1634
|
+
}
|
|
1606
1635
|
|
|
1607
1636
|
try {
|
|
1608
1637
|
const child = spawn('claude', claudeArgs, {
|