@mobcode/openclaw-plugin 0.1.10 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobcode/openclaw-plugin",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "MobCode integration plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -114,6 +114,7 @@ export async function readSessionMessagesFromRuntime({ runtime, config, sessionK
114
114
  return [];
115
115
  }
116
116
  const candidates = resolveStoreCandidates(runtime, config, normalizedSessionKey);
117
+ const outcomes = [];
117
118
  logger?.info?.(
118
119
  `[mobcode-history] runtime reader start session=${normalizedSessionKey} storeCandidates=${candidates.map((candidate) => `${candidate.agentId}:${candidate.storePath}`).join(",") || "-"}`,
119
120
  );
@@ -124,6 +125,7 @@ export async function readSessionMessagesFromRuntime({ runtime, config, sessionK
124
125
  });
125
126
  const entry = store?.[normalizedSessionKey];
126
127
  if (!entry) {
128
+ outcomes.push(`missing_entry:${candidate.agentId}`);
127
129
  logger?.info?.(
128
130
  `[mobcode-history] runtime reader miss session=${normalizedSessionKey} agentId=${candidate.agentId} storePath=${candidate.storePath}`,
129
131
  );
@@ -131,6 +133,7 @@ export async function readSessionMessagesFromRuntime({ runtime, config, sessionK
131
133
  }
132
134
  const sessionId = trim(entry?.sessionId);
133
135
  if (!sessionId) {
136
+ outcomes.push(`missing_session_id:${candidate.agentId}`);
134
137
  logger?.warn?.(
135
138
  `[mobcode-history] runtime reader invalid_entry session=${normalizedSessionKey} agentId=${candidate.agentId} storePath=${candidate.storePath} reason=missing_session_id`,
136
139
  );
@@ -142,19 +145,30 @@ export async function readSessionMessagesFromRuntime({ runtime, config, sessionK
142
145
  sessionsDir: path.dirname(candidate.storePath),
143
146
  agentId: candidate.agentId,
144
147
  });
148
+ if (!trim(transcriptFile) || !fs.existsSync(transcriptFile)) {
149
+ outcomes.push(`missing_transcript_file:${candidate.agentId}`);
150
+ logger?.warn?.(
151
+ `[mobcode-history] runtime reader missing_transcript session=${normalizedSessionKey} agentId=${candidate.agentId} storePath=${candidate.storePath} transcriptFile=${transcriptFile || "-"}`,
152
+ );
153
+ continue;
154
+ }
145
155
  const messages = readTranscriptMessages(transcriptFile);
156
+ if (messages.length <= 0) {
157
+ outcomes.push(`empty_transcript:${candidate.agentId}`);
158
+ }
146
159
  logger?.info?.(
147
160
  `[mobcode-history] runtime reader hit session=${normalizedSessionKey} agentId=${candidate.agentId} storePath=${candidate.storePath} transcriptFile=${transcriptFile} messages=${messages.length}`,
148
161
  );
149
162
  return messages;
150
163
  } catch (error) {
164
+ outcomes.push(`error:${candidate.agentId}`);
151
165
  logger?.warn?.(
152
166
  `[mobcode-history] runtime reader error session=${normalizedSessionKey} agentId=${candidate.agentId} storePath=${candidate.storePath}: ${error instanceof Error ? error.message : String(error)}`,
153
167
  );
154
168
  }
155
169
  }
156
170
  logger?.warn?.(
157
- `[mobcode-history] runtime reader unresolved session=${normalizedSessionKey}`,
171
+ `[mobcode-history] runtime reader unresolved session=${normalizedSessionKey} outcomes=${outcomes.join(",") || "-"}`,
158
172
  );
159
173
  return [];
160
174
  }