Skip to content

Commit 8d6bfb8

Browse files
committed
chore(github-integration): allow null delegatedUser
Bump package version to 0.6.0-rc.2 and update GitHubInstallation type to allow delegatedUser to be null. Clarifies in the comment that delegatedUser is null immediately after installation (we only have installation_id) and is populated after the OAuth code exchange in the /oauth callback.
1 parent bf9b5a6 commit 8d6bfb8

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

build/src/base/workspace/GitHubIntegration.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ export interface GitHubInstallation {
6969
*/
7070
updatedAt: Date;
7171
/**
72-
* Delegate user for agent actions in Worker
72+
* Delegate user whose GitHub OAuth token is used by the Worker
73+
* for user-to-server actions (e.g. Copilot assignment).
74+
*
75+
* null right after installation is saved — at that point we only have
76+
* the installation_id from GitHub but haven't exchanged the OAuth code yet.
77+
* Gets populated in the same /oauth callback once the code exchange succeeds.
7378
*/
74-
delegatedUser: GitHubInstallationDelegatedUser;
79+
delegatedUser: GitHubInstallationDelegatedUser | null;
7580
}
7681
/**
7782
* GitHub integration data stored at workspace level

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hawk.so/types",
3-
"version": "0.6.0-rc.1",
3+
"version": "0.6.0-rc.2",
44
"description": "TypeScript definitions for Hawk",
55
"types": "build/index.d.ts",
66
"main": "build/index.js",

src/base/workspace/GitHubIntegration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ export interface GitHubInstallation {
8181
updatedAt: Date;
8282

8383
/**
84-
* Delegate user for agent actions in Worker
84+
* Delegate user whose GitHub OAuth token is used by the Worker
85+
* for user-to-server actions (e.g. Copilot assignment).
86+
*
87+
* null right after installation is saved — at that point we only have
88+
* the installation_id from GitHub but haven't exchanged the OAuth code yet.
89+
* Gets populated in the same /oauth callback once the code exchange succeeds.
8590
*/
86-
delegatedUser: GitHubInstallationDelegatedUser;
91+
delegatedUser: GitHubInstallationDelegatedUser | null;
8792
}
8893

8994
/**

0 commit comments

Comments
 (0)