multi-agents-cli 1.1.41 → 1.1.42
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/core/workflow/restart.js +17 -0
- package/package.json +1 -1
package/core/workflow/restart.js
CHANGED
|
@@ -145,6 +145,23 @@ const wipeAgent = ({ scope, agent, branch, worktreePath }) => {
|
|
|
145
145
|
try { execSync(`git branch -D ${branch}`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
|
|
146
146
|
try { execSync(`git push origin --delete ${branch}`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
|
|
147
147
|
|
|
148
|
+
// If scope folder has agent-built content on main, remove it so new branch starts clean
|
|
149
|
+
// Use filesystem truth, not tracking status (tracking may already be cleared by prior restart)
|
|
150
|
+
const scopeDir = require('path').join(ROOT, scope);
|
|
151
|
+
if (fs.existsSync(scopeDir)) {
|
|
152
|
+
const scopeContents = fs.readdirSync(scopeDir).filter(f => f !== 'CLAUDE.md');
|
|
153
|
+
if (scopeContents.length > 0) {
|
|
154
|
+
try {
|
|
155
|
+
fs.rmSync(scopeDir, { recursive: true, force: true });
|
|
156
|
+
require('child_process').execSync('git add -A', { cwd: ROOT, stdio: 'pipe' });
|
|
157
|
+
require('child_process').execSync(
|
|
158
|
+
`git commit --no-gpg-sign --no-verify -m "chore: remove ${scope} scope content for restart"`,
|
|
159
|
+
{ cwd: ROOT, stdio: 'pipe' }
|
|
160
|
+
);
|
|
161
|
+
} catch {}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
148
165
|
if (tracking[scope]?.[agent]) {
|
|
149
166
|
tracking[scope][agent] = { branch: null, timestamp: null, launchedAt: null, status: null, missingCount: 0, worktreePath: null };
|
|
150
167
|
fs.writeFileSync(TRACKING_PATH, JSON.stringify(tracking, null, 2), 'utf8');
|
package/package.json
CHANGED