Skip to content

Commit 4b2936f

Browse files
committed
Update default model ID in PR review workflow and enhance timeout error handling in run command
1 parent 05abeb5 commit 4b2936f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/pr-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
open_router_key: ${{ secrets.OPEN_ROUTER_KEY }} # Must be set in repository secrets
2222

2323
# Optional inputs with defaults
24-
model_id: "deepseek/deepseek-chat" # Default model
24+
model_id: "google/gemini-2.0-flash-thinking-exp:free" # Default model
2525
max_tokens: "4096" # Default max tokens
2626
review_label: "ai-review"
2727
custom_prompt: |

src/commands/run.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,24 @@ export class Run extends Command {
149149
if (options.timeout > 0) {
150150
const timeoutPromise = new Promise<never>((_, reject) => {
151151
setTimeout(() => {
152-
console.error(
153-
"\nOperation timed out in",
154-
options.timeout / 1000,
155-
"seconds",
152+
reject(
153+
new Error(
154+
`Operation timed out after ${options.timeout / 1000} seconds`,
155+
),
156156
);
157-
process.exit(0);
158157
}, options.timeout);
159158
});
160159

161-
await Promise.race([executePromise, timeoutPromise]);
160+
try {
161+
await Promise.race([executePromise, timeoutPromise]);
162+
} catch (error) {
163+
this.sessionManager.cleanup();
164+
if (error.message.includes("timed out")) {
165+
console.error("\n" + error.message);
166+
process.exit(1);
167+
}
168+
throw error;
169+
}
162170
} else {
163171
await executePromise;
164172
}

0 commit comments

Comments
 (0)