Commit 20e1dcb1bea0

Vincent Demeester <vincent@sbr.pm>
2026-02-13 23:01:54
fix(pi): fixed 3 unbound ctx bugs in github extension
Fixed getPRTitle missing ctx parameter, causing runtime crashes in handlePRReady and handlePRClose confirmation dialogs. Fixed handlePRReviewsList and handlePRReviewCommentsList using underscore-prefixed _ctx parameter while referencing unbound ctx in execGh calls.
1 parent 45ad2cb
Changed files (1)
dots
pi
agent
extensions
github
actions
dots/pi/agent/extensions/github/actions/pr.ts
@@ -603,7 +603,7 @@ export async function handlePRReady(
 
 	// APPROVAL GATE
 	if (ctx.hasUI) {
-		const title = await getPRTitle(pi, params.number, signal);
+		const title = await getPRTitle(pi, ctx, params.number, signal);
 		const description = title
 			? `"${truncate(title, 80)}"\n\nThis will mark the draft PR as ready for review.`
 			: "This will mark the draft PR as ready for review.";
@@ -658,7 +658,7 @@ export async function handlePRClose(
 
 	// APPROVAL GATE
 	if (ctx.hasUI) {
-		const title = await getPRTitle(pi, params.number, signal);
+		const title = await getPRTitle(pi, ctx, params.number, signal);
 		const description = title
 			? `"${truncate(title, 80)}"\n\nThis will close the pull request without merging.`
 			: "This will close the pull request without merging.";
@@ -696,6 +696,7 @@ export async function handlePRClose(
  */
 async function getPRTitle(
 	pi: ExtensionAPI,
+	ctx: ExtensionContext,
 	prNumber: number,
 	signal?: AbortSignal,
 ): Promise<string | null> {
@@ -994,7 +995,7 @@ export async function handlePRReviewsList(
 	params: any,
 	signal: AbortSignal | undefined,
 	onUpdate: any,
-	_ctx: ExtensionContext,
+	ctx: ExtensionContext,
 ): Promise<any> {
 	if (!params.number) {
 		return {
@@ -1138,7 +1139,7 @@ export async function handlePRReviewCommentsList(
 	params: any,
 	signal: AbortSignal | undefined,
 	onUpdate: any,
-	_ctx: ExtensionContext,
+	ctx: ExtensionContext,
 ): Promise<any> {
 	if (!params.number) {
 		return {