АРЧ АП11 - Архитектура после регресса: Архитектура: протянуть continuity-backed organization authority в session scope bootstrap и удержать phase12 wider replay зелёным
This commit is contained in:
@@ -90,6 +90,35 @@ describe("assistant organization scope runtime adapter", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("reuses assistant continuity authority from prior assistant debug when legacy helpers are empty", () => {
|
||||
const normalizeOrganizationScopeValue = vi.fn((value: unknown) =>
|
||||
typeof value === "string" && value.trim() ? value.trim() : null
|
||||
);
|
||||
|
||||
const context = resolveSessionOrganizationScopeContextRuntime({
|
||||
userMessage: "просто продолжай",
|
||||
items: [
|
||||
{
|
||||
role: "assistant",
|
||||
debug: {
|
||||
assistant_known_organizations: ["Org C", "Org D"],
|
||||
assistant_active_organization: "Org C"
|
||||
}
|
||||
}
|
||||
] as any[],
|
||||
extractKnownOrganizationsFromHistory: () => [],
|
||||
resolveOrganizationSelectionFromMessage: () => null,
|
||||
findLastAssistantActiveOrganization: () => null,
|
||||
normalizeOrganizationScopeValue
|
||||
});
|
||||
|
||||
expect(context).toEqual({
|
||||
knownOrganizations: ["Org C", "Org D"],
|
||||
selectedOrganization: null,
|
||||
activeOrganization: "Org C"
|
||||
});
|
||||
});
|
||||
|
||||
it("merges organization into followup previous filters when organization is missing", () => {
|
||||
const merged = mergeFollowupContextWithOrganizationScopeRuntime({
|
||||
followupContext: {
|
||||
|
||||
Reference in New Issue
Block a user