@threadcrumbs/common 0.1.7 → 0.1.9

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.
@@ -192,13 +192,14 @@ export function claudeCode({
192
192
  const sub = path.join(subagentDir(file, id), `agent-${agentId}.jsonl`)
193
193
  const stat = await fsp.stat(sub).catch(() => null)
194
194
  if (!stat) return null
195
- const state = await subagentDetails.read(sub, stat, { sidechain: true })
195
+ const [state, limits] = await Promise.all([subagentDetails.read(sub, stat, { sidechain: true }), contextLimits()])
196
196
  return {
197
197
  id: `claude-code:${id}`,
198
198
  sessionId: id,
199
199
  agentId,
200
200
  source: sub,
201
201
  ...transcriptDetail(state),
202
+ contextLimit: contextLimit(limits, state.model) || null,
202
203
  contextBreakdown: null,
203
204
  subagents: null,
204
205
  }
@@ -342,6 +343,8 @@ function statusOf({ running, state, calls, subagents, awaiting, lastAt, mark, un
342
343
  return ['asking', asked.some((c) => c.questions) ? 'question' : asked.length ? 'approval' : 'waiting']
343
344
  }
344
345
  const busy = running.status ? running.status === 'busy' : midTurn
346
+ const handedBack = Boolean(state.ending?.handedBack)
347
+ if (busy && handedBack && (subagents || awaiting.length)) return ['delegating', subagents ? 'subagents' : 'awaiting']
345
348
  if (busy) return onlyAgents ? ['delegating', 'subagents'] : ['working', running.status ? 'process-busy' : 'turn-open']
346
349
  if (subagents || awaiting.length) return ['delegating', subagents ? 'subagents' : 'awaiting']
347
350
  if (blocked) return ['asking', 'marked-blocked']
@@ -380,7 +383,7 @@ function toSession({ id, state, stat, running, subagents, workingSubagents, awai
380
383
  return {
381
384
  id: `claude-code:${id}`,
382
385
  harness: 'claude-code',
383
- title: state.customTitle || state.aiTitle || running?.name || state.summary || promptTitle || 'Untitled session',
386
+ title: titleFromPrompt(state.customTitle || state.aiTitle || running?.name || state.summary || promptTitle) || 'Untitled session',
384
387
  project,
385
388
  projectPath,
386
389
  worktree,