codeep 1.2.72 → 1.2.74

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.
@@ -342,17 +342,17 @@ export async function runAgent(prompt, projectContext, options = {}) {
342
342
  .replace(/\{'path'[\s\S]*?\}/g, '')
343
343
  .replace(/```(?:json|tool_call)?\s*\{[\s\S]*?\}\s*```/g, '') // Only strip tool-call-like code blocks
344
344
  .trim();
345
- // Check if model indicates it wants to continue (incomplete response)
346
- const continueIndicators = [
347
- 'let me', 'i will', 'i\'ll', 'now i', 'next i',
348
- 'creating', 'writing', 'generating',
349
- 'let\'s', 'going to', 'need to create', 'need to write'
350
- ];
351
- const lowerResponse = finalResponse.toLowerCase();
352
- const wantsToContinue = continueIndicators.some(indicator => lowerResponse.includes(indicator));
353
- // Also check if there were tool call parsing failures in this iteration
354
- // by looking for incomplete actions (e.g., write_file without content)
355
- const hasIncompleteWork = wantsToContinue && finalResponse.length < 500
345
+ // Detect incomplete response using language-agnostic structural signals only.
346
+ // Keyword lists are brittle (language-dependent) — rely on punctuation/length instead.
347
+ const trimmed = finalResponse.trimEnd();
348
+ // A response ending with ':' means the model was about to list steps or execute tools
349
+ const endsWithColon = trimmed.endsWith(':');
350
+ // A very short response (< 120 chars) with no sentence-ending punctuation is likely
351
+ // a mid-thought fragment, not a real conclusion
352
+ const lastChar = trimmed.slice(-1);
353
+ const hasProperEnding = ['.', '!', '?', '"', '\'', '`', ')'].includes(lastChar);
354
+ const isShortFragment = trimmed.length < 120 && !hasProperEnding;
355
+ const hasIncompleteWork = (endsWithColon || isShortFragment)
356
356
  && incompleteWorkRetries < maxIncompleteWorkRetries;
357
357
  if (hasIncompleteWork) {
358
358
  debug('Model wants to continue, prompting for next action');
@@ -123,6 +123,7 @@ export function getAgentSystemPrompt(projectContext) {
123
123
  7. NEVER use execute_command for: ls, find, cat, grep, mkdir, rm, cp, mv, touch
124
124
  8. Use execute_command ONLY for: npm, git, composer, pip, cargo (build/package managers)
125
125
  9. When the task is complete, respond with a summary WITHOUT any tool calls
126
+ 10. CRITICAL: If the task is NOT complete, you MUST call a tool — never respond with only text mid-task. Do not "think out loud" or describe what you are about to do without calling a tool. Act immediately.
126
127
 
127
128
  ## Project Information
128
129
  Name: ${projectContext.name || 'Unknown'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.72",
3
+ "version": "1.2.74",
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",