@yemi33/minions 0.1.763 → 0.1.764

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/CHANGELOG.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.763 (2026-04-10)
3
+ ## 0.1.764 (2026-04-10)
4
4
 
5
5
  ### Features
6
6
  - pulsing blue dot on CC tabs with active requests
7
7
 
8
8
  ### Fixes
9
+ - prevent stale dispatched work items from showing agent as working indefinitely
9
10
  - only trigger verify when all PRD items succeed, not on partial failure
10
11
  - clean handoff between restore and original stream intervals
11
12
  - prevent competing thinking intervals on tab switch
package/engine/queries.js CHANGED
@@ -11,7 +11,7 @@ const shared = require('./shared');
11
11
 
12
12
  const { safeRead, safeReadDir, safeJson, safeWrite, getProjects,
13
13
  projectWorkItemsPath, projectPrPath, parseSkillFrontmatter, KB_CATEGORIES,
14
- WI_STATUS } = shared;
14
+ WI_STATUS, ENGINE_DEFAULTS } = shared;
15
15
 
16
16
  /**
17
17
  * Read the first `bytes` and last `bytes` of a file efficiently using byte offsets.
@@ -265,14 +265,21 @@ function getAgentStatus(agentId) {
265
265
 
266
266
  // Fallback: derive active state from work-item markers.
267
267
  // This protects UI status when dispatch.json briefly desyncs from work-item files.
268
+ // Guard: only trust dispatched state within 2x heartbeatTimeout to prevent stale
269
+ // dispatched items from permanently showing an agent as working after a dead process.
268
270
  try {
269
271
  const config = getConfig();
272
+ const heartbeatTimeout = config.engine?.heartbeatTimeout || ENGINE_DEFAULTS.heartbeatTimeout;
273
+ const staleThresholdMs = heartbeatTimeout * 2;
274
+ const now = Date.now();
270
275
  const allItems = getWorkItems(config);
271
276
  const latestInFlight = allItems
272
- .filter(w =>
273
- (w.dispatched_to || '').toLowerCase() === String(agentId).toLowerCase() &&
274
- w.status === WI_STATUS.DISPATCHED
275
- )
277
+ .filter(w => {
278
+ if ((w.dispatched_to || '').toLowerCase() !== String(agentId).toLowerCase()) return false;
279
+ if (w.status !== WI_STATUS.DISPATCHED) return false;
280
+ const ageMs = w.dispatched_at ? now - new Date(w.dispatched_at).getTime() : Infinity;
281
+ return ageMs < staleThresholdMs;
282
+ })
276
283
  .sort((a, b) => (b.dispatched_at || '').localeCompare(a.dispatched_at || ''))[0];
277
284
  if (latestInFlight) {
278
285
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.763",
3
+ "version": "0.1.764",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"