Skip to content

Commit fe4cb80

Browse files
committed
Don't try to show enterprise avatars
1 parent 0d70e35 commit fe4cb80

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

src/@types/vscode.proposed.chatParticipantPrivate.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ declare module 'vscode' {
248248
toolResultMessage?: string | MarkdownString;
249249
toolResultDetails?: Array<Uri | Location>;
250250
toolMetadata?: unknown;
251+
/** Whether there was an error calling the tool. The tool may still have partially succeeded. */
252+
hasError?: boolean;
251253
}
252254

253255
// #region Chat participant detection

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ declare module 'vscode' {
152152

153153
/**
154154
* Options configured for this session as key-value pairs.
155-
* Keys correspond to option group IDs (e.g., 'models', 'subagents')
156-
* and values are the selected option item IDs.
155+
* Keys correspond to option group IDs (e.g., 'models', 'subagents').
156+
* Values can be either:
157+
* - A string (the option item ID) for backwards compatibility
158+
* - A ChatSessionProviderOptionItem object to include metadata like locked state
157159
* TODO: Strongly type the keys
158160
*/
159-
readonly options?: Record<string, string>;
161+
readonly options?: Record<string, string | ChatSessionProviderOptionItem>;
160162

161163
/**
162164
* Callback invoked by the editor for a currently running response. This allows the session to push items for the
@@ -245,10 +247,6 @@ declare module 'vscode' {
245247

246248
export interface ChatContext {
247249
readonly chatSessionContext?: ChatSessionContext;
248-
readonly chatSummary?: {
249-
readonly prompt?: string;
250-
readonly history?: string;
251-
};
252250
}
253251

254252
export interface ChatSessionContext {
@@ -276,6 +274,13 @@ declare module 'vscode' {
276274
* Human-readable name displayed in the UI.
277275
*/
278276
readonly name: string;
277+
278+
/**
279+
* When true, this option is locked and cannot be changed by the user.
280+
* The option will still be visible in the UI but will be disabled.
281+
* Use this when an option is set but cannot be hot-swapped (e.g., model already initialized).
282+
*/
283+
readonly locked?: boolean;
279284
}
280285

281286
/**

src/common/uri.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,11 @@ export namespace DataUri {
324324
if (!response.ok) {
325325
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
326326
}
327-
const buffer = await response.arrayBuffer();
328-
await writeAvatarToCache(context, user, new Uint8Array(buffer));
329-
innerImageContents = Buffer.from(buffer);
327+
if (response.headers.get('content-type')?.startsWith('image/')) {
328+
const buffer = await response.arrayBuffer();
329+
await writeAvatarToCache(context, user, new Uint8Array(buffer));
330+
innerImageContents = Buffer.from(buffer);
331+
}
330332
};
331333
try {
332334
await doFetch();

src/github/copilotRemoteAgent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ export class CopilotRemoteAgentManager extends Disposable {
163163
/* Generate new coding agent session from an 'untitled' session */
164164
const number = await startSession(
165165
'untitledChatSession',
166-
context.chatSummary?.prompt ?? request.prompt,
167-
context.chatSummary?.history,
166+
request.prompt,
167+
undefined,
168168
request.references
169169
);
170170
if (!number) {
@@ -239,8 +239,8 @@ export class CopilotRemoteAgentManager extends Disposable {
239239
{
240240
step: 'create',
241241
metadata: {
242-
prompt: context.chatSummary?.prompt ?? request.prompt,
243-
history: context.chatSummary?.history,
242+
prompt: request.prompt,
243+
history: undefined,
244244
references: request.references,
245245
}
246246
},

webviews/components/user.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IAccount, IActor, ITeam, reviewerLabel } from '../../src/github/interfa
99

1010
const InnerAvatar = ({ for: author }: { for: Partial<IAccount> }) => (
1111
<>
12-
{author.avatarUrl ? (
12+
{author.avatarUrl && author.avatarUrl.includes('githubusercontent.com') ? (
1313
<img className="avatar" src={author.avatarUrl} alt="" role="presentation" aria-hidden="true"/>
1414
) : (
1515
<Icon className="avatar-icon" src={require('../../resources/icons/dark/github.svg')} />

0 commit comments

Comments
 (0)