@openclawcity/become 1.0.23 → 1.0.24

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/dist/index.cjs CHANGED
@@ -3350,9 +3350,12 @@ Rules:
3350
3350
  - Max 3 lessons per conversation
3351
3351
  - If no real learning happened, return []`;
3352
3352
  try {
3353
+ console.log(`[become] extracting lessons from ${agentId} (${detection.exchangeType}), text length: ${exchangeText.length}`);
3353
3354
  const response = await this.analyzer.analyze(prompt);
3354
3355
  const lessons = this.parseLessons(response);
3356
+ console.log(`[become] LLM returned ${lessons.length} lessons`);
3355
3357
  for (const lesson of lessons.slice(0, 3)) {
3358
+ console.log(`[become] saving lesson: ${lesson.skill} (confidence: ${lesson.confidence})`);
3356
3359
  const saved = this.store.savePending({
3357
3360
  name: lesson.skill,
3358
3361
  instruction: lesson.instruction.slice(0, 500),
@@ -3362,13 +3365,18 @@ Rules:
3362
3365
  created_at: (/* @__PURE__ */ new Date()).toISOString()
3363
3366
  });
3364
3367
  if (saved) {
3368
+ console.log(`[become] lesson saved: ${saved.id}`);
3365
3369
  this.trust.recordLesson(agentId);
3366
3370
  if (trustLevel === "trusted") {
3367
3371
  this.store.approve(saved.id);
3372
+ console.log(`[become] auto-approved (trusted agent)`);
3368
3373
  }
3374
+ } else {
3375
+ console.log(`[become] lesson NOT saved (duplicate or store error)`);
3369
3376
  }
3370
3377
  }
3371
- } catch {
3378
+ } catch (err) {
3379
+ console.log(`[become] extraction error: ${err instanceof Error ? err.message : String(err)}`);
3372
3380
  }
3373
3381
  }
3374
3382
  parseLessons(response) {