@clawtrial/courtroom 2.0.2 → 2.0.3
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/plugin.js +12 -4
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/plugin.js
CHANGED
|
@@ -30,7 +30,7 @@ const { logger, setLogDir } = require('./debug');
|
|
|
30
30
|
const DEFAULT_CONFIG = {
|
|
31
31
|
enabled: true,
|
|
32
32
|
detection: {
|
|
33
|
-
minMessages:
|
|
33
|
+
minMessages: 3,
|
|
34
34
|
cooldownMinutes: 30,
|
|
35
35
|
maxCasesPerDay: 3,
|
|
36
36
|
confidenceThreshold: 0.6
|
|
@@ -157,13 +157,21 @@ class CourtroomRuntime {
|
|
|
157
157
|
// Check if we should evaluate
|
|
158
158
|
const now = Date.now();
|
|
159
159
|
const cooldownMs = (this.config.get('detection.cooldownMinutes') || 30) * 60 * 1000;
|
|
160
|
-
const minMessages = this.config.get('detection.minMessages') ||
|
|
160
|
+
const minMessages = this.config.get('detection.minMessages') || 3;
|
|
161
161
|
const userMessages = this.messageBuffer.filter(m => m.role === 'user');
|
|
162
162
|
|
|
163
|
+
logger.info('PLUGIN', `Buffered ${userMessages.length}/${minMessages} user messages`);
|
|
164
|
+
|
|
163
165
|
if (userMessages.length < minMessages) return null;
|
|
164
|
-
if (now - this.lastEvaluation < cooldownMs)
|
|
166
|
+
if (now - this.lastEvaluation < cooldownMs) {
|
|
167
|
+
logger.info('PLUGIN', `Skipping evaluation (on cooldown)`);
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
165
170
|
if (this.pendingHearing) return null;
|
|
166
|
-
if (this._isDailyLimitReached())
|
|
171
|
+
if (this._isDailyLimitReached()) {
|
|
172
|
+
logger.info('PLUGIN', `Skipping evaluation (daily limit reached)`);
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
167
175
|
|
|
168
176
|
// Run detection
|
|
169
177
|
try {
|