Change:
Testing Choosing Never failed: <img width="458" alt="image" src="https://user-"
Choosing Always also failed: <img width="453" alt="image" src="https://user-"
I was using a public repo:
I experience the same on Windows 11 with the repo:
Create New Codespace still fails with ContinueOn
The original issue reported here was due to the fact that we weren't properly awaiting the branch publish before invoking the codespace creation. based on our offline discussion I think you're encountering a different issue because the publish completes but the codespace creation doesn't start, and only if you aren't signed into the GitHub Codespaces extension, so I'm going to close this issue and we can file a new one to investigate the scenario you've uncovered since I can't reproduce it at the moment:

Discussion:
"default": "prompt", "markdownDescription": "%config.openRepositoryInParentFolders%", "scope": "resource" <del> }, "git.publishBeforeContinueOn": { "type": "string", "enum": [ "prompt", "always", "never" ], "markdownEnumDescriptions": [ "%config.publishBeforeContinueOn.prompt%", "%config.publishBeforeContinueOn.always%", "%config.publishBeforeContinueOn.never%" ], "default": "prompt", "markdownDescription": "%config.publishBeforeContinueOn%", "scope": "resource", "tags": [ "experimental" ] </del> } } },

this.providerRegistration = vscode.workspace.registerEditSessionIdentityProvider('file', this); vscode.workspace.onWillCreateEditSessionIdentity((e) => { <del> const publishBeforeContinueOn = vscode.workspace.getConfiguration('git').get<'never' | 'always' | 'prompt'>('publishBeforeContinueOn', 'prompt'); if (publishBeforeContinueOn !== 'never') { e.waitUntil(this._onWillCreateEditSessionIdentity(e.workspaceFolder, e.token, publishBeforeContinueOn)); } </del> <ins> e.waitUntil(this._onWillCreateEditSessionIdentity(e.workspaceFolder)); </ins> }); }

} } <del> private async _onWillCreateEditSessionIdentity(workspaceFolder: vscode.WorkspaceFolder, cancellationToken: vscode.CancellationToken, publishBeforeContinueOn: 'always' | 'prompt'): Promise<void> { const cancellationPromise = createCancellationPromise(cancellationToken); await Promise.race([this._doPublish(workspaceFolder, publishBeforeContinueOn), cancellationPromise]); </del> <ins> private async _onWillCreateEditSessionIdentity(workspaceFolder: vscode.WorkspaceFolder): Promise<void> { await this._doPublish(workspaceFolder); </ins> } <del> private async _doPublish(workspaceFolder: vscode.WorkspaceFolder, publishBeforeContinueOn: 'always' | 'prompt') { </del> <ins> private async _doPublish(workspaceFolder: vscode.WorkspaceFolder) { </ins> await this.model.openRepository(path.dirname(workspaceFolder.uri.fsPath)); const repository = this.model.getRepository(workspaceFolder.uri);

// ensure that it is published before Continue On is invoked if (!repository.HEAD?.upstream && repository.HEAD?.type === RefType.Head) { <del> if (publishBeforeContinueOn === 'prompt') { const always = vscode.l10n.t('Always'); const never = vscode.l10n.t('Never'); const selection = await vscode.window.showInformationMessage( vscode.l10n.t('The current branch is not published to the remote. Would you like to publish it to access your changes elsewhere?'), { modal: true }, ...[always, never] ); switch (selection) { case always: vscode.workspace.getConfiguration('git').update('publishBeforeContinueOn', 'always'); break; case never: vscode.workspace.getConfiguration('git').update('publishBeforeContinueOn', 'never'); default: return; } </del> <ins> const publishBranch = vscode.l10n.t('Publish Branch'); const selection = await vscode.window.showInformationMessage( vscode.l10n.t('The current branch is not published to the remote. Would you like to publish it to access your changes elsewhere?'), { modal: true }, publishBranch ); if (selection !== publishBranch) { throw new vscode.CancellationError(); </ins> } <del> await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: vscode.l10n.t('Publishing branch...') }, async () => { await vscode.commands.executeCommand('git.publish'); }); </del> <ins> await vscode.commands.executeCommand('git.publish'); </ins> } } }

sha }; } <del> function createCancellationPromise(cancellationToken: vscode.CancellationToken) { return new Promise((resolve, _) => { if (cancellationToken.isCancellationRequested) { resolve(undefined); } cancellationToken.onCancellationRequested(() => { resolve(undefined); }); }); } </del>

} async onWillCreateEditSessionIdentity(workspaceFolder: IWorkspaceFolder, cancellationToken: CancellationToken): Promise<void> { <ins> this._logService.debug('Running onWillCreateEditSessionIdentity participants...'); // TODO@joyceerhl show progress notification? </ins> for (const participant of this._participants) { await participant.participate(workspaceFolder, cancellationToken); } <ins> this._logService.debug(`Done running ${this._participants.length} onWillCreateEditSessionIdentity participants.`); </ins> } private _participants: IEditSessionIdentityCreateParticipant[] = [];