Skip to content

Commit 3eaa650

Browse files
authored
* fix microsoft#259057 * do not need trust options
1 parent fa3be54 commit 3eaa650

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatSessions.contribution.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CancellationToken } from '../../../../base/common/cancellation.js';
77
import { Codicon } from '../../../../base/common/codicons.js';
88
import { Emitter, Event } from '../../../../base/common/event.js';
99
import { Disposable, DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js';
10+
import { MarkdownString } from '../../../../base/common/htmlContent.js';
1011
import { localize } from '../../../../nls.js';
1112
import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
1213
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
@@ -26,6 +27,8 @@ import { ChatSession, IChatSessionContentProvider, IChatSessionItem, IChatSessio
2627
import { ChatSessionUri } from '../common/chatUri.js';
2728
import { ChatAgentLocation, ChatModeKind } from '../common/constants.js';
2829

30+
const CODING_AGENT_DOCS = 'https://code.visualstudio.com/docs/copilot/copilot-coding-agent';
31+
2932
const extensionPoint = ExtensionsRegistry.registerExtensionPoint<IChatSessionsExtensionPoint[]>({
3033
extensionPoint: 'chatSessions',
3134
jsonSchema: {
@@ -275,7 +278,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
275278
isDynamic: true,
276279
isCodingAgent: true, // TODO: Influences chat UI (eg: locks chat to participant, hides UX elements, etc...)
277280
slashCommands: [],
278-
locations: [ChatAgentLocation.Panel], // TODO: This doesn't appear to be respected
281+
locations: [ChatAgentLocation.Panel],
279282
modes: [ChatModeKind.Agent, ChatModeKind.Ask], // TODO: These are no longer respected
280283
disambiguation: [],
281284
metadata: {
@@ -482,6 +485,17 @@ class CodingAgentChatImplementation extends Disposable implements IChatAgentImpl
482485

483486
if (chatSession?.requestHandler) {
484487
await chatSession.requestHandler(request, progress, [], token);
488+
} else {
489+
// TODO(jospicer): Temporary while we work on API for dynamic agent to trigger a session
490+
const content = new MarkdownString(
491+
localize('chatSessionNotFound', "Use `#copilotCodingAgent` to begin a new [coding agent session]({0}).", CODING_AGENT_DOCS),
492+
);
493+
progress(
494+
[{
495+
kind: 'markdownContent',
496+
content,
497+
}]
498+
);
485499
}
486500

487501
return {};

0 commit comments

Comments
 (0)