1883
throw new Error(`Cannot subscribe to unknown resource: ${resourceStr}`);
1884
}
1886
>
// Ensure git state has been computed for this session. When the snapshot
1887
>
// already existed (e.g. seeded by list query, or restored earlier), the
1888
>
// restore path that normally calls `_attachGitState` is skipped — so
1889
>
// trigger it lazily here for the first subscriber. `_attachGitState`
1890
>
// is async and updates `_meta.git` once ready, which clients see via
1891
>
// the normal state-update stream.
1892
>
const sessionState = this._stateManager.getSessionState(resourceStr);
1893
if (!isAhpChatChannel(resourceStr) && sessionState && readSessionGitState(sessionState._meta) === undefined) {
1894
const workingDirectory = sessionState.workingDirectories?.[0]