Skip to content

Commit d15a48e

Browse files
Copilotjoshspicer
andcommitted
Update async branch naming to follow copilot/vscode<TIMESTAMP> spec
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
1 parent 3b19c4f commit d15a48e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/github/copilotRemoteAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export class CopilotRemoteAgentManager extends Disposable {
212212
if (!this.autoCommitAndPushEnabled()) {
213213
return { error: vscode.l10n.t('Uncommitted changes detected. Please commit or stash your changes before starting the remote agent. Enable \'{0}\' to push your changes automatically.', CODING_AGENT_AUTO_COMMIT_AND_PUSH), state: 'error' };
214214
}
215-
const asyncBranch = `continue-from-${Date.now()}`;
215+
const asyncBranch = `copilot/vscode${Date.now()}`;
216216
try {
217217
await repository.createBranch(asyncBranch, true);
218218
await repository.add([]);

src/test/github/copilotApi.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ describe('CopilotApi Tests', function () {
2626
title: 'Test title',
2727
body_placeholder: 'Test body',
2828
base_ref: 'main',
29-
head_ref: 'continue-from-1234567890'
29+
head_ref: 'copilot/vscode1234567890'
3030
}
3131
};
3232

33-
assert.strictEqual(payloadWithHeadRef.pull_request?.head_ref, 'continue-from-1234567890');
33+
assert.strictEqual(payloadWithHeadRef.pull_request?.head_ref, 'copilot/vscode1234567890');
3434
assert.strictEqual(payloadWithHeadRef.pull_request?.base_ref, 'main');
3535
});
3636

3737
it('should support conditional head_ref property using spread operator', () => {
3838
const hasChanges = true;
3939
const autoPushAndCommit = true;
4040
const baseRef = 'main';
41-
const ref = 'continue-from-1234567890';
41+
const ref = 'copilot/vscode1234567890';
4242

4343
// Simulate the logic from copilotRemoteAgent.ts
4444
const payload: RemoteAgentJobPayload = {
@@ -47,12 +47,12 @@ describe('CopilotApi Tests', function () {
4747
title: 'Test title',
4848
body_placeholder: 'Test body',
4949
base_ref: hasChanges && autoPushAndCommit ? baseRef : ref,
50-
...(hasChanges && autoPushAndCommit && { head_ref: ref })
50+
...(hasChanges && autoPushAndCommit ? { head_ref: ref } : {})
5151
}
5252
};
5353

5454
assert.strictEqual(payload.pull_request?.base_ref, 'main');
55-
assert.strictEqual(payload.pull_request?.head_ref, 'continue-from-1234567890');
55+
assert.strictEqual(payload.pull_request?.head_ref, 'copilot/vscode1234567890');
5656
});
5757

5858
it('should not include head_ref when not pushing', () => {
@@ -68,7 +68,7 @@ describe('CopilotApi Tests', function () {
6868
title: 'Test title',
6969
body_placeholder: 'Test body',
7070
base_ref: hasChanges && autoPushAndCommit ? baseRef : ref,
71-
...(hasChanges && autoPushAndCommit && { head_ref: ref })
71+
...(hasChanges && autoPushAndCommit ? { head_ref: ref } : {})
7272
}
7373
};
7474

0 commit comments

Comments
 (0)