789
return s;
790
}
792
>
// Batch the always-required keys (title / read / archive
793
>
// flags) with any keys the changeset coordinator asks for
794
>
// so the session DB is hit exactly once. The coordinator
795
>
// returns `undefined` when a live source can already
796
>
// answer the catalogue question, avoiding the
797
>
// potentially-large persisted blobs entirely.
798
>
const sessionStr = s.session.toString();
799
>
const changesetKeys = this._changesetCoordinator.getListMetadataKeys(sessionStr);
800
>
const metadataKeys: Record<string, true> = changesetKeys
801
>
? { customTitle: true, isRead: true, [AH_META_IS_ARCHIVED_DB_KEY]: true, [AH_META_IS_DONE_DB_KEY]: true, [AH_META_WORKSPACELESS_DB_KEY]: true, [PEER_CHAT_BACKING_METADATA_KEY]: true, [WORKTREE_META_REPOSITORY_ROOT]: true, ...GIT_DB_METADATA_KEYS, ...changesetKeys }
802
: { customTitle: true, isRead: true, [AH_META_IS_ARCHIVED_DB_KEY]: true, [AH_META_IS_DONE_DB_KEY]: true, [AH_META_WORKSPACELESS_DB_KEY]: true, [PEER_CHAT_BACKING_METADATA_KEY]: true, [WORKTREE_META_REPOSITORY_ROOT]: true, ...GIT_DB_METADATA_KEYS };
803
const m = await ref.object.getMetadataObject(metadataKeys);
804
>
// This session is an internal peer-chat backing (e.g. a
agentService.ts
805
>
// Claude peer chat's SDK session, enumerated by the agent's
806
>
// own `listSessions`). Drop it so it never leaks as a
807
>
// standalone top-level session — mirrors the subagent filter
808
>
// on the state-manager overlay path below.
809
>
if (m[PEER_CHAT_BACKING_METADATA_KEY]) {
810
return undefined;
811
}
813
>
if (m.customTitle) {
814
updated = { ...updated, summary: m.customTitle };
815
}
817
updated = { ...updated, isRead: m.isRead === 'true' };
818
}
820
updated = { ...updated, isArchived: m[AH_META_IS_ARCHIVED_DB_KEY] === 'true' };
821
>
} else if (m[AH_META_IS_DONE_DB_KEY] !== undefined) {
agentService.ts
822
updated = { ...updated, isArchived: m[AH_META_IS_DONE_DB_KEY] === 'true' };
823
}
825
try {
826
const gitState = JSON.parse(m[META_GIT_STATE]) as ISessionGitState;