Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix o1系列模型超时时间改为4分钟, #5658

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id;

export const STORAGE_KEY = "chatgpt-next-web";

export const REQUEST_TIMEOUT_MS = 60000;
export const REQUEST_TIMEOUT_MS = 180000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Action Required: Review Global Impact of Timeout Change

The REQUEST_TIMEOUT_MS constant is used across multiple modules in the codebase. Changing it globally to 180000ms will affect all components that rely on this timeout value.

Recommendations:

  1. Assess Scope: Determine if the increased timeout should apply universally or only to specific models (e.g., o1 series).
  2. Refactor if Necessary:
    • If the timeout increase is intended only for certain models, consider creating model-specific timeout constants.
    • Example:
      export const DEFAULT_REQUEST_TIMEOUT_MS = 60000;
      export const O1_REQUEST_TIMEOUT_MS = 180000;
  3. Update Usages: Ensure that each usage of the timeout constant references the appropriate value based on the context.

Implementing these changes will help prevent unintended side effects and maintain optimal performance across different parts of the application.

🔗 Analysis chain

Approved: Timeout increased to 3 minutes as per PR objective.

The change from 60000ms to 180000ms (3 minutes) aligns with the PR objective to address timeout issues for o1 series models. This modification should help reduce the occurrence of response timeouts.

However, consider the following suggestions:

  1. Verify if this timeout should apply universally or if it should be model-specific.
  2. Add a comment explaining the rationale behind the 3-minute timeout, e.g.:
    // Increased to 3 minutes to accommodate longer response times of o1 series models
    export const REQUEST_TIMEOUT_MS = 180000;

To ensure this change doesn't affect other parts of the codebase unintentionally, please run the following command:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other usages of REQUEST_TIMEOUT_MS
rg "REQUEST_TIMEOUT_MS" --type typescript

Length of output: 76


Script:

#!/bin/bash
# Search for other usages of REQUEST_TIMEOUT_MS in TypeScript files
rg "REQUEST_TIMEOUT_MS" -g "*.ts" -g "*.tsx"

Length of output: 1469


export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";

Expand Down
Loading