Skip to content

The agent that grows with you

fix(dashboard): a named-profile dashboard keeps its own profile instead of the sticky active one (#96712, salvage #96736)

ipriyaaanshu064d16981b56
diff --git a/web/src/lib/profile-bootstrap.test.ts b/web/src/lib/profile-bootstrap.test.ts
index 453ae9dd6e0..d750fa810b4 100644
--- a/web/src/lib/profile-bootstrap.test.ts
+++ b/web/src/lib/profile-bootstrap.test.ts
@@ -23,6 +23,13 @@ describe("initialProfileScope", () => {
shouldAdoptActiveProfile(null, "", "default", "review"),
).toBe(true);
});
+
+ it("keeps a named-profile dashboard on its own profile (#96712)", () => {
+ // `hermes -p demo serve` with the machine's sticky active profile on
+ // `default`: the dashboard must not retarget chats to the other agent.
+ expect(shouldAdoptActiveProfile(null, "", "demo", "default")).toBe(false);
+ expect(shouldAdoptActiveProfile(null, "", "custom", "default")).toBe(false);
+ });
});
describe("dashboardServingProfile", () => {
diff --git a/web/src/lib/profile-bootstrap.ts b/web/src/lib/profile-bootstrap.ts
index 51402fb1c8b..4871fec244e 100644
--- a/web/src/lib/profile-bootstrap.ts
+++ b/web/src/lib/profile-bootstrap.ts
@@ -41,9 +41,14 @@ export function shouldAdoptActiveProfile(
currentProfile: string,
activeProfile: string,
): boolean {
+ // Only the machine (default-hosted) dashboard aligns to the sticky active
+ // profile. A dashboard hosted by a named profile (`hermes -p demo serve`)
+ // serves THAT agent: adopting the machine-global active_profile would
+ // silently retarget its banner, chat TUI env and model to another profile.
return (
urlProfile === null &&
!bootstrapProfile &&
+ currentProfile === "default" &&
activeProfile !== currentProfile
);
}