weacpx 0.6.1 → 0.7.1

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.
@@ -895,7 +895,13 @@ class AcpxQueueOwnerLauncher {
895
895
  const key = input.acpxRecordId;
896
896
  const previous = this.launchLocks.get(key) ?? Promise.resolve();
897
897
  const next = previous.then(() => this.doLaunch(input), () => this.doLaunch(input));
898
- this.launchLocks.set(key, next.catch(() => {}));
898
+ const tracked = next.catch(() => {});
899
+ this.launchLocks.set(key, tracked);
900
+ tracked.finally(() => {
901
+ if (this.launchLocks.get(key) === tracked) {
902
+ this.launchLocks.delete(key);
903
+ }
904
+ });
899
905
  return next;
900
906
  }
901
907
  async doLaunch(input) {
@@ -4,6 +4,8 @@ import type { OrchestrationTaskRecord } from "../orchestration/orchestration-typ
4
4
  import type { AppLogger } from "../logging/app-logger.js";
5
5
  import type { PendingFinalChunk } from "../weixin/messaging/quota-manager.js";
6
6
  import type { PerfTracer } from "../perf/perf-tracer.js";
7
+ import type { SessionService } from "../sessions/session-service.js";
8
+ import type { ActiveTurnRegistry } from "../sessions/active-turn-registry.js";
7
9
  export type { ChatAgent };
8
10
  export interface OutboundQuota {
9
11
  onInbound(chatKey: string): void;
@@ -51,6 +53,13 @@ export interface ChannelStartInput {
51
53
  quota: OutboundQuota;
52
54
  logger: AppLogger;
53
55
  perfTracer?: PerfTracer;
56
+ /**
57
+ * Logical session service. Session-aware channels read it for dispatch-time
58
+ * session binding (current alias) and to persist background turn results.
59
+ */
60
+ sessions?: SessionService;
61
+ /** Shared in-flight turn registry for dispatch-time foreground tracking. */
62
+ activeTurns?: ActiveTurnRegistry;
54
63
  /** weacpx 内置命令目录,供支持输入框命令提示的频道使用。 */
55
64
  commandHints?: CommandHint[];
56
65
  /** weacpx 核心版本字符串,供需要它的频道(如命令同步元数据)使用。 */