117
);
118
}
120
>
const workingDirectory = URI.parse(workingDirectoryStr);
121
>
const gitState = readSessionGitState(sessionState._meta);
122
const branchName = gitState?.branchName ?? await this._gitService.getCurrentBranch(workingDirectory);
123
if (!branchName) {
124
throw new ProtocolError(JsonRpcErrorCodes.InternalError, `Could not determine current branch for ${workingDirectory}`);
125
}
127
const baseBranchName = gitState?.baseBranchName ?? (await this._gitService.getDefaultBranch(workingDirectory))?.name;
128
if (!baseBranchName) {
129
throw new ProtocolError(JsonRpcErrorCodes.InternalError, `Could not determine base branch for ${workingDirectory}`);
130
}
132
>
133
>
const repoResource = this._gitHubEndpointService.getRepoResource();
134
>
const authToken = this._agentService.getAuthToken({
135
>
resource: repoResource.resource,
136
>
scopes: repoResource.scopes_supported,
137
>
});
138
>
if (!authToken) {
139
throw new ProtocolError(
140
AHP_AUTH_REQUIRED,