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.
feat(agent): name the default personal agent Linger
muterC0e717801b721
diff --git a/apps/teamhub/AGENTS.md b/apps/teamhub/AGENTS.mdindex 0f79a6a1..03847fc5 100644--- a/apps/teamhub/AGENTS.md+++ b/apps/teamhub/AGENTS.md@@ -38,6 +38,9 @@ Go service owning Human HTTP/SSE, Agent callbacks, and active product state.## Important Conventions+- The Human's default Another Me Agent is named `Linger`. Changing the Human's+ name updates the delegate description, never the Agent's display name.+ A forward migration renames generated names; custom Agent names stay.- Gmail canvas drafts persist their source digest alongside the provider draft ID.Preparing and executing a send confirmation both check the current authorizedcanvas against that source; changed recipients, body, or attachments require adiff --git a/apps/teamhub/internal/account/profile.go b/apps/teamhub/internal/account/profile.goindex 9ddd8bc0..145419b5 100644--- a/apps/teamhub/internal/account/profile.go+++ b/apps/teamhub/internal/account/profile.go@@ -160,40 +160,26 @@ func ApplyGenerated(ctx context.Context, tx pgx.Tx, tenantID, actorID string, gereturn save(ctx, tx, tenantID, actorID, next)}-// AnotherMeName is the name an Another Me carries after its Human.-func AnotherMeName(humanName string) string {- return humanName + "'s Another Me"-}-// AnotherMeDescription is the description an Another Me carries after its Human.func AnotherMeDescription(humanName string) string {return "Private delegate for " + humanName}-// renameHuman follows a Human's new name through their Another Me and tells+// renameHuman updates the Another Me's description and tells// the Tenant's browsers, which show the name in the directory, Room members// and Chat rows.func renameHuman(ctx context.Context, tx pgx.Tx, tenantID, humanActorID, after string) error {- if err := renameAnotherMe(ctx, tx, tenantID, humanActorID, after); err != nil {+ if err := updateAnotherMeDescription(ctx, tx, tenantID, humanActorID, after); err != nil {return err}return PublishTenantChange(ctx, store.New(tx), tenantID, "tenant.directory.changed")}-// renameAnotherMe keeps the Human's Another Me named after them when their-// name changes. Any name or description still in its generated form follows,-// even one left behind by an earlier rename; one the user edited by hand, or a-// new name too long for an Actor, stays. A changed description advances the-// configuration revision, as every profile change does.-func renameAnotherMe(ctx context.Context, tx pgx.Tx, tenantID, humanActorID, after string) error {+// A Human rename updates the generated description without changing the Agent's+// own name. A changed description advances its configuration revision.+func updateAnotherMeDescription(ctx context.Context, tx pgx.Tx, tenantID, humanActorID, after string) error {const anotherMes = `SELECT actor_id FROM agent_registrationsWHERE tenant_id=$1 AND agent_type='anotherme' AND represented_human_actor_id=$2`- if _, err := tx.Exec(ctx, `UPDATE actors SET display_name=$3-WHERE tenant_id=$1 AND kind='agent' AND display_name<>$3 AND length($3) <= 120- AND right(display_name, length($4)) = $4- AND id IN (`+anotherMes+`)`, tenantID, humanActorID, AnotherMeName(after), AnotherMeName("")); err != nil {- return err- }_, err := tx.Exec(ctx, `UPDATE agent_registrationsSET description=$3, configuration_revision=configuration_revision+1, updated_at=now()WHERE tenant_id=$1 AND status='active' AND description<>$3diff --git a/apps/teamhub/internal/agentregistry/another_me.go b/apps/teamhub/internal/agentregistry/another_me.goindex d1e2bb07..b3a8c864 100644--- a/apps/teamhub/internal/agentregistry/another_me.go+++ b/apps/teamhub/internal/agentregistry/another_me.go@@ -30,7 +30,7 @@ import (// A change to the template reaches existing Another Mes through a migration.const (anotherMeInstructions = `You are Another Me, a private delegate for the Human you represent. Help them organize work, coordinate with other Agents, and act only within explicit TeamHub authority. Never claim to be the Human, never inherit external credentials implicitly, and ask for approval whenever required by product policy.`- anotherMeGreeting = "Hi %s, I'm your Another Me — think of me as another you in Linger."+ anotherMeGreeting = "Hi %s, I'm Linger — your personal AI."anotherMeChatName = "Chat"starterResearchAnalystTemplate = "research-analyst"@@ -114,7 +114,7 @@ func (s *Service) createAnotherMeTx(ctx context.Context, tx pgx.Tx, computer agereturn err}registration, err := CreateAgentRegistration(ctx, queries, AgentRegistrationSpec{- DisplayName: account.AnotherMeName(human.DisplayName),+ DisplayName: "Linger",CreateAgentRegistrationParams: store.CreateAgentRegistrationParams{ActorID: actorID, TenantID: owner.TenantID, AgentManagementID: idgen.New("agent"),Description: account.AnotherMeDescription(human.DisplayName),diff --git a/apps/teamhub/migrations/00880_name_default_delegate_linger.sql b/apps/teamhub/migrations/00880_name_default_delegate_linger.sqlnew file mode 100644index 00000000..cc1bd808--- /dev/null+++ b/apps/teamhub/migrations/00880_name_default_delegate_linger.sql@@ -0,0 +1,28 @@+-- +goose Up+-- Match the represented Human's generated name so custom names keep their identity.+WITH renamed AS (+ UPDATE actors actor+ SET display_name = 'Linger'+ FROM agent_registrations registration, actors human+ WHERE registration.actor_id = actor.id+ AND registration.tenant_id = actor.tenant_id+ AND registration.agent_type = 'anotherme'+ AND human.id = registration.represented_human_actor_id+ AND human.tenant_id = registration.tenant_id+ AND human.kind = 'human'+ AND actor.kind = 'agent'+ AND actor.display_name = human.display_name || '''s Another Me'+ RETURNING actor.id, actor.tenant_id+)+-- Existing Sessions adopt the new name on their next turn without a Runtime reset.+UPDATE agent_registrations registration+SET configuration_revision = registration.configuration_revision + 1,+ updated_at = now()+FROM renamed+WHERE registration.actor_id = renamed.id+ AND registration.tenant_id = renamed.tenant_id;++-- +goose Down+-- +goose StatementBegin+DO $$ BEGIN RAISE EXCEPTION 'the default delegate name is forward-only'; END $$;+-- +goose StatementEnddiff --git a/apps/teamhub/tests/integration/another_me_name_migration_test.go b/apps/teamhub/tests/integration/another_me_name_migration_test.gonew file mode 100644index 00000000..2f33f1e0--- /dev/null+++ b/apps/teamhub/tests/integration/another_me_name_migration_test.go@@ -0,0 +1,65 @@+package integration_test++import (+ "strings"+ "testing"++ "github.com/simplexai-labs/linger/apps/teamhub/migrations"+)++func TestDefaultAnotherMeNameMigrationPreservesCustomNamesAndSessions(t *testing.T) {+ allowParallelIntegrationTest(t)+ data, err := migrations.Files.ReadFile("00880_name_default_delegate_linger.sql")+ if err != nil {+ t.Fatal(err)+ }+ migration, _, found := strings.Cut(string(data), "-- +goose Down")+ if !found {+ t.Fatal("migration has no Down boundary")+ }+ for _, test := range []struct {+ name, customName string+ }{+ {name: "generated default"},+ {name: "custom name", customName: "Helper"},+ {name: "custom name with generated suffix", customName: "Work's Another Me"},+ } {+ t.Run(test.name, func(t *testing.T) {+ env, _, _ := newAnotherMeEnv(t)+ actorID := connectAnotherMeComputer(t, env, acmeTenant, "actor_acme_alice")+ name := test.customName+ wantName := name+ var revisionDelta int64+ if name == "" {+ if err := env.pool.QueryRow(t.Context(), `SELECT display_name || '''s Another Me' FROM actors WHERE id='actor_acme_alice'`).Scan(&name); err != nil {+ t.Fatal(err)+ }+ wantName, revisionDelta = "Linger", 1+ }+ if _, err := env.pool.Exec(t.Context(), `UPDATE actors SET display_name=$2 WHERE id=$1`, actorID, name); err != nil {+ t.Fatal(err)+ }+ var profileRevision, runtimeRevision int64+ if err := env.pool.QueryRow(t.Context(), `SELECT configuration_revision, runtime_configuration_revision FROM agent_registrations WHERE actor_id=$1`, actorID).Scan(&profileRevision, &runtimeRevision); err != nil {+ t.Fatal(err)+ }+ for attempt := 0; attempt < 2; attempt++ {+ if _, err := env.pool.Exec(t.Context(), migration); err != nil {+ t.Fatal(err)+ }+ var gotName string+ var gotProfileRevision, gotRuntimeRevision int64+ if err := env.pool.QueryRow(t.Context(), `+ SELECT actor.display_name, registration.configuration_revision, registration.runtime_configuration_revision+ FROM actors actor JOIN agent_registrations registration ON registration.actor_id=actor.id+ WHERE actor.id=$1+ `, actorID).Scan(&gotName, &gotProfileRevision, &gotRuntimeRevision); err != nil {+ t.Fatal(err)+ }+ if gotName != wantName || gotProfileRevision != profileRevision+revisionDelta || gotRuntimeRevision != runtimeRevision {+ t.Fatalf("migration attempt %d: name=%q profile revision=%d runtime revision=%d; want %q, %d, %d", attempt+1, gotName, gotProfileRevision, gotRuntimeRevision, wantName, profileRevision+revisionDelta, runtimeRevision)+ }+ }+ })+ }+}diff --git a/apps/teamhub/tests/integration/another_me_rename_test.go b/apps/teamhub/tests/integration/another_me_rename_test.goindex c346f5ec..8982d4bc 100644--- a/apps/teamhub/tests/integration/another_me_rename_test.go+++ b/apps/teamhub/tests/integration/another_me_rename_test.go@@ -5,16 +5,15 @@ import ("testing")-// The Human's Another Me follows their name, unless they renamed it by hand.-func TestAccountRenameRenamesTheHumansAnotherMe(t *testing.T) {+// A Human rename updates the delegate description, preserving the Agent's name.+func TestAccountRenamePreservesTheHumansAnotherMeName(t *testing.T) {allowParallelIntegrationTest(t)env, alice := newAgentRegistrationEnv(t, &recordingAgentManagement{})seedOwnedFixtureComputer(t, env.pool, "computer_fixture_rename", acmeTenant, "actor_acme_alice")const actorID = "actor_rename_alice_me"if _, err := env.pool.Exec(t.Context(), `INSERT INTO actors(id,tenant_id,kind,display_name,handle)- SELECT $1,$2,'agent',display_name || '''s Another Me','alice-me-rename'- FROM actors WHERE id='actor_acme_alice'+ VALUES($1,$2,'agent','Linger','alice-me-rename')`, actorID, acmeTenant); err != nil {t.Fatal(err)}@@ -56,20 +55,16 @@ func TestAccountRenameRenamesTheHumansAnotherMe(t *testing.T) {_, revisionBefore := anotherMeDescription()rename("Alice Stone")- if got := anotherMeName(); got != "Alice Stone's Another Me" {+ if got := anotherMeName(); got != "Linger" {t.Fatalf("Another Me after the rename = %q", got)}if description, revision := anotherMeDescription(); description != "Private delegate for Alice Stone" || revision != revisionBefore+1 {t.Fatalf("Another Me description after the rename = %q at revision %d", description, revision)}- // A name left behind by an earlier rename still follows the next one.- if _, err := env.pool.Exec(t.Context(), `UPDATE actors SET display_name='onboarding-test''s Another Me' WHERE id=$1`, actorID); err != nil {- t.Fatal(err)- }rename("Alicia Stone")- if got := anotherMeName(); got != "Alicia Stone's Another Me" {- t.Fatalf("a stale Another Me name after the rename = %q", got)+ if got := anotherMeName(); got != "Linger" {+ t.Fatalf("Another Me after another Human rename = %q", got)}if _, err := env.pool.Exec(t.Context(), `UPDATE actors SET display_name='Helper' WHERE id=$1`, actorID); err != nil {diff --git a/apps/teamhub/tests/integration/another_me_test.go b/apps/teamhub/tests/integration/another_me_test.goindex 1f97e084..af9228b3 100644--- a/apps/teamhub/tests/integration/another_me_test.go+++ b/apps/teamhub/tests/integration/another_me_test.go@@ -116,6 +116,13 @@ func TestComputerComingOnlineCreatesAnotherMeOnce(t *testing.T) {if actorID == "" {t.Fatal("the Computer coming online created no Another Me")}+ var displayName string+ if err := env.pool.QueryRow(t.Context(), `SELECT display_name FROM actors WHERE id=$1`, actorID).Scan(&displayName); err != nil {+ t.Fatal(err)+ }+ if displayName != "Linger" {+ t.Fatalf("default Another Me name=%q want=Linger", displayName)+ }var model, effort, computerID, runtimeType, grantID, createdBy stringvar receivesAll boolif err := env.pool.QueryRow(t.Context(), `@@ -146,7 +153,7 @@ func TestComputerComingOnlineCreatesAnotherMeOnce(t *testing.T) {`, roomID, actorID).Scan(&greeting); err != nil {t.Fatal(err)}- if greeting != "Hi alice, I'm your Another Me — think of me as another you in Linger." {+ if greeting != "Hi alice, I'm Linger — your personal AI." {t.Fatalf("Another Me greeting=%q", greeting)}assertAnotherMeChat(t, env, roomID)diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex f9b679f2..bdcc0bd3 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -43,6 +43,8 @@ build:assets` to check the initial JS budget.## Important Conventions+- The first-visit Agent introduction uses its display name from TeamHub,+ including the default `Linger` name and any name the Human chooses.- The login page keeps Linger's headline and day timeline on the left,and the sign-in form on the right. A faint white grid fades gently into theform's white background without a dark panel, colored glow, or blur. Thediff --git a/apps/web/src/features/rooms/chat/another-me-intro.test.tsx b/apps/web/src/features/rooms/chat/another-me-intro.test.tsxindex 7812d9c0..e9afcc20 100644--- a/apps/web/src/features/rooms/chat/another-me-intro.test.tsx+++ b/apps/web/src/features/rooms/chat/another-me-intro.test.tsx@@ -7,12 +7,12 @@ import { TeamHubRuntimeProvider } from "@/features/teamhub/teamhub-runtime";import { AnotherMeIntro } from "./another-me-intro";-function renderIntro(onDone = vi.fn()) {+function renderIntro(onDone = vi.fn(), name = "Linger") {render(<QueryClientProvider client={new QueryClient()}><TeamHubRuntimeProvider runtime={createTestTeamHubRuntime()}><AnotherMeIntro- agent={{ display_name: "Bob's Another Me", id: "actor-another-me" }}+ agent={{ display_name: name, id: "actor-another-me" }}humanName="Bob"onDone={onDone}/>@@ -29,9 +29,7 @@ describe("AnotherMeIntro", () => {it("greets the Human by name, then finishes on its own", async () => {const onDone = renderIntro();- expect(screen.getByRole("status")).toHaveTextContent(- "Hi, BobI'm your Another Me.",- );+ expect(screen.getByRole("status")).toHaveTextContent("Hi, BobI'm Linger.");await act(() => vi.advanceTimersByTime(2000));expect(onDone).not.toHaveBeenCalled();// jsdom has no Web Animations, so leaving completes at once.@@ -39,6 +37,11 @@ describe("AnotherMeIntro", () => {expect(onDone).toHaveBeenCalledTimes(1);});+ it("introduces a custom Agent name", () => {+ renderIntro(vi.fn(), "Helper");+ expect(screen.getByRole("status")).toHaveTextContent("Hi, BobI'm Helper.");+ });+it("can be skipped with Escape", () => {const onEscape = renderIntro();fireEvent.keyDown(window, { key: "Escape" });diff --git a/apps/web/src/features/rooms/chat/another-me-intro.tsx b/apps/web/src/features/rooms/chat/another-me-intro.tsxindex 8585aa2c..0ebac00e 100644--- a/apps/web/src/features/rooms/chat/another-me-intro.tsx+++ b/apps/web/src/features/rooms/chat/another-me-intro.tsx@@ -111,7 +111,7 @@ export function AnotherMeIntro({Hi{humanName ? `, ${humanName}` : ""}</p><p className="mt-1 text-sm text-muted-foreground">- {"I'm your Another Me."}+ {`I'm ${agent.display_name}.`}</p></div></div>