fix(clownfish): repair validation for repair-94016-live-pr-inventory-… · openclaw/openclaw@31a0f97
openclaw-clo
·
2026-06-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -570,8 +570,6 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage
|
570 | 570 | return; |
571 | 571 | } |
572 | 572 | |
573 | | -let trackedPromise: Promise<unknown>; |
574 | | -const isCurrentTask = () => store.tasks.get(id) === trackedPromise; |
575 | 573 | scopedChannelRuntime = await measureStartup(`channels.${channelId}.runtime`, async () => |
576 | 574 | createTaskScopedChannelRuntime({ |
577 | 575 | channelRuntime: await getChannelRuntime(), |
@@ -648,7 +646,7 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage
|
648 | 646 | }); |
649 | 647 | // Recovery can replace a timed-out task before the old promise settles. |
650 | 648 | // Only the task that still owns the store slot may write lifecycle state. |
651 | | -trackedPromise = task |
| 649 | +const trackedPromise = task |
652 | 650 | .then(() => { |
653 | 651 | if (abort.signal.aborted || manuallyStopped.has(rKey) || !isCurrentTask()) { |
654 | 652 | return; |
@@ -768,6 +766,9 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage
|
768 | 766 | store.aborts.delete(id); |
769 | 767 | } |
770 | 768 | }); |
| 769 | +function isCurrentTask() { |
| 770 | +return store.tasks.get(id) === trackedPromise; |
| 771 | +} |
771 | 772 | handedOffTask = true; |
772 | 773 | store.tasks.set(id, trackedPromise); |
773 | 774 | } catch (error) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。