mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 12:11:24 +00:00
refactor: consolidate typing lifecycle and queue policy
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
readSessionMessages,
|
||||
} from "./post-compaction-audit.js";
|
||||
import { readPostCompactionContext } from "./post-compaction-context.js";
|
||||
import { resolveActiveRunQueueAction } from "./queue-policy.js";
|
||||
import { enqueueFollowupRun, type FollowupRun, type QueueSettings } from "./queue.js";
|
||||
import { createReplyToModeFilterForChannel, resolveReplyToMode } from "./reply-threading.js";
|
||||
import { incrementRunCompactionCount, persistRunSessionUsage } from "./session-run-accounting.js";
|
||||
@@ -235,12 +236,19 @@ export async function runReplyAgent(params: {
|
||||
}
|
||||
}
|
||||
|
||||
if (isHeartbeat && isActive) {
|
||||
const activeRunQueueAction = resolveActiveRunQueueAction({
|
||||
isActive,
|
||||
isHeartbeat,
|
||||
shouldFollowup,
|
||||
queueMode: resolvedQueue.mode,
|
||||
});
|
||||
|
||||
if (activeRunQueueAction === "drop") {
|
||||
typing.cleanup();
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (isActive && (shouldFollowup || resolvedQueue.mode === "steer")) {
|
||||
if (activeRunQueueAction === "enqueue-followup") {
|
||||
enqueueFollowupRun(queueKey, followupRun, resolvedQueue);
|
||||
await touchActiveSessionEntry();
|
||||
typing.cleanup();
|
||||
|
||||
Reference in New Issue
Block a user