dsh-session-matrix 0.17.1 → 0.17.2

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/README.md CHANGED
@@ -161,7 +161,7 @@ DSH 每次压缩都会在会话里留下一个检查点(`compact-checkpoint`
161
161
  | V4.1 Flash `deepseek-flash`(旧名 `deepseek-v4-flash`) | 0.02 | 1 | 4 |
162
162
  | V4 Pro `deepseek-v4-pro` | 0.15 | 4.5 | 13.5 |
163
163
 
164
- 峰时(北京时间工作日 09:00–12:00、14:00–18:00,节假日除外)**×2**。
164
+ 峰时(北京时间工作日 09:00–12:00、14:00–18:00)**×2**。法定节假日暂未建模,仍按工作日峰时计——见下方 Requirements 说明。
165
165
  `contextTimeline.cost` 已按峰谷分桶,直接分桶计算,不做时间推断。
166
166
  非 `deepseek` provider 回退 models.dev 美元价,按 `1 CNY = 0.15 USD` 折算。
167
167
 
package/lib/client.js CHANGED
@@ -2046,8 +2046,12 @@ window.__ModuleLoader__.load({
2046
2046
  const EMPTY_PANES = [null, null, null, null]
2047
2047
 
2048
2048
  function WorkspaceView({
2049
- sessions, projects, filter, setFilter, panes, setPanes, onOpenNative, railW, onRailW, kit, th, flashId,
2049
+ sessions, allSessions, projects, filter, setFilter, panes, setPanes, onOpenNative, railW, onRailW, kit, th, flashId,
2050
2050
  }) {
2051
+ // Pane pruning must judge against EVERY live session, not the filtered
2052
+ // view: pruning on the filtered list would close a pane whenever its
2053
+ // session merely fell outside the current search/scope.
2054
+ const knownSessions = allSessions ?? sessions
2051
2055
  const openIds = new Set(panes.filter(Boolean))
2052
2056
  const full = panes.length >= MAX_PANES
2053
2057
 
@@ -2169,13 +2173,13 @@ window.__ModuleLoader__.load({
2169
2173
  // forever. Clear those ids once the list has loaded; never prune while
2170
2174
  // the list is empty (that is a failed poll, not an empty workspace).
2171
2175
  React.useEffect(() => {
2172
- if (!sessions.length) return
2173
- const known = new Set(sessions.map(s => s.id))
2176
+ if (!knownSessions.length) return
2177
+ const known = new Set(knownSessions.map(s => s.id))
2174
2178
  setPanes(prev => {
2175
2179
  const next = prev.map(v => (v && !known.has(v) ? null : v))
2176
2180
  return next.some((v, i) => v !== prev[i]) ? next : prev
2177
2181
  })
2178
- }, [sessions, setPanes])
2182
+ }, [knownSessions, setPanes])
2179
2183
  const expanded = React.useMemo(() => new Set(expandedIds), [expandedIds])
2180
2184
  // A subagent opened in a pane must be visible even while collapsed.
2181
2185
  const forced = new Set()
@@ -3263,6 +3267,7 @@ window.__ModuleLoader__.load({
3263
3267
  ? h(WorkspaceView, {
3264
3268
  key: 'ws',
3265
3269
  sessions: filtered,
3270
+ allSessions,
3266
3271
  projects,
3267
3272
  filter,
3268
3273
  setFilter,
package/lib/index.js CHANGED
@@ -282,8 +282,10 @@ export function riskLevel(ratio, point, cfg, stats) {
282
282
  if (firstApproach) level = 'warn'
283
283
  else if (typeof count === 'number' && count >= 3 && level === 'warn') level = 'crit'
284
284
 
285
- const fresh = stats?.lastCompactionAt != null
286
- && Date.now() - stats.lastCompactionAt < COMPACTION_FRESH_MS
285
+ // A timestamp in the future (clock skew between machines) must not keep the
286
+ // freshness exemption alive until the clock catches up.
287
+ const sinceLast = stats?.lastCompactionAt != null ? Date.now() - stats.lastCompactionAt : null
288
+ const fresh = sinceLast != null && sinceLast >= 0 && sinceLast < COMPACTION_FRESH_MS
287
289
  if (fresh) level = level === 'crit' ? 'warn' : level === 'warn' ? 'ok' : level
288
290
  return level
289
291
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-matrix",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "A multi-agent workspace for DeepSeek Harness: run parallel sessions, visualize agent relationships, monitor context usage, and manage task handoffs.",
5
5
  "keywords": [
6
6
  "deepseek-harness",