Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): sandbox legacy 'unknown' + guard rehab/skip-status loops

Adam Eivyba63d522e53e
diff --git a/server/services/taskLearning/routing.js b/server/services/taskLearning/routing.js
index f68c3c3ddf..e1084f6c21 100644
--- a/server/services/taskLearning/routing.js
+++ b/server/services/taskLearning/routing.js
@@ -438,6 +438,8 @@ export async function checkAndRehabilitateSkippedTasks(gracePeriodMs = 7 * 24 *
const now = Date.now();
for (const [taskType, metrics] of Object.entries(data.byTaskType)) {
+ // Sandboxed fallback is never skipped, so never rehabilitated either (#2333).
+ if (isSandboxedTaskType(taskType)) continue;
// Only consider task types that would be skipped (< 30% success with 5+ attempts)
if (metrics.completed < 5 || metrics.successRate >= 30) {
continue;
@@ -491,6 +493,8 @@ export async function getSkippedTaskTypesWithStatus(gracePeriodMs = 7 * 24 * 60
const now = Date.now();
for (const [taskType, metrics] of Object.entries(data.byTaskType)) {
+ // Sandboxed fallback is never skipped (#2333) — exclude from the skip status list.
+ if (isSandboxedTaskType(taskType)) continue;
// Only include task types that would be skipped
if (metrics.completed < 5 || metrics.successRate >= 30) {
continue;
diff --git a/server/services/taskLearning/store.js b/server/services/taskLearning/store.js
index f4642789bf..91f65e1aa0 100644
--- a/server/services/taskLearning/store.js
+++ b/server/services/taskLearning/store.js
@@ -137,7 +137,11 @@ export async function saveLearningData(data) {
*/
export const EXTERNAL_UNTYPED_TASK_TYPE = 'external/untyped';
-const SANDBOXED_TASK_TYPES = new Set([EXTERNAL_UNTYPED_TASK_TYPE]);
+// The new sandboxed fallback plus the legacy `'unknown'` sink it replaces. Older
+// installs (and the not-yet-migrated spawn-time key in agentModelSelection.js)
+// still produce `'unknown'` buckets, so it gets the same wall: stale/heterogeneous
+// uncategorized data must never drive a tier suggestion or globally skip work.
+const SANDBOXED_TASK_TYPES = new Set([EXTERNAL_UNTYPED_TASK_TYPE, 'unknown']);
/**
* True when a task type is a sandboxed fallback bucket (not a real learned
diff --git a/server/services/taskLearning/store.test.js b/server/services/taskLearning/store.test.js
index a1cfc87363..6c8af34087 100644
--- a/server/services/taskLearning/store.test.js
+++ b/server/services/taskLearning/store.test.js
@@ -145,10 +145,12 @@ describe('store.classifyUntypedTask (issue #2333)', () => {
}
});
- it('only marks the fallback bucket as sandboxed', () => {
+ it('marks the fallback bucket and the legacy unknown sink as sandboxed', () => {
expect(isSandboxedTaskType(EXTERNAL_UNTYPED_TASK_TYPE)).toBe(true);
+ // legacy 'unknown' buckets (older installs / not-yet-migrated spawn key) get
+ // the same routing wall so stale uncategorized data can't drive routing
+ expect(isSandboxedTaskType('unknown')).toBe(true);
expect(isSandboxedTaskType('auto-fix')).toBe(false);
- expect(isSandboxedTaskType('unknown')).toBe(false);
});
});