Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
fix(web): gate Make room handoff on Pi readiness and deduplicate by ID
Dongdong Chen688850cc4fc1
diff --git a/apps/web/src/features/local-models/local-model-agents.test.ts b/apps/web/src/features/local-models/local-model-agents.test.tsindex c8c3dd28..bd6c71d9 100644--- a/apps/web/src/features/local-models/local-model-agents.test.ts+++ b/apps/web/src/features/local-models/local-model-agents.test.ts@@ -163,6 +163,15 @@ describe("local-model-agents", () => {"Research agent","Jenny's Delegate",]);++ const sameNameAgent = { ...agent!, name: "Helper" };+ const sameNameEntry = {+ ...entry,+ used_by: [{ agent_id: "agent-other", name: "Helper" }],+ };+ expect(+ usedByAgentNames(sameNameEntry, [sameNameAgent], "computer-lab"),+ ).toEqual(["Helper", "Helper"]);});it("omits incompatible Claude reasoning efforts when Pi has not listed the model yet, and preserves valid Pi efforts when listed", () => {diff --git a/apps/web/src/features/local-models/local-model-agents.ts b/apps/web/src/features/local-models/local-model-agents.tsindex e1418492..f0859d22 100644--- a/apps/web/src/features/local-models/local-model-agents.ts+++ b/apps/web/src/features/local-models/local-model-agents.ts@@ -127,9 +127,7 @@ export function usedByAgentNames(for (const agent of assignableAgents) {if (isAgentUsingModel(entry, agent, computerId) &&- !entry.used_by.some(- (user) => user.agent_id === agent.actorId || user.name === agent.name,- )+ !entry.used_by.some((user) => user.agent_id === agent.actorId)) {names.push(agent.name);}diff --git a/apps/web/src/features/local-models/local-models-page.test.tsx b/apps/web/src/features/local-models/local-models-page.test.tsxindex c254351c..0753a3e4 100644--- a/apps/web/src/features/local-models/local-models-page.test.tsx+++ b/apps/web/src/features/local-models/local-models-page.test.tsx@@ -1856,6 +1856,42 @@ describe("LocalModelsPage", () => {),).toHaveLength(0);});++ it("hides the Make room handoff checkbox when Pi is not ready for Agent switching", async () => {+ const mac = withModel(macView(), "llama3.3-70b:Q4_K_M", {+ pi_model: "localmodels-library/llama3.3-70b",+ });+ const fixture = setup([mac]);+ fixture.runtime.seed.tenantAgents = fixture.runtime.seed.tenantAgents.map(+ (agent) =>+ agent.actor.id === "actor-delegate"+ ? {+ ...agent,+ runtime: {+ model: "localmodels-library/gpt-oss-20b",+ placement: {+ computer_id: "computer-mac",+ runtime_type: "pi",+ type: "local",+ workspace_grant_id: "grant-linger-workspace",+ },+ },+ }+ : agent,+ );+ await renderPage(fixture, "?computer=computer-mac");+ await findModels();++ fireEvent.click(+ screen.getByRole("button", { name: "Retry Llama 3.3 70B" }),+ );+ const dialog = screen.getByRole("dialog", { name: "Make room to load" });+ expect(+ within(dialog).queryByRole("checkbox", {+ name: /Switch Jenny's Delegate/u,+ }),+ ).toBeNull();+ });});describe("Model source", () => {diff --git a/apps/web/src/features/local-models/local-models-page.tsx b/apps/web/src/features/local-models/local-models-page.tsxindex 4a1de9ee..77270204 100644--- a/apps/web/src/features/local-models/local-models-page.tsx+++ b/apps/web/src/features/local-models/local-models-page.tsx@@ -940,7 +940,7 @@ function Library({) : null}{dialogEntry && makeRoom ? (<MakeRoomDialog- assignableAgents={assignableAgents}+ assignableAgents={canSwitchAgents ? assignableAgents : []}check={makeRoom}disabled={!confirmable(dialogEntry, "load")}entry={dialogEntry}