1125
return { kind: 'rejected', reason: 'Empty message' };
1126
}
1128
>
let newSessionResource: URI | undefined;
1129
>
1130
>
// A late send may arrive on a stale untitled resource after it already
1131
>
// materialized into a real session but before the UI swapped to the real
1132
>
// resource. Re-target to the real resource so we don't materialize a
1133
>
// second session, and report it as a new session so the caller swaps its
1134
>
// UI from the untitled resource to the real one (mirroring the first send).
1135
>
const materializedReal = this.chatSessionService.getMaterializedSessionResource(sessionResource);
1136
>
if (materializedReal) {
1137
sessionResource = materializedReal;
1138
newSessionResource = materializedReal;
1139
}
1141
>
let model = this._sessionModels.get(sessionResource);
1142
>
if (!model) {
1143
throw new Error(`Unknown session: ${sessionResource}`);
1144
}
1146
return {
1147
kind: 'rejected',