codeep 1.2.70 → 1.2.72

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/README.md CHANGED
@@ -357,13 +357,17 @@ Main modules: src, components, hooks, utils
357
357
  - Naming: camelCase
358
358
  ```
359
359
 
360
- ### Self-Verification
361
- After making changes, the agent automatically:
362
- 1. Runs **build** to check for compilation errors
363
- 2. Runs **tests** to ensure nothing is broken
364
- 3. Runs **type checking** for TypeScript/PHP projects
365
- 4. If errors found automatically tries to fix them (up to 3 attempts)
366
- 5. Reports final verification status
360
+ ### Self-Verification (Optional)
361
+ When enabled in Settings, the agent can automatically verify its changes by running build, tests, or type checking after completing a task. Disabled by default — the agent works freely and you decide when to verify.
362
+
363
+ Configure in **Settings Agent Auto-Verify**:
364
+ - **Off** (default) no automatic verification
365
+ - **Build only** checks compilation after changes
366
+ - **Typecheck only** runs TypeScript/PHP type checking
367
+ - **Test only** — runs test suite after changes
368
+ - **Build + Typecheck + Test** — full verification
369
+
370
+ If errors are found, the agent tries to fix them automatically (up to 3 attempts, configurable).
367
371
 
368
372
  **Supported project types:**
369
373
 
@@ -681,8 +685,8 @@ With write access enabled:
681
685
  | Agent Confirmation | Dangerous | `Never`, `Dangerous` (default), or `Always` |
682
686
  | Agent Auto-Commit | Off | Automatically commit after agent completes |
683
687
  | Agent Branch | Off | Create new branch for agent commits |
684
- | Agent Auto-Verify | On | Automatically run build/test after changes |
685
- | Agent Max Fix Attempts | 3 | Max attempts to auto-fix errors |
688
+ | Agent Auto-Verify | Off | `Off`, `Build only`, `Typecheck only`, `Test only`, or `Build + Typecheck + Test` |
689
+ | Agent Max Fix Attempts | 3 | Max attempts to auto-fix errors (when Auto-Verify is enabled) |
686
690
 
687
691
  ## Usage Examples
688
692
 
@@ -33,7 +33,7 @@ interface ConfigSchema {
33
33
  agentConfirmation: 'always' | 'dangerous' | 'never';
34
34
  agentAutoCommit: boolean;
35
35
  agentAutoCommitBranch: boolean;
36
- agentAutoVerify: boolean;
36
+ agentAutoVerify: 'off' | 'build' | 'typecheck' | 'test' | 'all';
37
37
  agentMaxFixAttempts: number;
38
38
  agentMaxIterations: number;
39
39
  agentMaxDuration: number;
@@ -146,7 +146,7 @@ function createConfig() {
146
146
  agentConfirmation: 'dangerous',
147
147
  agentAutoCommit: false,
148
148
  agentAutoCommitBranch: false,
149
- agentAutoVerify: true,
149
+ agentAutoVerify: 'off',
150
150
  agentMaxFixAttempts: 3,
151
151
  agentMaxIterations: 100,
152
152
  agentMaxDuration: 20,
@@ -263,6 +263,11 @@ export async function executeAgentTask(task, dryRun, ctx) {
263
263
  },
264
264
  abortSignal: abortController.signal,
265
265
  });
266
+ // Hide agent progress panel before adding completion message so the full
267
+ // message area is used when rendering (avoids truncated finalResponse)
268
+ ctx.setAgentRunning(false);
269
+ ctx.setAbortController(null);
270
+ app.setAgentRunning(false);
266
271
  if (result.success) {
267
272
  const fileChanges = result.actions.filter(a => a.type === 'write' || a.type === 'edit' || a.type === 'delete');
268
273
  const otherActions = result.actions.filter(a => a.type !== 'write' && a.type !== 'edit' && a.type !== 'delete');
@@ -336,9 +341,11 @@ export async function executeAgentTask(task, dryRun, ctx) {
336
341
  app.notify(`Agent error: ${err.message}`, 5000);
337
342
  }
338
343
  finally {
344
+ // Ensure cleanup even if an exception occurs (may already be false from success path)
339
345
  ctx.setAgentRunning(false);
340
346
  ctx.setAbortController(null);
341
347
  app.setAgentRunning(false);
348
+ app.render();
342
349
  }
343
350
  }
344
351
  // ─── Skill execution ──────────────────────────────────────────────────────────
@@ -115,11 +115,14 @@ export const SETTINGS = [
115
115
  {
116
116
  key: 'agentAutoVerify',
117
117
  label: 'Agent Auto-Verify',
118
- getValue: () => config.get('agentAutoVerify') !== false,
118
+ getValue: () => config.get('agentAutoVerify'),
119
119
  type: 'select',
120
120
  options: [
121
- { value: true, label: 'On' },
122
- { value: false, label: 'Off' },
121
+ { value: 'off', label: 'Off' },
122
+ { value: 'build', label: 'Build only' },
123
+ { value: 'typecheck', label: 'Typecheck only' },
124
+ { value: 'test', label: 'Test only' },
125
+ { value: 'all', label: 'Build + Typecheck + Test' },
123
126
  ],
124
127
  },
125
128
  {
@@ -25,7 +25,7 @@ export interface AgentOptions {
25
25
  onTaskUpdate?: (task: SubTask) => void;
26
26
  abortSignal?: AbortSignal;
27
27
  dryRun?: boolean;
28
- autoVerify?: boolean;
28
+ autoVerify?: 'off' | 'build' | 'typecheck' | 'test' | 'all' | boolean;
29
29
  maxFixAttempts?: number;
30
30
  usePlanning?: boolean;
31
31
  chatHistory?: Array<{
@@ -474,9 +474,11 @@ export async function runAgent(prompt, projectContext, options = {}) {
474
474
  return result;
475
475
  }
476
476
  // Self-verification: Run build/test and fix errors if needed
477
- const autoVerify = opts.autoVerify ?? config.get('agentAutoVerify');
477
+ const autoVerifyRaw = opts.autoVerify ?? config.get('agentAutoVerify');
478
+ // Support legacy boolean values: true -> 'all', false -> 'off'
479
+ const autoVerify = autoVerifyRaw === true ? 'all' : autoVerifyRaw === false ? 'off' : autoVerifyRaw;
478
480
  const maxFixAttempts = opts.maxFixAttempts ?? config.get('agentMaxFixAttempts');
479
- if (autoVerify && !opts.dryRun) {
481
+ if (autoVerify !== 'off' && !opts.dryRun) {
480
482
  // Check if we made any file changes worth verifying
481
483
  const hasFileChanges = actions.some(a => a.type === 'write' || a.type === 'edit' || a.type === 'delete');
482
484
  if (hasFileChanges) {
@@ -488,15 +490,30 @@ export async function runAgent(prompt, projectContext, options = {}) {
488
490
  break;
489
491
  }
490
492
  opts.onIteration?.(iteration, `Verification attempt ${fixAttempt + 1}/${maxFixAttempts}`);
491
- // Run verifications
493
+ // Run verifications based on selected mode
492
494
  const verifyResults = await runAllVerifications(projectContext.root || process.cwd(), {
493
- runBuild: true,
494
- runTest: true,
495
- runTypecheck: true,
495
+ runBuild: autoVerify === 'all' || autoVerify === 'build',
496
+ runTest: autoVerify === 'all' || autoVerify === 'test',
497
+ runTypecheck: autoVerify === 'all' || autoVerify === 'typecheck',
496
498
  runLint: false,
497
499
  });
498
500
  opts.onVerification?.(verifyResults);
499
- // Check if all passed
501
+ // Filter errors: only keep those related to files the agent touched
502
+ const touchedFiles = new Set(actions
503
+ .filter(a => a.type === 'write' || a.type === 'edit')
504
+ .map(a => a.target));
505
+ for (const vr of verifyResults) {
506
+ vr.errors = vr.errors.filter(e => {
507
+ if (!e.file)
508
+ return true; // Keep errors without file info (build failures etc)
509
+ return touchedFiles.has(e.file) || [...touchedFiles].some(f => e.file.endsWith(f) || f.endsWith(e.file));
510
+ });
511
+ // Update success based on remaining errors
512
+ if (vr.errors.filter(e => e.severity === 'error').length === 0) {
513
+ vr.success = true;
514
+ }
515
+ }
516
+ // Check if all passed (after filtering)
500
517
  if (!hasVerificationErrors(verifyResults)) {
501
518
  const summary = getVerificationSummary(verifyResults);
502
519
  finalResponse += `\n\n✓ Verification passed: ${summary.passed}/${summary.total} checks`;
@@ -134,14 +134,15 @@ async function runVerifyCommand(type, command, args, projectRoot, timeout) {
134
134
  const output = result.stdout + '\n' + result.stderr;
135
135
  // Parse errors from output
136
136
  const errors = parseErrors(output, type);
137
- // If command failed but no errors were parsed, surface the failure reason explicitly
137
+ // If command failed but no errors were parsed, surface the failure reason as warning
138
+ // (not error — could be pre-existing build issue unrelated to agent's changes)
138
139
  if (!result.success && errors.length === 0) {
139
140
  const reason = result.stderr?.includes('timed out')
140
- ? `Command timed out after ${Math.round(duration / 1000)}s. This build tool may be too slow for verification. Consider adding a faster typecheck script to package.json.`
141
+ ? `Command timed out after ${Math.round(duration / 1000)}s. This build tool may be too slow for verification.`
141
142
  : result.stderr?.includes('not in the allowed list') || result.stderr?.includes('not allowed')
142
143
  ? `Command '${command}' is not allowed. Check shell.ts ALLOWED_COMMANDS.`
143
144
  : result.stderr?.trim() || result.stdout?.trim() || 'Command failed with no output';
144
- errors.push({ severity: 'error', message: reason });
145
+ errors.push({ severity: 'warning', message: reason });
145
146
  }
146
147
  return {
147
148
  success: result.success,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.70",
3
+ "version": "1.2.72",
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",