feat(FN-978): add diagnostic logging, semaphore resilience, and executor tests
- Add structured diagnostic logging to executor, stuck-task-detector, and pi.ts with subsystem prefixes - Add defensive guards to AgentSemaphore (limit minimum 1, invalid limit handling) - Add comprehensive integration tests for agent execution flow (executor.test.ts) - Add unit tests for semaphore resilience (concurrency.test.ts) and stuck-task-detector (stuck-task-detector.test.ts) - Fix TypeScript errors in test task objects and duplicate execution test - Document engine diagnostic logging points in AGENTS.md
This commit is contained in:
@@ -137,6 +137,7 @@ export class StuckTaskDetector {
|
||||
lastProgressAt: now,
|
||||
activitySinceProgress: 0,
|
||||
});
|
||||
stuckLog.log(`Tracking task ${taskId} (total tracked: ${this.tracked.size})`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +158,9 @@ export class StuckTaskDetector {
|
||||
if (entry) {
|
||||
entry.lastActivity = Date.now();
|
||||
entry.activitySinceProgress++;
|
||||
if (entry.activitySinceProgress <= 3 || entry.activitySinceProgress % 50 === 0) {
|
||||
stuckLog.log(`Activity recorded for ${taskId} (sinceProgress=${entry.activitySinceProgress})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user