diff --git a/src/agents/skills.buildworkspaceskillsnapshot.test.ts b/src/agents/skills.buildworkspaceskillsnapshot.test.ts index e1174952e6b..893d269efe9 100644 --- a/src/agents/skills.buildworkspaceskillsnapshot.test.ts +++ b/src/agents/skills.buildworkspaceskillsnapshot.test.ts @@ -247,9 +247,14 @@ describe("buildWorkspaceSkillSnapshot", () => { ); // We should only have loaded a small subset. - expect(snapshot.skills.length).toBeLessThanOrEqual(5); - expect(snapshot.prompt).toContain("repo-skill-00"); - expect(snapshot.prompt).not.toContain("repo-skill-07"); + const skillNames = snapshot.skills.map((skill) => skill.name); + expect(skillNames.length).toBeGreaterThan(0); + expect(skillNames.length).toBeLessThanOrEqual(5); + expect(new Set(skillNames).size).toBe(skillNames.length); + for (const name of skillNames) { + expect(name).toMatch(/^repo-skill-\d{2}$/); + expect(snapshot.prompt).toContain(name); + } }); it("skips skills whose SKILL.md exceeds maxSkillFileBytes", async () => { diff --git a/ui/src/ui/app-settings.ts b/ui/src/ui/app-settings.ts index c647524519a..9e368971d1e 100644 --- a/ui/src/ui/app-settings.ts +++ b/ui/src/ui/app-settings.ts @@ -591,10 +591,11 @@ export function syncUrlWithTab(host: SettingsHost, tab: Tab, replace: boolean) { } export function syncUrlWithSessionKey(host: SettingsHost, sessionKey: string, replace: boolean) { - if (typeof window === "undefined") { + const href = typeof window === "undefined" ? undefined : window.location?.href; + if (!href) { return; } - const url = new URL(window.location.href); + const url = new URL(href); url.searchParams.set("session", sessionKey); updateBrowserHistory(url, replace); }