codeep 1.2.63 → 1.2.65
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.
|
@@ -322,7 +322,11 @@ export async function executeAgentTask(task, dryRun, ctx) {
|
|
|
322
322
|
app.addMessage({ role: 'assistant', content: 'Agent stopped by user.' });
|
|
323
323
|
}
|
|
324
324
|
else {
|
|
325
|
-
|
|
325
|
+
const failLines = [];
|
|
326
|
+
if (result.finalResponse)
|
|
327
|
+
failLines.push(result.finalResponse);
|
|
328
|
+
failLines.push(`**Agent stopped**: ${result.error || 'Unknown error'}`);
|
|
329
|
+
app.addMessage({ role: 'assistant', content: failLines.join('\n\n') });
|
|
326
330
|
}
|
|
327
331
|
autoSaveSession(app.getMessages(), ctx.projectPath);
|
|
328
332
|
}
|
package/dist/utils/agent.js
CHANGED
|
@@ -188,12 +188,20 @@ export async function runAgent(prompt, projectContext, options = {}) {
|
|
|
188
188
|
while (iteration < opts.maxIterations) {
|
|
189
189
|
// Check timeout
|
|
190
190
|
if (Date.now() - startTime > opts.maxDuration) {
|
|
191
|
+
const filesDone = actions.filter(a => a.type === 'write' || a.type === 'edit').map(a => a.target);
|
|
192
|
+
const durationMin = Math.round(opts.maxDuration / 60000);
|
|
193
|
+
const partialLines = [`Agent reached the time limit (${durationMin} min).`];
|
|
194
|
+
if (filesDone.length > 0) {
|
|
195
|
+
partialLines.push(`\n**Partial progress — files written/edited:**`);
|
|
196
|
+
[...new Set(filesDone)].forEach(f => partialLines.push(` ✓ \`${f}\``));
|
|
197
|
+
partialLines.push(`\nYou can continue by running the agent again.`);
|
|
198
|
+
}
|
|
191
199
|
result = {
|
|
192
200
|
success: false,
|
|
193
201
|
iterations: iteration,
|
|
194
202
|
actions,
|
|
195
|
-
finalResponse: '
|
|
196
|
-
error: `Exceeded maximum duration of ${
|
|
203
|
+
finalResponse: partialLines.join('\n'),
|
|
204
|
+
error: `Exceeded maximum duration of ${durationMin} min`,
|
|
197
205
|
};
|
|
198
206
|
return result;
|
|
199
207
|
}
|
|
@@ -275,6 +283,18 @@ export async function runAgent(prompt, projectContext, options = {}) {
|
|
|
275
283
|
await new Promise(resolve => setTimeout(resolve, 1000 * retryCount));
|
|
276
284
|
continue;
|
|
277
285
|
}
|
|
286
|
+
// Handle 429 rate-limit / server overload with retry + backoff
|
|
287
|
+
if (err.message.includes('429')) {
|
|
288
|
+
retryCount++;
|
|
289
|
+
const waitSec = Math.min(5 * retryCount, 30); // 5s, 10s, 15s … max 30s
|
|
290
|
+
debug(`429 rate limit (retry ${retryCount}/${maxTimeoutRetries}), waiting ${waitSec}s`);
|
|
291
|
+
opts.onIteration?.(iteration, `Server busy (429), retrying in ${waitSec}s... (${retryCount}/${maxTimeoutRetries})`);
|
|
292
|
+
if (retryCount >= maxTimeoutRetries) {
|
|
293
|
+
throw error; // Give up after max retries
|
|
294
|
+
}
|
|
295
|
+
await new Promise(resolve => setTimeout(resolve, waitSec * 1000));
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
278
298
|
throw error;
|
|
279
299
|
}
|
|
280
300
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.65",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|