opencode-copilot-account-switcher 0.14.22 → 0.14.23
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WechatSlashCommand } from "./command-parser.js";
|
|
2
2
|
export declare const DEFAULT_HEARTBEAT_TIMEOUT_MS = 30000;
|
|
3
|
-
export declare const DEFAULT_STATUS_COLLECT_WINDOW_MS =
|
|
3
|
+
export declare const DEFAULT_STATUS_COLLECT_WINDOW_MS = 5000;
|
|
4
4
|
type AggregatedStatusInstance = {
|
|
5
5
|
instanceID: string;
|
|
6
6
|
status: "ok";
|
|
@@ -15,7 +15,7 @@ const FUTURE_MESSAGE_TYPES = new Set([
|
|
|
15
15
|
]);
|
|
16
16
|
export const DEFAULT_HEARTBEAT_TIMEOUT_MS = 30_000;
|
|
17
17
|
const DEFAULT_HEARTBEAT_SCAN_INTERVAL_MS = 1_000;
|
|
18
|
-
export const DEFAULT_STATUS_COLLECT_WINDOW_MS =
|
|
18
|
+
export const DEFAULT_STATUS_COLLECT_WINDOW_MS = 5_000;
|
|
19
19
|
function isNonEmptyString(value) {
|
|
20
20
|
return typeof value === "string" && value.trim().length > 0;
|
|
21
21
|
}
|
|
@@ -409,6 +409,7 @@ export async function startBrokerServer(endpoint) {
|
|
|
409
409
|
await prepareEndpoint(endpoint);
|
|
410
410
|
const heartbeatTimeoutMs = toPositiveNumber(process.env.WECHAT_BROKER_HEARTBEAT_TIMEOUT_MS, DEFAULT_HEARTBEAT_TIMEOUT_MS);
|
|
411
411
|
const heartbeatScanIntervalMs = toPositiveNumber(process.env.WECHAT_BROKER_HEARTBEAT_SCAN_INTERVAL_MS, DEFAULT_HEARTBEAT_SCAN_INTERVAL_MS);
|
|
412
|
+
const statusCollectWindowMs = toPositiveNumber(process.env.WECHAT_BROKER_STATUS_COLLECT_WINDOW_MS, DEFAULT_STATUS_COLLECT_WINDOW_MS);
|
|
412
413
|
const server = net.createServer((socket) => {
|
|
413
414
|
let buffer = "";
|
|
414
415
|
let messageChain = Promise.resolve();
|
|
@@ -487,7 +488,7 @@ export async function startBrokerServer(endpoint) {
|
|
|
487
488
|
return new Promise((resolve) => {
|
|
488
489
|
const timer = setTimeout(() => {
|
|
489
490
|
finalizePendingCollectStatus(requestId);
|
|
490
|
-
},
|
|
491
|
+
}, statusCollectWindowMs);
|
|
491
492
|
pendingCollectStatusByRequestId.set(requestId, {
|
|
492
493
|
requestedInstanceIDs,
|
|
493
494
|
snapshotsByInstanceID: new Map(),
|