Skip to content

Function: registerCompressLineageResolver()

Makaio Framework


Makaio Framework / services-core / registerCompressLineageResolver

Function: registerCompressLineageResolver()

Section titled “Function: registerCompressLineageResolver()”

registerCompressLineageResolver(bus): () => void

Defined in: ../../../packages/services/core/src/session/adapter-sessions/compress-lineage-resolver.ts:264

Re-parents post-compaction subagents from the parent session to the compress child.

Handles two scenarios triggered by adapter.session.linked:

Path A — compress child linked first (batch import): When a compress child is linked, subagents spawned after compaction are already parented to the parent Makaio session (by the parent-resolver). This path scans the compress child’s messages and re-parents matching subagents.

Path B — subagent linked after compress child (incremental / separate files): When a subagent is linked and its parent has compress children, the compress children and their messages already exist. This path scans those compress children for the subagent’s spawning tool_call and re-parents when found.

Must be registered BEFORE registerSpawningToolCallResolver so it runs first on adapter.session.linked (bus handlers fire in registration order).

IMakaioBus

The bus instance to register handlers on

Cleanup function to unsubscribe the handler

() => void

import { registerCompressLineageResolver } from '@makaio/services-core/session';
const cleanup = registerCompressLineageResolver(bus);
// Later, when shutting down:
cleanup();