Архитектура: убрать legacy active-organization callback из session-scope bootstrap и упростить organization authority path

This commit is contained in:
2026-04-18 21:43:09 +03:00
parent 59656a44a0
commit 8111586d8d
6 changed files with 5 additions and 149 deletions
@@ -8,7 +8,6 @@ describe("assistant organization scope runtime adapter", () => {
it("resolves selected organization from user message and promotes it to active scope", () => {
const extractKnownOrganizationsFromHistory = vi.fn(() => ["Org A", "Org B"]);
const resolveOrganizationSelectionFromMessage = vi.fn(() => "Org B");
const findLastAssistantActiveOrganization = vi.fn(() => "Org A");
const normalizeOrganizationScopeValue = vi.fn((value: unknown) =>
typeof value === "string" && value.trim() ? value.trim() : null
);
@@ -18,7 +17,6 @@ describe("assistant organization scope runtime adapter", () => {
items: [] as any[],
extractKnownOrganizationsFromHistory,
resolveOrganizationSelectionFromMessage,
findLastAssistantActiveOrganization,
normalizeOrganizationScopeValue
});
@@ -39,7 +37,6 @@ describe("assistant organization scope runtime adapter", () => {
items: [] as any[],
extractKnownOrganizationsFromHistory: () => ["Org A"],
resolveOrganizationSelectionFromMessage: () => null,
findLastAssistantActiveOrganization: () => "Org A",
normalizeOrganizationScopeValue
});
@@ -48,7 +45,6 @@ describe("assistant organization scope runtime adapter", () => {
selectedOrganization: null,
activeOrganization: "Org A"
});
expect(normalizeOrganizationScopeValue).toHaveBeenCalledWith("Org A");
});
it("prefers organization scope from address navigation state when present", () => {
@@ -79,7 +75,6 @@ describe("assistant organization scope runtime adapter", () => {
} as any,
extractKnownOrganizationsFromHistory: () => ["Org A"],
resolveOrganizationSelectionFromMessage: () => null,
findLastAssistantActiveOrganization: () => "Org A",
normalizeOrganizationScopeValue
});
@@ -108,7 +103,6 @@ describe("assistant organization scope runtime adapter", () => {
] as any[],
extractKnownOrganizationsFromHistory: () => [],
resolveOrganizationSelectionFromMessage: () => null,
findLastAssistantActiveOrganization: () => null,
normalizeOrganizationScopeValue
});