ofiere-openclaw-plugin 4.48.0 → 4.49.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.ts +30 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.48.0",
3
+ "version": "4.49.0",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM - 16 meta-tools covering tasks, agents, projects, scheduling, knowledge, workflows, notifications, memory, prompts, constellation, space file management, execution plan builder, SOP management, agent brain, talent management, and corporate frameworks",
6
6
  "keywords": ["openclaw", "ofiere", "project-management", "agents", "plugin"],
package/src/tools.ts CHANGED
@@ -6562,10 +6562,20 @@ function registerBrainExtractionHook(
6562
6562
  ): void {
6563
6563
  try {
6564
6564
  api.on("agent_end", async (event: any, ctx: any) => {
6565
+ // Cycle 7b BUGSHOOT-4 — entry log is load-bearing: 4 prior cycles spent
6566
+ // chasing downstream symptoms because no log existed to prove the hook
6567
+ // even fired. If you're debugging staff-dispatch persistence and DO NOT
6568
+ // see this line in the gateway log, the hook never ran — investigate
6569
+ // hook registration / agent scoping before anything else.
6570
+ const _entrySessionKey = ctx?.sessionKey || event?.sessionKey || event?.context?.sessionKey || "(none)";
6571
+ api.logger.info?.(`[ofiere-brain] agent_end fired (sessionKey=${_entrySessionKey})`);
6565
6572
  try {
6566
6573
  // Extract messages from event — agent_end provides the conversation
6567
6574
  const messages: any[] = event?.messages || event?.context?.messages || [];
6568
- if (!messages || messages.length < 2) return;
6575
+ if (!messages || messages.length < 2) {
6576
+ api.logger.debug?.(`[ofiere-brain] agent_end early-exit: messages.length=${messages?.length ?? 0} (<2)`);
6577
+ return;
6578
+ }
6569
6579
 
6570
6580
  // Find last user + last assistant message
6571
6581
  let lastUser = "";
@@ -6589,8 +6599,15 @@ function registerBrainExtractionHook(
6589
6599
  if (lastUser && lastAssistant) break;
6590
6600
  }
6591
6601
 
6592
- // Skip trivial exchanges
6593
- if (lastUser.length < 20 || lastAssistant.length < 30) return;
6602
+ // Cycle 7b BUGSHOOT-4 — REMOVED early-return on short messages here.
6603
+ // The prior gate (`if lastUser<20 || lastAssistant<30 return`) sat
6604
+ // BEFORE the staff_report / task_dispatch_log / conversation_messages
6605
+ // writes, which silently killed every staff dispatch whose output was
6606
+ // shorter than 30 chars (e.g. smoke tests outputting "SMOKE-OK" = 8).
6607
+ // The trivial-skip is now applied just before the brain L1/L2/L3/L4
6608
+ // extraction below — those are noise filters, not bookkeeping.
6609
+ // Bookkeeping (dispatch_log completion, conversation messages,
6610
+ // staff_report) MUST run regardless of message length.
6594
6611
 
6595
6612
  // ── Agent identity resolution (FIX) ──────────────────────────
6596
6613
  // Priority: ctx.agentId (from PluginHookAgentContext, the CORRECT source)
@@ -6776,6 +6793,16 @@ function registerBrainExtractionHook(
6776
6793
  }
6777
6794
  }
6778
6795
 
6796
+ // Cycle 7b BUGSHOOT-4 — trivial-skip moved here from line ~6593.
6797
+ // Brain L1/L2/L3/L4 extraction skips trivial chit-chat to reduce
6798
+ // memory noise. This MUST sit AFTER staff_report + task_dispatch_log
6799
+ // bookkeeping above, otherwise short-output staff dispatches silently
6800
+ // fail to persist (root cause of cycles 7b BUGSHOOT 1-4).
6801
+ if (lastUser.length < 20 || lastAssistant.length < 30) {
6802
+ api.logger.debug?.(`[ofiere-brain] skip brain extraction (trivial: user=${lastUser.length}c assistant=${lastAssistant.length}c)`);
6803
+ return;
6804
+ }
6805
+
6779
6806
  // ── Fast Stream: Write L1_focus + L2_episode in parallel ──
6780
6807
  const rawContent = `User: ${lastUser}\nAssistant: ${lastAssistant}`;
6781
6808
  const immediateWrites: PromiseLike<any>[] = [];