feat(FN-3899): add chat rooms with send routing and delete-room UI

This merge delivers chat rooms with room send routing and delete-room UI in the dashboard (FN-3899), including fixes for bundled plugin view imports and a release changeset. Supporting changes include a merger improvement that tightens scope-warning diff base when baseBranch is missing, companies.sh

Fusion-Task-Id: FN-3899
This commit is contained in:
Fusion
2026-05-09 16:29:11 -07:00
committed by gsxdsm
parent 1ccccdece9
commit 271166ad7c
9 changed files with 221 additions and 38 deletions

View File

@@ -7618,7 +7618,7 @@ describe("aiMergeTask — in-merge verification fix", () => {
expect(mockedCreateFnAgent).toHaveBeenCalledTimes(4);
});
it("default verificationFixRetries (omitted) results in 3 fix attempts", async () => {
it("default verificationFixRetries (omitted) results in 2 fix attempts", async () => {
mockedExecSync.mockImplementation((cmd: any) => {
const cmdStr = String(cmd);
if (cmdStr.includes("rev-parse --verify")) return Buffer.from("abc123");
@@ -7658,26 +7658,25 @@ describe("aiMergeTask — in-merge verification fix", () => {
(store.getSettings as ReturnType<typeof vi.fn>).mockResolvedValue({
...DEFAULT_SETTINGS,
testCommand: "vitest run",
// verificationFixRetries is NOT set — should default to 3
// verificationFixRetries is NOT set — should default to 2
});
await expect(aiMergeTask(store, "/tmp/root", "FN-050")).rejects.toMatchObject({
name: "VerificationError",
});
// 1 merger AI agent (attempt 1) + 3 fix agent attempts (default) = 4 calls
expect(mockedCreateFnAgent).toHaveBeenCalledTimes(4);
// 1 merger AI agent (attempt 1) + 2 fix agent attempts (default) = 3 calls
expect(mockedCreateFnAgent).toHaveBeenCalledTimes(3);
// Verify the log shows 3 fix attempts (2 log entries per attempt: start + failure)
// Verify the log shows 2 fix attempts (2 log entries per attempt: start + failure)
const logCalls = (store.logEntry as ReturnType<typeof vi.fn>).mock.calls;
const fixAttempts = logCalls.filter((call: any[]) =>
typeof call[1] === "string" && call[1].includes("In-merge verification fix attempt"),
);
// Each attempt produces 2 log entries: "attempt X/3" and "attempt X — verification still fails"
expect(fixAttempts).toHaveLength(6);
expect(fixAttempts[0][1]).toContain("attempt 1/3");
expect(fixAttempts[2][1]).toContain("attempt 2/3");
expect(fixAttempts[4][1]).toContain("attempt 3/3");
// Each attempt produces 2 log entries: "attempt X/2" and "attempt X — verification still fails"
expect(fixAttempts).toHaveLength(4);
expect(fixAttempts[0][1]).toContain("attempt 1/2");
expect(fixAttempts[2][1]).toContain("attempt 2/2");
});
});

View File

@@ -5085,7 +5085,7 @@ export async function aiMergeTask(
// Try in-merge fix attempts before propagating
if (error.name === "VerificationError") {
const verificationErr = error as VerificationError;
const maxFixRetries = Math.min(settings.verificationFixRetries ?? 3, 3);
const maxFixRetries = Math.min(settings.verificationFixRetries ?? 2, 3);
if (maxFixRetries > 0 && (verificationErr.verificationResult.testResult || verificationErr.verificationResult.buildResult)) {
mergerLog.log(`${taskId}: deterministic verification failed — attempting in-merge fix (up to ${maxFixRetries} attempts)`);
@@ -5216,7 +5216,7 @@ export async function aiMergeTask(
// Check if it's a build verification failure
if (error.message?.includes("Build verification failed")) {
const maxFixRetries = Math.min(settings.verificationFixRetries ?? 3, 3);
const maxFixRetries = Math.min(settings.verificationFixRetries ?? 2, 3);
// Try in-merge fix before falling back to build retry
if (maxFixRetries > 0 && (effectiveTestCommand || effectiveBuildCommand)) {