fix(gateway): resume channel after pending task recovery · openclaw/openclaw@ecd29fe
openclaw-clo
·
2026-06-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -145,12 +145,20 @@ export function startChannelHealthMonitor(deps: ChannelHealthMonitorDeps): Chann
|
145 | 145 | restartsThisHour: [], |
146 | 146 | }; |
147 | 147 | |
148 | | -if (now - record.lastRestartAt <= cooldownMs) { |
| 148 | +const continuingPendingRestart = |
| 149 | +status.running !== true && |
| 150 | +status.restartPending === true && |
| 151 | +(status.reconnectAttempts ?? 0) === 0; |
| 152 | + |
| 153 | +// A timed-out recovery stop uses the first start request to mark |
| 154 | +// restartPending; the next monitor pass must finish that same recovery |
| 155 | +// instead of waiting behind this monitor's fresh-restart cooldown. |
| 156 | +if (!continuingPendingRestart && now - record.lastRestartAt <= cooldownMs) { |
149 | 157 | continue; |
150 | 158 | } |
151 | 159 | |
152 | 160 | pruneOldRestarts(record, now); |
153 | | -if (record.restartsThisHour.length >= maxRestartsPerHour) { |
| 161 | +if (!continuingPendingRestart && record.restartsThisHour.length >= maxRestartsPerHour) { |
154 | 162 | log.warn?.( |
155 | 163 | `[${channelId}:${accountId}] health-monitor: hit ${maxRestartsPerHour} restarts/hour limit, skipping`, |
156 | 164 | ); |
@@ -161,9 +169,11 @@ export function startChannelHealthMonitor(deps: ChannelHealthMonitorDeps): Chann
|
161 | 169 | |
162 | 170 | log.info?.(`[${channelId}:${accountId}] health-monitor: restarting (reason: ${reason})`); |
163 | 171 | |
164 | | -record.lastRestartAt = now; |
165 | | -record.restartsThisHour.push({ at: now }); |
166 | | -restartRecords.set(key, record); |
| 172 | +if (!continuingPendingRestart) { |
| 173 | +record.lastRestartAt = now; |
| 174 | +record.restartsThisHour.push({ at: now }); |
| 175 | +restartRecords.set(key, record); |
| 176 | +} |
167 | 177 | |
168 | 178 | try { |
169 | 179 | if (status.running) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。