Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
712c152
feat(solo): grant opening agents chat admin access
tellaho Nov 16, 2026
c111ae8
test(search): await find shortcut registration
tellaho Nov 16, 2026
b77b428
test(solo): consolidate opening admin recovery coverage
tellaho Nov 16, 2026
543f23b
test(navigation): isolate warm sidebar preference requests
tellaho Nov 16, 2026
7538ac4
fix(solo): adapt admin setup to ownership-transfer API
tellaho Nov 16, 2026
802ad75
feat(solo): grant admin when owners add agents later
tellaho Nov 17, 2026
e5189d0
merge main into Solo agent admin feature
tellaho Nov 17, 2026
549140a
fix(solo): narrow saved invitation role matching
tellaho Nov 17, 2026
057088b
fix(relay): route saved admin additions through browser host
tellaho Nov 17, 2026
85459e5
fix(outbox): let expired admin setup be abandoned safely
tellaho Nov 17, 2026
aae5dab
fix(outbox): preserve expired messages when continuing a chat
tellaho Nov 17, 2026
752ceaa
fix(outbox): fence admin setup publication across windows
tellaho Nov 17, 2026
3f27a6e
fix(outbox): make shared receipt dismissal idempotent
tellaho Nov 17, 2026
7f350f2
Merge origin/main with upstream browser recovery repairs
tellaho Nov 17, 2026
588d64d
fix(solo): grant automatic admin only to owned agents
tellaho Nov 17, 2026
ae87bf2
fix(solo): recheck ownership before automatic admin grants
tellaho Nov 17, 2026
931a81c
fix(solo): refresh ownership before automatic admin grants
tellaho Nov 17, 2026
39272dd
Merge origin/main into Solo agent admin feature
tellaho Nov 17, 2026
cd09311
test(channels): format merged access fixture
tellaho Nov 17, 2026
a8f953d
fix(outbox): keep removed setup receipts out of stale writes
tellaho Nov 17, 2026
7797070
fix(solo): let users abandon blocked opening admin setup
tellaho Nov 17, 2026
be212e1
Merge origin/main into Solo agent admin feature
tellaho Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions browser-host/relay-broker-api.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,66 @@ test("details routes are narrow, require the live owner, and do not widen lifecy
}
});

test("later Admin additions cross the broker and replay the exact saved event after restart", async () => {
const h = await harness(success);
let first;
let restored;
let live;
let records = [];
const storage = {
load: () => structuredClone(records),
save: (next) => {
records = structuredClone(next);
},
};
try {
const transport = await connectBrokerTransport(h.base);
first = createOutbox(transport.viewer, transport.writer, storage);
await first.outbox.ready();
const id = first.outbox.send({
kind: 9000,
content: "",
tags: [
["h", "11111111-1111-4111-8111-111111111111"],
["p", getPublicKey(new Uint8Array(32).fill(5))],
["role", "admin"],
],
});
await vi.waitFor(() =>
expect(first.outbox.snapshot()[0]?.delivery).toBe("failed"),
);
// Signing succeeds through the purpose-bound route. Publication needs a live socket.
const signed = first.outbox.snapshot()[0]?.signed;
expect(signed).toBeDefined();
const saved = JSON.parse(JSON.stringify(signed));
expect(verifyEvent(structuredClone(saved))).toBe(true);
expect(saved.tags).toContainEqual(["role", "admin"]);
expect(saved.tags.at(-1)?.[0]).toBe("client-id");
expect(h.publications).toHaveLength(0);
expect((await h.post("sign", saved)).status).toBe(400);
expect((await h.post("publish", saved)).status).toBe(400);
first.dispose();
wallClock += 10000;
const resumed = await connectBrokerTransport(h.base);
live = await openBrokerSocket(resumed);
restored = createOutbox(resumed.viewer, resumed.writer, storage);
await restored.outbox.ready();
restored.outbox.retry(id);
await vi.waitFor(() =>
expect(restored.outbox.snapshot()[0]?.delivery).toBe("accepted"),
);
expect(h.publications).toEqual([saved]);
expect(
JSON.parse(JSON.stringify(restored.outbox.snapshot()[0]?.signed)),
).toEqual(saved);
} finally {
first?.dispose();
restored?.dispose();
live?.dispose();
await h.close();
}
});

test("member administration uses isolated shape-limited routes and the current community socket", async () => {
const h = await harness(success);
let live;
Expand Down Expand Up @@ -4161,6 +4221,26 @@ test("member administration uses isolated shape-limited routes and the current c
{ ...template, tags: [...template.tags, ["h", id]] },
{ ...template, tags: null },
{ ...template, tags: [null] },
...[
[...template.tags, ["client-id", "invalid"]],
[
...template.tags,
["client-id", "22222222-2222-4222-8222-222222222222"],
["p", target],
],
[
template.tags[0],
["p", transport.viewer],
template.tags[2],
["client-id", "22222222-2222-4222-8222-222222222222"],
],
[
template.tags[0],
template.tags[1],
["role", "owner"],
["client-id", "22222222-2222-4222-8222-222222222222"],
],
].map((tags) => ({ ...template, tags })),
];
for (const event of invalid)
for (const route of [
Expand Down
8 changes: 6 additions & 2 deletions browser-host/relay-broker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import {
communityGitRepository,
parseGitRead,
} from "../src/features/repos/git.ts";
import { validateMemberAdministrationTemplate } from "../src/features/channel-members/administration-protocol.ts";
import {
isAdminAddition,
validateMemberAdministrationTemplate,
} from "../src/features/channel-members/administration-protocol.ts";
import { validateLifecycleTemplate } from "../src/features/relay/channel-lifecycle-protocol.ts";
import { validateDetailsTemplate } from "../src/features/relay/channel-details-protocol.ts";
import { validateArchiveRequestTemplate } from "../src/features/relay/identity-archive-protocol.ts";
Expand Down Expand Up @@ -2973,7 +2976,8 @@ export function relayBrokerPlugin({
if (signing || publishing) {
if (administration) {
try {
validateMemberAdministrationTemplate(filters, viewer);
if (!isAdminAddition(filters, viewer))
validateMemberAdministrationTemplate(filters, viewer);
} catch {
return json(res, 400, {
error: "Invalid member administration command",
Expand Down
15 changes: 13 additions & 2 deletions docs/buzz-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,19 @@ and are asked to sign in again in Buzz.
the full, scrollable list of names. Messages and huddle entries split groups.

- **Solo** organizes your chats with agents. Choose **New chat**, select or tag
an agent, and send a message. Solo conversations continue at the chat's top
level rather than requiring a new thread for each reply. Where available, use
an agent, and send a message. Your agents become chat admins before the opening
message is delivered, including agents added by workspace defaults; you remain
owner. Ownership is verified from their signed profiles. Your agents added
later to a Solo chat you own also join as admins, whether from the composer or
Chat access. Other people's agents get ordinary participation; later additions
use Bot. Existing members keep their saved roles.
If admin setup is interrupted, **Retry** on the opening message attempts to
finish it without restoring later demotions or removals. If setup is blocked,
choose **Abandon admin setup** in Outbox as soon as the chat exists. This keeps
the chat and current roles and stops unfinished setup in other windows. Then
retry the opening message, or send a new one if the original has expired.
Solo conversations continue at the chat's top level
rather than requiring a new thread for each reply. Where available, use
**Model and effort** in the composer before sending; Solo keeps those choices
for that chat until you reset them in the same control, even if its available
models change. If a loaded catalog no longer offers a saved choice, the
Expand Down
19 changes: 19 additions & 0 deletions docs/solo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ behavior on the label, so a rename touches copy only.
agents: answer as one channel-scoped, top-level conversation. It is not access
authority. The in-app agent harness reads it from the channel list; remote
harnesses that only read `about` need to learn the label.
- New Solo chats grant Admin to the creator's agents whose signed profiles verify
that ownership, including agents included through workspace defaults. Agents
owned by someone else keep ordinary participation. The app uses the existing
member-administration commands before releasing the opening message to local
agents or the relay. When the viewer owns the Solo chat, their own new agents
added later through the composer or Chat access receive Admin; other agents
join as Bot. Existing members keep
their saved roles; retries retain the original addition's role and command ID.
The create's local Outbox receipt retains the opening
admin targets across interruptions; retries reconstruct the same grants and
confirm their recorded IDs before sending. A recorded grant stays complete
after a later demotion or removal. Expired, unrecorded grants are never re-dated.
Outbox offers **Abandon admin setup** once the create is delivered. Confirming
retires its recovery receipt while keeping the chat and granted
roles. Grant publication and retirement share the receipt’s durable ownership
lock, so another window’s unfinished signature cannot publish after abandonment.
After confirming, retry the opening message with current roles or send a new
message if its signed timestamp has expired. This needs no relay update
and does not migrate existing members' roles or change tool-created grants.
- The Buzz tools' `channel_create` with `solo` sends the same create for any
caller, including the standalone stdio server: signed by the caller, with the
label and any `members` it names. The caller is the creator, so an agent's
Expand Down
7 changes: 5 additions & 2 deletions docs/solo/sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ people, agents and channels** for an owner who can add agents) filters current
access and lists people under **Not in this chat**, each with an **Add** button;
Enter adds the highlighted person. Adding is immediate and uses the Solo share rule
(`canShareSoloChat`), with per-person **Adding…**, error and **Retry** states. The
owner's selectable agents are offered too and join as Bot, even with a Guest
admission default, without starting a run. Composer mentions use the same grant.
owner's selectable agents are offered too. Agents whose signed profiles verify
that the chat owner owns them join as Admin; other agents join as Bot, even with
a Guest admission default, without starting a run. Composer mentions use the
same rule; other participants' composer additions use Bot.
Existing members keep their roles, and retries finish the original saved grant.
Where the viewer cannot add agents, a note says to mention an agent in the chat
instead.
Current access uses the channel groups (**People**, **Agents**) with Owner and
Expand Down
58 changes: 48 additions & 10 deletions src/bundled/channels/ChannelMembersDialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import type { VerifiedProfileAuthority } from "../../features/relay/verified-pro
import {
keypair,
metadata,
ownedProfile,
profile,
roster,
signed,
Expand Down Expand Up @@ -116,6 +117,7 @@ async function setup(
pendingMemberNames?: Promise<void>;
channelCreation?: boolean;
memberWrites?: boolean;
agentOwner?: "viewer" | "other";
searchProfiles?: (
query: string,
limit: number,
Expand All @@ -142,8 +144,9 @@ async function setup(
const viewer = keypair(),
relay = options.relay ?? keypair(),
person = keypair();
const agentKey = keypair();
const agent = {
pubkey: "ab".repeat(32),
pubkey: agentKey.pubkey,
name: "Fixture agent",
relayUrl: "wss://relay.example.test",
owner: viewer.pubkey,
Expand Down Expand Up @@ -214,6 +217,17 @@ async function setup(
? managedProfile(person, keypair(), 1)
: profile(person, { name: "Morgan" });
const stableEvents = [
...(localAgent
? [
eventDto(
await ownedProfile(
agentKey,
options.agentOwner === "other" ? person : viewer,
"Fixture agent",
),
),
]
: []),
signed(relay, {
kind: 39000,
content: "",
Expand Down Expand Up @@ -246,6 +260,20 @@ async function setup(
profile(viewer, { name: "Carl" }),
personProfile,
];
const currentRoster = () =>
type === "solo"
? signed(relay, {
kind: 39002,
created_at: clock,
content: "",
tags: [
["d", id],
...members.map((key) =>
key === viewer.pubkey ? ["p", key, "", "owner"] : ["p", key],
),
],
})
: roster(relay, id, members, clock);
const query = vi.fn(async (filters: Parameters<typeof matchesEvent>[1][]) => {
if (filters.some((filter) => filter.search)) {
if (searchFailure) throw new Error("Search offline");
Expand Down Expand Up @@ -282,8 +310,8 @@ async function setup(
roster(relay, forkId, forkMembers, clock),
]
: [];
return [roster(relay, id, members, clock), ...fork, ...stableEvents].filter(
(event) => filters.some((filter) => matchesEvent(event, filter)),
return [currentRoster(), ...fork, ...stableEvents].filter((event) =>
filters.some((filter) => matchesEvent(event, filter)),
);
});
const readAgentLibrary = vi.fn(
Expand Down Expand Up @@ -380,7 +408,8 @@ async function setup(
viewer,
replaceRoster: (keys: string[]) => {
members.splice(0, members.length, ...keys);
live?.receive([roster(relay, id, members, ++clock)]);
clock++;
live?.receive([currentRoster()]);
},
delayRoster: () => {
applyAddition = false;
Expand Down Expand Up @@ -2231,7 +2260,7 @@ it("shares the identity presentation with invitation rows without assigning a ch
expect(
within(row).queryByText("Agent", { exact: true }),
).not.toBeInTheDocument();
expect(within(row).queryByText(/Managed by/)).not.toBeInTheDocument();
expect(within(row).getByText("Managed by Carl (you)")).toBeVisible();
expect(
row.querySelector('[data-avatar-shape="squircle"]'),
).toBeInTheDocument();
Expand Down Expand Up @@ -3236,7 +3265,7 @@ it("lets the Solo owner add an agent without sending a message", async () => {
).toEqual([
["h", "11111111-1111-4111-8111-111111111111"],
["p", t.agent.pubkey],
["role", "bot"],
["role", "admin"],
]);
await t.user.click(screen.getByRole("button", { name: "Close" }));
await t.user.click(t.trigger);
Expand Down Expand Up @@ -3467,20 +3496,29 @@ it.each([false, true])(
},
);

it.each(["private", "public"] as const)(
"adds the Solo owner's agent as Bot in a %s chat with a Guest default",
async (visibility) => {
it.each(
(["private", "public"] as const).flatMap((visibility) =>
(["viewer", "other"] as const).map((agentOwner) => ({
visibility,
agentOwner,
role: agentOwner === "viewer" ? "admin" : "bot",
})),
),
)(
"adds an agent owned by $agentOwner as $role in a $visibility Solo chat with a Guest default",
async ({ visibility, agentOwner, role }) => {
const t = await setup("solo", false, true, undefined, undefined, {
visibility,
joinRole: "guest",
agentOwner,
});
await t.user.type(screen.getByRole("searchbox"), "Fixture agent");
await t.user.click(
await screen.findByRole("button", { name: /Add Fixture agent/ }),
);
await screen.findByText("Fixture agent added.");
expect(t.publish).toHaveBeenCalledOnce();
expect(t.publish.mock.calls[0]?.[0].tags).toContainEqual(["role", "bot"]);
expect(t.publish.mock.calls[0]?.[0].tags).toContainEqual(["role", role]);
},
);

Expand Down
8 changes: 8 additions & 0 deletions src/bundled/channels/ChannelsPage.solo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ vi.mock(
);

composerDOMFixture();
// Navigation fixtures deliberately never finish display-profile loading.
// Ownership authority is exercised in the Solo/admin session tests.
vi.mock("../../features/relay/solo-admins", async (original) => ({
...(await original<typeof import("../../features/relay/solo-admins")>()),
ownedSoloAgents: vi.fn<
typeof import("../../features/relay/solo-admins").ownedSoloAgents
>(async (_profiles, _viewer, keys) => new Set(keys)),
}));
const owners: ReturnType<typeof createRelaySession>[] = [];
afterEach(() => {
cleanup();
Expand Down
Loading
Loading