File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
src/vs/workbench/contrib/chat/common/promptSyntax Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -612,21 +612,18 @@ export class BasePromptParser<TContentsProvider extends IPromptContentsProvider>
612
612
* Valid metadata records defined in the prompt header.
613
613
*/
614
614
public get metadata ( ) : TMetadata | null {
615
- if ( this . header === undefined ) {
616
- const { promptType } = this . promptContentsProvider ;
617
-
618
- if ( promptType === 'non-prompt' ) {
619
- return null ;
620
- }
615
+ const { promptType } = this . promptContentsProvider ;
616
+ if ( promptType === 'non-prompt' ) {
617
+ return null ;
618
+ }
621
619
622
- return {
623
- promptType,
624
- } ;
620
+ if ( this . header === undefined ) {
621
+ return { promptType } ;
625
622
}
626
623
627
624
if ( this . header instanceof InstructionsHeader ) {
628
625
return {
629
- promptType : PromptsType . instructions ,
626
+ promptType,
630
627
...this . header . metadata ,
631
628
} ;
632
629
}
@@ -654,7 +651,7 @@ export class BasePromptParser<TContentsProvider extends IPromptContentsProvider>
654
651
}
655
652
656
653
return {
657
- promptType : PromptsType . prompt ,
654
+ promptType,
658
655
...result ,
659
656
} ;
660
657
}
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ export class PromptsService extends Disposable implements IPromptsService {
208
208
await parser . settled ( ) ;
209
209
210
210
const { metadata } = parser ;
211
- const tools = ( metadata ?. promptType === PromptsType . mode )
211
+ const tools = ( metadata && ( 'tools' in metadata ) )
212
212
? metadata . tools
213
213
: undefined ;
214
214
You can’t perform that action at this time.
0 commit comments