refactor(routing): centralize inbound last-route policy

This commit is contained in:
Peter Steinberger
2026-03-08 02:02:00 +00:00
parent b2f8f5e4dd
commit 6a8081a7f3
10 changed files with 172 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import type { OpenClawConfig } from "../config/config.js";
import type { ResolvedAgentRoute } from "../routing/resolve-route.js";
import { deriveLastRoutePolicy } from "../routing/resolve-route.js";
import { resolveAgentIdFromSessionKey } from "../routing/session-key.js";
import {
ensureConfiguredAcpBindingSession,
@@ -50,6 +51,10 @@ export function resolveConfiguredAcpRoute(params: {
...params.route,
sessionKey: boundSessionKey,
agentId: boundAgentId,
lastRoutePolicy: deriveLastRoutePolicy({
sessionKey: boundSessionKey,
mainSessionKey: params.route.mainSessionKey,
}),
matchedBy: "binding.channel",
},
};