mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Fix profile owner and runtime inheritance
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user