groove-dev 0.27.134 → 0.27.136
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/moe-training/client/domain-tagger.js +1 -1
- package/moe-training/scripts/retag-delegate-yield.js +303 -0
- package/moe-training/test/shared/envelope-schema.test.js +3 -3
- package/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/daemon/src/adaptive.js +77 -0
- package/node_modules/@groove-dev/daemon/src/api.js +35 -5
- package/node_modules/@groove-dev/daemon/src/journalist.js +28 -12
- package/node_modules/@groove-dev/daemon/src/model-lab.js +53 -76
- package/node_modules/@groove-dev/daemon/src/process.js +91 -2
- package/node_modules/@groove-dev/daemon/src/rotator.js +45 -3
- package/node_modules/@groove-dev/gui/dist/assets/{index-Dozp69tK.js → index-BrZHF7pK.js} +1770 -1766
- package/node_modules/@groove-dev/gui/dist/assets/index-DIfiwdKl.css +1 -0
- package/node_modules/@groove-dev/gui/dist/index.html +2 -2
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/node_modules/@groove-dev/gui/src/components/agents/agent-chat.jsx +60 -18
- package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +42 -20
- package/node_modules/@groove-dev/gui/src/components/agents/agent-file-tree.jsx +1 -1
- package/node_modules/@groove-dev/gui/src/components/agents/workspace-mode.jsx +1 -1
- package/node_modules/@groove-dev/gui/src/components/chat/chat-messages.jsx +2 -22
- package/node_modules/@groove-dev/gui/src/components/editor/code-editor.jsx +9 -9
- package/node_modules/@groove-dev/gui/src/components/editor/file-tree.jsx +1 -1
- package/node_modules/@groove-dev/gui/src/components/editor/terminal.jsx +7 -0
- package/node_modules/@groove-dev/gui/src/components/lab/chat-playground.jsx +59 -51
- package/node_modules/@groove-dev/gui/src/components/lab/lab-assistant.jsx +48 -48
- package/node_modules/@groove-dev/gui/src/components/lab/metrics-panel.jsx +39 -38
- package/node_modules/@groove-dev/gui/src/components/lab/parameter-panel.jsx +4 -5
- package/node_modules/@groove-dev/gui/src/components/lab/preset-manager.jsx +11 -11
- package/node_modules/@groove-dev/gui/src/components/lab/runtime-config.jsx +66 -62
- package/node_modules/@groove-dev/gui/src/components/lab/system-prompt-editor.jsx +13 -13
- package/node_modules/@groove-dev/gui/src/components/layout/breadcrumb-bar.jsx +1 -1
- package/node_modules/@groove-dev/gui/src/components/preview/preview-workspace.jsx +62 -22
- package/node_modules/@groove-dev/gui/src/components/ui/slider.jsx +16 -17
- package/node_modules/@groove-dev/gui/src/components/ui/table-tree.jsx +38 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +23 -9
- package/node_modules/@groove-dev/gui/src/views/editor.jsx +1 -1
- package/node_modules/@groove-dev/gui/src/views/model-lab.jsx +101 -87
- package/node_modules/moe-training/client/domain-tagger.js +1 -1
- package/node_modules/moe-training/scripts/retag-delegate-yield.js +303 -0
- package/node_modules/moe-training/test/shared/envelope-schema.test.js +3 -3
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/daemon/src/adaptive.js +77 -0
- package/packages/daemon/src/api.js +35 -5
- package/packages/daemon/src/journalist.js +28 -12
- package/packages/daemon/src/model-lab.js +53 -76
- package/packages/daemon/src/process.js +91 -2
- package/packages/daemon/src/rotator.js +45 -3
- package/packages/gui/dist/assets/{index-Dozp69tK.js → index-BrZHF7pK.js} +1770 -1766
- package/packages/gui/dist/assets/index-DIfiwdKl.css +1 -0
- package/packages/gui/dist/index.html +2 -2
- package/packages/gui/package.json +1 -1
- package/packages/gui/src/components/agents/agent-chat.jsx +60 -18
- package/packages/gui/src/components/agents/agent-feed.jsx +42 -20
- package/packages/gui/src/components/agents/agent-file-tree.jsx +1 -1
- package/packages/gui/src/components/agents/workspace-mode.jsx +1 -1
- package/packages/gui/src/components/chat/chat-messages.jsx +2 -22
- package/packages/gui/src/components/editor/code-editor.jsx +9 -9
- package/packages/gui/src/components/editor/file-tree.jsx +1 -1
- package/packages/gui/src/components/editor/terminal.jsx +7 -0
- package/packages/gui/src/components/lab/chat-playground.jsx +59 -51
- package/packages/gui/src/components/lab/lab-assistant.jsx +48 -48
- package/packages/gui/src/components/lab/metrics-panel.jsx +39 -38
- package/packages/gui/src/components/lab/parameter-panel.jsx +4 -5
- package/packages/gui/src/components/lab/preset-manager.jsx +11 -11
- package/packages/gui/src/components/lab/runtime-config.jsx +66 -62
- package/packages/gui/src/components/lab/system-prompt-editor.jsx +13 -13
- package/packages/gui/src/components/layout/breadcrumb-bar.jsx +1 -1
- package/packages/gui/src/components/preview/preview-workspace.jsx +62 -22
- package/packages/gui/src/components/ui/slider.jsx +16 -17
- package/packages/gui/src/components/ui/table-tree.jsx +38 -0
- package/packages/gui/src/stores/groove.js +23 -9
- package/packages/gui/src/views/editor.jsx +1 -1
- package/packages/gui/src/views/model-lab.jsx +101 -87
- package/plan_files/DELEGATE_YIELD_TRAINING_TAGS.md +135 -0
- package/plan_files/session-quality-rotation-fixes.md +218 -0
- package/test.py +571 -0
- package/node_modules/@groove-dev/gui/dist/assets/index-BgQL4bNl.css +0 -1
- package/packages/gui/dist/assets/index-BgQL4bNl.css +0 -1
- /package/{AGENT_ORCHESTRATION.md → plan_files/AGENT_ORCHESTRATION.md} +0 -0
- /package/{DYNAMIC_LEAF_ARCH.md → plan_files/DYNAMIC_LEAF_ARCH.md} +0 -0
- /package/{EMBEDDING_DIAGNOSTIC.md → plan_files/EMBEDDING_DIAGNOSTIC.md} +0 -0
- /package/{EMBEDDING_SERVICE_BUILD_PLAN.md → plan_files/EMBEDDING_SERVICE_BUILD_PLAN.md} +0 -0
- /package/{MOE_TRAINING_PIPELINE.md → plan_files/MOE_TRAINING_PIPELINE.md} +0 -0
|
@@ -34,6 +34,7 @@ export class Rotator extends EventEmitter {
|
|
|
34
34
|
this.rotating = new Set();
|
|
35
35
|
this.lastRotationTime = new Map(); // agentId -> timestamp of last rotation
|
|
36
36
|
this._lastContextState = new Map(); // agentId -> { contextUsage, timestamp }
|
|
37
|
+
this.compactionCounts = new Map(); // agentId -> number of natural compactions
|
|
37
38
|
this.enabled = false;
|
|
38
39
|
this.liveScores = {};
|
|
39
40
|
this.scoreHistory = {};
|
|
@@ -148,6 +149,9 @@ export class Rotator extends EventEmitter {
|
|
|
148
149
|
|
|
149
150
|
if (ageSec > 1800) score -= 5;
|
|
150
151
|
if (ageSec > 3600) score -= 10;
|
|
152
|
+
if (ageSec > 7200) score -= 15;
|
|
153
|
+
if (ageSec > 14400) score -= 20;
|
|
154
|
+
if (ageSec > 28800) score -= 25;
|
|
151
155
|
|
|
152
156
|
score = Math.max(0, Math.min(100, score));
|
|
153
157
|
|
|
@@ -236,13 +240,34 @@ export class Rotator extends EventEmitter {
|
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
242
|
|
|
243
|
+
// --- Change 4: Truncation-triggered immediate rotation (all providers) ---
|
|
244
|
+
if (agent.consecutiveTruncations >= 2) {
|
|
245
|
+
console.log(` Rotator: ${agent.name} consecutiveTruncations=${agent.consecutiveTruncations} — FORCE rotating (incomplete_response)`);
|
|
246
|
+
await this.rotate(agent.id, { reason: 'incomplete_response', qualityScore: 0 });
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// --- Change 3: Compaction-aware rotation for self-managing providers ---
|
|
251
|
+
const compactions = this.compactionCounts.get(agent.id) || 0;
|
|
252
|
+
if (compactions >= 5) {
|
|
253
|
+
console.log(` Rotator: ${agent.name} compactions=${compactions} — FORCE rotating (compaction_ceiling)`);
|
|
254
|
+
await this.rotate(agent.id, { reason: 'compaction_ceiling' });
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
|
|
239
258
|
// Quality rotation uses a shorter cooldown (2 min vs 5 min) so degraded
|
|
240
259
|
// agents don't persist producing bad output for 8-10 minutes
|
|
241
260
|
if (this._isOnCooldown(agent.id, QUALITY_COOLDOWN_MS)) continue;
|
|
242
261
|
|
|
262
|
+
// Effective quality threshold: lower for agents showing degradation signals
|
|
263
|
+
let effectiveQualityThreshold = QUALITY_THRESHOLD;
|
|
264
|
+
if (compactions >= 3 || agent.truncationSuspected || agent.cacheResetDetected) {
|
|
265
|
+
effectiveQualityThreshold = 55;
|
|
266
|
+
}
|
|
267
|
+
|
|
243
268
|
// All providers: quality-based rotation — detects degradation before tokens are wasted
|
|
244
269
|
const quality = this.scoreLiveSession(agent);
|
|
245
|
-
if (quality.hasEnoughData && quality.score <
|
|
270
|
+
if (quality.hasEnoughData && quality.score < effectiveQualityThreshold) {
|
|
246
271
|
// Severe degradation (score < 25): rotate immediately regardless of idle state.
|
|
247
272
|
// The agent is producing bad output — waiting for idle is counterproductive.
|
|
248
273
|
if (quality.score < 25) {
|
|
@@ -293,6 +318,7 @@ export class Rotator extends EventEmitter {
|
|
|
293
318
|
this.daemon.classifier.clearAgent(agentId);
|
|
294
319
|
delete this.liveScores[agentId];
|
|
295
320
|
delete this.scoreHistory[agentId];
|
|
321
|
+
this.compactionCounts.delete(agentId);
|
|
296
322
|
|
|
297
323
|
let brief = await journalist.generateHandoffBrief(agent, {
|
|
298
324
|
reason: options.reason,
|
|
@@ -317,7 +343,7 @@ export class Rotator extends EventEmitter {
|
|
|
317
343
|
reason: options.reason || 'manual',
|
|
318
344
|
oldTokens: agent.tokensUsed,
|
|
319
345
|
contextUsage: agent.contextUsage,
|
|
320
|
-
brief: brief.slice(0,
|
|
346
|
+
brief: brief.slice(0, 6000),
|
|
321
347
|
}, agent.workingDir, agent.teamId);
|
|
322
348
|
}
|
|
323
349
|
|
|
@@ -482,6 +508,22 @@ export class Rotator extends EventEmitter {
|
|
|
482
508
|
}
|
|
483
509
|
|
|
484
510
|
recordNaturalCompaction(agent, peakUsage, currentUsage) {
|
|
511
|
+
// Guard: require valid agent data to prevent duplicate ghost entries
|
|
512
|
+
if (!agent?.id || !agent?.name || !agent?.provider) return;
|
|
513
|
+
|
|
514
|
+
// Dedup: skip if we already recorded a compaction for this agent within 30s
|
|
515
|
+
const now = Date.now();
|
|
516
|
+
const recent = this.rotationHistory.filter(
|
|
517
|
+
(r) => r.reason === 'natural_compaction' && r.agentId === agent.id
|
|
518
|
+
);
|
|
519
|
+
if (recent.length > 0) {
|
|
520
|
+
const lastTs = new Date(recent[recent.length - 1].timestamp).getTime();
|
|
521
|
+
if (now - lastTs < 30_000) return;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Track compaction count for compaction-ceiling rotation
|
|
525
|
+
this.compactionCounts.set(agent.id, (this.compactionCounts.get(agent.id) || 0) + 1);
|
|
526
|
+
|
|
485
527
|
const record = {
|
|
486
528
|
agentId: agent.id,
|
|
487
529
|
agentName: agent.name,
|
|
@@ -492,7 +534,7 @@ export class Rotator extends EventEmitter {
|
|
|
492
534
|
contextAfter: currentUsage,
|
|
493
535
|
reason: 'natural_compaction',
|
|
494
536
|
qualityScore: null,
|
|
495
|
-
timestamp: new Date().toISOString(),
|
|
537
|
+
timestamp: new Date(now).toISOString(),
|
|
496
538
|
newAgentId: agent.id,
|
|
497
539
|
newTokens: agent.tokensUsed || 0,
|
|
498
540
|
};
|