Skip to content

Commit 811d290

Browse files
authored
Support additional properties for custom org/enterprise agents (#2530)
* add properties * update test
1 parent c27493d commit 811d290

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/extension/agents/vscode-node/organizationAndEnterpriseAgentProvider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,12 @@ export class OrganizationAndEnterpriseAgentProvider extends Disposable implement
389389
if (agent.target) {
390390
frontmatterObj.target = agent.target;
391391
}
392+
if (agent.model) {
393+
frontmatterObj.model = agent.model;
394+
}
395+
if (agent.infer) {
396+
frontmatterObj.infer = agent.infer;
397+
}
392398

393399
const frontmatter = YAML.stringify(frontmatterObj, { lineWidth: 0 }).trim();
394400
const body = agent.prompt ?? '';

src/extension/agents/vscode-node/test/organizationAndEnterpriseAgentProvider.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ Test prompt content`;
225225
const mockDetails: CustomAgentDetails = {
226226
...mockAgent,
227227
prompt: 'Detailed prompt content',
228+
model: 'gpt-4',
229+
infer: true,
228230
};
229231
mockOctoKitService.setAgentDetails('full_agent', mockDetails);
230232

@@ -246,6 +248,8 @@ tools:
246248
- tool2
247249
argument-hint: Provide context
248250
target: vscode
251+
model: gpt-4
252+
infer: true
249253
---
250254
Detailed prompt content
251255
`;
@@ -650,6 +654,8 @@ Agent 1 prompt`;
650654
assert.ok(!content.includes('tools:'));
651655
assert.ok(!content.includes('argument-hint:'));
652656
assert.ok(!content.includes('target:'));
657+
assert.ok(!content.includes('model:'));
658+
assert.ok(!content.includes('infer:'));
653659
});
654660

655661
test('excludes tools field when array contains only wildcard', async () => {

src/platform/github/common/githubService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export interface CustomAgentListItem {
134134
metadata?: Record<string, string>;
135135
target?: string;
136136
config_error?: string;
137+
model?: string;
138+
infer?: boolean;
137139
'mcp-servers'?: {
138140
[serverName: string]: {
139141
type: string;

0 commit comments

Comments
 (0)