mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 19:30:44 +00:00
feat(agents): implement state-aware failover and lane suspension
Summary:
- Persist quota-suspension state transitions and reload fresh suspension state before failover handoff injection.
- Restore suspended lanes to configured concurrency and share failover-to-suspension reason mapping across fallback and embedded runner paths.
- Export model.failover diagnostics via OTLP and cover queueing/resume behavior with regressions.
Verification:
- pnpm test src/config/sessions/store.pruning.integration.test.ts src/process/command-queue.test.ts src/agents/session-suspension.test.ts src/agents/model-fallback.test.ts extensions/diagnostics-otel/src/service.test.ts
- git diff --check
- pnpm exec oxfmt --check --threads=1 on changed TypeScript files
- GitHub checks: 92 successful, 0 pending, 0 failed on head 962146be88
- Review threads: none unresolved
This commit is contained in:
@@ -311,8 +311,12 @@ export function markGatewayDraining(): void {
|
||||
export function setCommandLaneConcurrency(lane: string, maxConcurrent: number) {
|
||||
const cleaned = normalizeLane(lane);
|
||||
const state = getLaneState(cleaned);
|
||||
state.maxConcurrent = Math.max(1, Math.floor(maxConcurrent));
|
||||
drainLane(cleaned);
|
||||
const isProbeLane = cleaned.startsWith("auth-probe:") || cleaned.startsWith("session:probe-");
|
||||
const minConcurrent = isProbeLane ? 1 : 0;
|
||||
state.maxConcurrent = Math.max(minConcurrent, Math.floor(maxConcurrent));
|
||||
if (state.maxConcurrent > 0) {
|
||||
drainLane(cleaned);
|
||||
}
|
||||
}
|
||||
|
||||
export function enqueueCommandInLane<T>(
|
||||
|
||||
Reference in New Issue
Block a user