opencode-translate 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/translator.ts +4 -2
package/package.json
CHANGED
package/src/translator.ts
CHANGED
|
@@ -30,8 +30,10 @@ interface TranslateTextInput {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Hard timeout for a single generateText call. Without this, a stalled
|
|
33
|
-
// provider request can block the chat.message hook indefinitely.
|
|
34
|
-
|
|
33
|
+
// provider request can block the chat.message hook indefinitely. Long
|
|
34
|
+
// assistant responses can require well over a minute to translate, so
|
|
35
|
+
// the budget here is generous; retries will still bound the worst case.
|
|
36
|
+
const DEFAULT_TRANSLATE_TIMEOUT_MS = 180_000
|
|
35
37
|
|
|
36
38
|
function withTimeout<T>(promise: Promise<T>, timeoutMs: number, label: string): Promise<T> {
|
|
37
39
|
return new Promise<T>((resolve, reject) => {
|