Fix profile owner and runtime inheritance

This commit is contained in:
klopez4212
2026-06-25 16:01:58 +01:00
parent 2f34f8a0f1
commit 627d4cbb41
3 changed files with 9 additions and 11 deletions
@@ -649,22 +649,25 @@ export function UserProfilePanel({
onClose();
onOpenAgentSession?.(effectivePubkey);
}, [effectivePubkey, onClose, onOpenAgentSession]);
const handleOpenChannel = React.useCallback(
(channelId: string) => {
void goChannel(channelId);
},
[goChannel],
);
const displayName = resolveProfileDisplayName({
persona: resolvedPersona,
profile,
pubkey: effectivePubkey,
});
const ownerProfile = ownerPubkey
? ownerProfileQuery.data
: isOwner === true
? currentProfileQuery.data
: undefined;
const ownerHandle = resolveOwnerHandle(
ownerPubkey ? ownerProfileQuery.data : currentProfileQuery.data,
ownerPubkey ?? currentPubkey,
ownerProfile,
ownerPubkey ?? (isOwner === true ? currentPubkey : undefined),
);
const ownerDisplayName = ownerHandle
? isCurrentUserOwner || (!ownerPubkey && isOwner === true)
@@ -715,7 +718,6 @@ export function UserProfilePanel({
onBack={() => setView("summary")}
/>
);
const headerActions = (
<UserProfilePanelHeaderActions
effectivePubkey={effectivePubkey}
@@ -724,7 +726,6 @@ export function UserProfilePanel({
onClose={onClose}
/>
);
const profileBody = (
<div
className={cn(
@@ -179,7 +179,7 @@ test("personaManagedAgentUpdate leaves runtime fields alone when runtime is unch
);
});
test("personaManagedAgentUpdate resets runtime fields when persona runtime is cleared", () => {
test("personaManagedAgentUpdate leaves runtime inheritance when persona runtime is cleared", () => {
assert.deepEqual(
personaManagedAgentUpdate(
agent({
@@ -206,9 +206,6 @@ test("personaManagedAgentUpdate resets runtime fields when persona runtime is cl
name: "Fizz Prime",
systemPrompt: "New prompt",
model: "new-model",
agentCommand: "goose",
agentArgs: [],
mcpCommand: "",
},
);
});
@@ -296,7 +296,7 @@ function resolvePersonaManagedAgentRuntime(
runtimes: readonly AcpRuntimeCatalogEntry[] | undefined,
) {
if (!runtimes?.length) return undefined;
if (!runtimeId) return runtimes[0];
if (!runtimeId) return undefined;
return runtimes.find((candidate) => candidate.id === runtimeId);
}