feat: migrate from wsUrl to endpoints + add relay transport and pairing

This commit is contained in:
Mohamed Boudra
2026-01-21 14:55:23 +07:00
parent ae9a98223f
commit ddbcc272f1
29 changed files with 1729 additions and 280 deletions
@@ -2,9 +2,8 @@ import { test, expect } from './fixtures';
import { createAgent, ensureHostSelected, gotoHome, setWorkingDirectory } from './helpers/app';
import { createTempGitRepo } from './helpers/workspace';
test('sidebar New Agent clones the selected agent settings (not last created)', async ({ page }) => {
test('sidebar New Agent opens a fresh create screen', async ({ page }) => {
const repoA = await createTempGitRepo();
const repoB = await createTempGitRepo();
try {
await gotoHome(page);
@@ -13,42 +12,12 @@ test('sidebar New Agent clones the selected agent settings (not last created)',
await setWorkingDirectory(page, repoA.path);
await createAgent(page, 'Agent A: respond with exactly A');
await expect(page).toHaveURL(/\/agent\//);
const urlA = new URL(page.url());
const agentPathA = urlA.pathname;
await gotoHome(page);
await ensureHostSelected(page);
await setWorkingDirectory(page, repoB.path);
await createAgent(page, 'Agent B: respond with exactly B');
await expect(page).toHaveURL(/\/agent\//);
const urlB = new URL(page.url());
const agentPathB = urlB.pathname;
expect(agentPathA).not.toEqual(agentPathB);
// Navigate back to agent A via URL to ensure it's the selected agent.
await page.goto(agentPathA);
await expect(page).toHaveURL(agentPathA);
await expect(page.getByText('Agent A: respond with exactly A', { exact: true })).toBeVisible();
// Click sidebar New Agent and assert it clones agent A's directory (not agent B's).
// Click sidebar New Agent and assert it does not carry over agent settings via URL.
await page.getByTestId('sidebar-new-agent').click();
await expect(page).toHaveURL(new RegExp(encodeURIComponent(repoA.path)));
await expect(page).not.toHaveURL(new RegExp(encodeURIComponent(repoB.path)));
await expect(page.getByText(repoA.path, { exact: true })).toBeVisible();
// Now navigate to agent B and assert cloning uses repo B.
await page.goto(agentPathB);
await expect(page).toHaveURL(agentPathB);
await expect(page.getByText('Agent B: respond with exactly B', { exact: true })).toBeVisible();
await page.getByTestId('sidebar-new-agent').click();
await expect(page).toHaveURL(new RegExp(encodeURIComponent(repoB.path)));
await expect(page).toHaveURL(/\/$/);
await expect(page).not.toHaveURL(new RegExp(encodeURIComponent(repoA.path)));
await expect(page.getByText(repoB.path, { exact: true })).toBeVisible();
} finally {
await repoA.cleanup();
await repoB.cleanup();
}
});