codeep 1.2.64 → 1.2.66

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.
@@ -2227,11 +2227,25 @@ export class App {
2227
2227
  // Regular text with possible inline markdown
2228
2228
  const { formatted, hasFormatting } = this.applyInlineMarkdown(line);
2229
2229
  if (hasFormatting) {
2230
- lines.push({
2231
- text: prefix + formatted,
2232
- style: prefixStyle,
2233
- raw: true,
2234
- });
2230
+ // Use original (no-ANSI) line to measure and wrap, then apply markdown per segment
2231
+ if (stringWidth(line) > maxWidth - prefix.length) {
2232
+ const wrapped = this.wordWrap(line, maxWidth - prefix.length);
2233
+ for (let j = 0; j < wrapped.length; j++) {
2234
+ const { formatted: segFormatted } = this.applyInlineMarkdown(wrapped[j]);
2235
+ lines.push({
2236
+ text: (j === 0 ? prefix : ' ') + segFormatted,
2237
+ style: j === 0 ? prefixStyle : '',
2238
+ raw: true,
2239
+ });
2240
+ }
2241
+ }
2242
+ else {
2243
+ lines.push({
2244
+ text: prefix + formatted,
2245
+ style: prefixStyle,
2246
+ raw: true,
2247
+ });
2248
+ }
2235
2249
  }
2236
2250
  else {
2237
2251
  // Plain text - word wrap as before
@@ -2435,7 +2449,23 @@ export class App {
2435
2449
  const lines = [];
2436
2450
  let currentLine = '';
2437
2451
  for (const word of words) {
2438
- if (stringWidth(currentLine) + stringWidth(word) + 1 > maxWidth && currentLine) {
2452
+ const wordW = stringWidth(word);
2453
+ // Hard-break words wider than maxWidth (e.g. long file paths with no spaces)
2454
+ if (wordW > maxWidth) {
2455
+ if (currentLine) {
2456
+ lines.push(currentLine);
2457
+ currentLine = '';
2458
+ }
2459
+ // Slice the word into maxWidth chunks
2460
+ let remaining = word;
2461
+ while (stringWidth(remaining) > maxWidth) {
2462
+ lines.push(remaining.slice(0, maxWidth));
2463
+ remaining = remaining.slice(maxWidth);
2464
+ }
2465
+ currentLine = remaining;
2466
+ continue;
2467
+ }
2468
+ if (stringWidth(currentLine) + wordW + 1 > maxWidth && currentLine) {
2439
2469
  lines.push(currentLine);
2440
2470
  currentLine = word;
2441
2471
  }
@@ -283,6 +283,18 @@ export async function runAgent(prompt, projectContext, options = {}) {
283
283
  await new Promise(resolve => setTimeout(resolve, 1000 * retryCount));
284
284
  continue;
285
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
+ }
286
298
  throw error;
287
299
  }
288
300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.64",
3
+ "version": "1.2.66",
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",