Provides resumable-task state for task tool calls so orchestrator users can
resume work in a parent session by using short aliases (exp-1, ora-2) instead
of raw child session IDs.
createTaskSessionManagerHook(ctx, options) returns handlers for:
tool.execute.beforetool.execute.afterexperimental.chat.system.transformeventSessionManager from src/utils/session-manager.ts to store
remembered task sessions with bounded per-agent history.description/prompt via
deriveTaskSessionLabel and converted to compact aliases by SessionManager.callID in a capped ordered map (MAX_PENDING_TASK_CALLS)
to rewrite inputs and correlate outputs safely.shouldManageSession(sessionID), allowing
the hook to run only for orchestrator-managed sessions.tool.execute.before receives a task call.subagent_type is a recognized agent, it derives a short label.task_id is provided, it attempts resolution against remembered aliases
for the current parent session/agent.args.task_id is rewritten to the real task ID; on miss it is
removed to force fresh task creation.tool.execute.after reads the output task ID from task output text.remember()s the task entry and associates it
with the alias map.[ERROR] Session not found/Session no
session, the predecessor alias is dropped so future commands fall back to
fresh execution.experimental.chat.system.transform injects a rendered block from
SessionManager.formatForPrompt under ### Resumable Sessions.session.deleted, the hook clears all task state for that parent session
and removes any pending task call records for that parent.src/index.ts:
tool.execute.beforetool.execute.afterexperimental.chat.system.transformevent on session.deletedSessionManager.SessionManager and deriveTaskSessionLabel (from src/utils/session-manager.ts)parseTaskIdFromTaskOutput (from src/utils/task.ts)maxSessionsPerAgent) and runtime session filtering from
src/index.ts (shouldManageSession).