@lingyao037/openclaw-lingyao-cli 1.3.5 → 1.3.6

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/dist/index.js CHANGED
@@ -2261,8 +2261,30 @@ var MultiAccountOrchestrator = class {
2261
2261
  return;
2262
2262
  }
2263
2263
  this.runtime.logger.info(`Starting account "${accountId}"`);
2264
- const gatewayId = account.gatewayId ?? generateGatewayId(accountId);
2265
2264
  const storagePrefix = `lingyao:${accountId}`;
2265
+ const gatewayIdKey = `${storagePrefix}:persistedGatewayId`;
2266
+ let gatewayId = account.gatewayId;
2267
+ if (!gatewayId) {
2268
+ try {
2269
+ const stored = await this.runtime.storage.get(gatewayIdKey);
2270
+ if (stored && typeof stored === "string") {
2271
+ gatewayId = stored;
2272
+ this.runtime.logger.info(`Using persisted gatewayId: ${gatewayId}`);
2273
+ }
2274
+ } catch (e) {
2275
+ this.runtime.logger.warn(`Failed to read persisted gatewayId`, e);
2276
+ }
2277
+ }
2278
+ if (!gatewayId) {
2279
+ gatewayId = generateGatewayId(accountId);
2280
+ this.runtime.logger.info(`Generated new gatewayId: ${gatewayId}`);
2281
+ try {
2282
+ await this.runtime.storage.set(gatewayIdKey, gatewayId);
2283
+ this.runtime.logger.info(`Persisted gatewayId: ${gatewayId}`);
2284
+ } catch (e) {
2285
+ this.runtime.logger.warn(`Failed to persist gatewayId`, e);
2286
+ }
2287
+ }
2266
2288
  const accountManager = new AccountManager(this.runtime);
2267
2289
  const probe = new Probe(this.runtime);
2268
2290
  const monitor = new Monitor(this.runtime);