2182
2183
async syncClientCustomizations(session: URI, clientId: string, customizations: ClientPluginCustomization[], options?: { readonly quiet?: boolean }): Promise<ISyncedCustomization[]> {
2185
>
const sess = this._findAnySession(sessionId);
2186
>
if (!sess) {
2187
this._logService.warn(`[Claude:${sessionId}] syncClientCustomizations: session not found`);
2188
return [];
2189
}
2190
>
// Run inside the session sequencer so that a fire-and-forget
claudeAgent.ts
2191
>
// customization sync cannot race ahead of a first `sendMessage`: if
2192
>
// `sendMessage` is already queued, the sync runs first or queues
2193
>
// behind it; either way the materialize call reads the most recently
2194
>
// adopted plugin set, never an empty one mid-sync.
2195
>
return this._sessionSequencer.queue(sessionId, async () => {
2196
>
const synced = await this._pluginManager.syncCustomizations(
2197
>
clientId,
2198
>
customizations,
2199
>
options?.quiet ? undefined : status => this._fireCustomizationUpdated(session, { customization: status }),
2200
>
);
2201
>
sess.adoptClientCustomizations(clientId, synced);
2202
>
return synced;
2203
>
});
2204
>
}
2205
2206
/**