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

feat(cos): add peak productivity insight to ActionableInsights banner

[._.]/ Adam Eivyd6d80a4590ef
diff --git a/.changelog/v0.20.x.md b/.changelog/v0.20.x.md
index 8278fffafe..04d35d9993 100644
--- a/.changelog/v0.20.x.md
+++ b/.changelog/v0.20.x.md
@@ -19,6 +19,12 @@ Productivity insights, worktree control for task creation.
- Requires 3+ hours of historical data with 3+ tasks each before activating
- Hover tooltip shows current success rate or next peak time for quick context
+### Peak productivity insight in ActionableInsights
+- **Proactive productivity suggestion** surfaces in the ActionableInsights banner when the current hour is a peak productivity window and there are pending tasks
+- Uses the same hourly success rate analysis as QuickSummary's optimal time indicator
+- Shows current hour's success rate and encourages tackling tasks during high-performance windows
+- Helps users take advantage of their historically most productive times
+
### Enhanced decision log transparency
- **Capacity details** now shown when agent slots are full — displays current/max agent count and per-project limits
- **Cooldown context** surfaces the app name and cooldown window duration so users can see why a task was deferred
diff --git a/client/src/components/cos/ActionableInsightsBanner.jsx b/client/src/components/cos/ActionableInsightsBanner.jsx
index 960bddc000..e22b25417d 100644
--- a/client/src/components/cos/ActionableInsightsBanner.jsx
+++ b/client/src/components/cos/ActionableInsightsBanner.jsx
@@ -19,7 +19,8 @@ const ICON_MAP = {
XCircle,
Brain,
Newspaper,
- ListTodo
+ ListTodo,
+ Zap
};
const PRIORITY_STYLES = {
diff --git a/server/routes/cos.js b/server/routes/cos.js
index 376a25ab18..9af0833580 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -935,11 +935,12 @@ router.get('/productivity/calendar', asyncHandler(async (req, res) => {
// GET /api/cos/actionable-insights - Get prioritized action items requiring user attention
// Surfaces the most important things to address right now across all CoS subsystems
router.get('/actionable-insights', asyncHandler(async (req, res) => {
- const [tasksData, learningSummary, healthCheck, notificationsModule] = await Promise.all([
+ const [tasksData, learningSummary, healthCheck, notificationsModule, optimalTimeInfo] = await Promise.all([
cos.getAllTasks().catch(err => { console.error(`❌ Failed to load tasks: ${err.message}`); return { user: null, cos: null }; }),
taskLearning.getLearningInsights().catch(err => { console.error(`❌ Failed to load learning insights: ${err.message}`); return null; }),
cos.runHealthCheck().catch(err => { console.error(`❌ Failed to run health check: ${err.message}`); return { issues: [] }; }),
- import('../services/notifications.js')
+ import('../services/notifications.js'),
+ productivity.getOptimalTimeInfo().catch(() => ({ hasData: false }))
]);
const notificationsData = await notificationsModule.getNotifications({ unreadOnly: true, limit: 10 }).catch(() => []);
@@ -1034,6 +1035,20 @@ router.get('/actionable-insights', asyncHandler(async (req, res) => {
});
}
+ // 7. Peak productivity time (proactive suggestion)
+ // Show when it's a peak hour AND there are pending tasks to work on
+ const totalPendingTasks = pendingUserTasks.length + (tasksData.cos?.grouped?.pending?.length || 0);
+ if (optimalTimeInfo?.hasData && optimalTimeInfo.isOptimal && totalPendingTasks > 0 && insights.length < 5) {
+ insights.push({
+ type: 'peak-time',
+ priority: 'low',
+ icon: 'Zap',
+ title: 'Peak productivity hour',
+ description: `This hour has a ${optimalTimeInfo.currentSuccessRate || optimalTimeInfo.peakSuccessRate}% success rate — good time to tackle tasks`,
+ action: { label: 'Start Task', route: '/cos/tasks' }
+ });
+ }
+
// Sort by priority
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3, info: 4 };
insights.sort((a, b) => (priorityOrder[a.priority] || 5) - (priorityOrder[b.priority] || 5));