Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat: add onboarding task forums and ready-machine progression (#890)

Gustavo Yef109a6519be0
diff --git a/src/daemon/src/daemon/createDaemon.test.ts b/src/daemon/src/daemon/createDaemon.test.ts
index 2f9b8b2df..82bae6d2a 100644
--- a/src/daemon/src/daemon/createDaemon.test.ts
+++ b/src/daemon/src/daemon/createDaemon.test.ts
@@ -1,3 +1,4 @@
+import * as builtinDriverHost from "@alook/agent-driver/host";
import { describe, it, expect, vi, afterEach } from "vitest";
import { EventEmitter } from "events";
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -371,7 +372,16 @@ describe("createDaemon", () => {
const starts: Array<{ id: string; text: string }> = [];
const workingDirectoryBase = mkdtempSync(join(tmpdir(), "daemon-onboarding-context-"));
startupSweepDirs.push(workingDirectoryBase);
- vi.stubEnv("CODEX_HOME", join(workingDirectoryBase, "empty-codex-home"));
+ const sdk = builtinDriverHost.createBuiltinAgentDriverSdk();
+ const discover = vi.fn(async () => ({
+ ok: true as const,
+ sessionFiles: { capability: "supported" as const, items: [] },
+ recentProjects: [],
+ }));
+ vi.spyOn(builtinDriverHost, "createBuiltinAgentDriverSdk").mockReturnValue({
+ ...sdk,
+ discoverRecentContext: discover,
+ });
vi.stubGlobal("fetch", vi.fn(async (input: string | URL | Request) => {
const url = String(input);
if (url.includes("/enroll-agent")) return Response.json({ runnerKey: "runner_test" });
@@ -404,6 +414,11 @@ describe("createDaemon", () => {
}));
await vi.waitFor(() => expect(starts).toHaveLength(1));
+ expect(discover).toHaveBeenCalledWith({
+ backend: "codex",
+ recentSessionFilesTopK: 20,
+ recentProjectsTopK: 5,
+ });
expect(starts[0]!.text).toContain("Lead briefing\n\n## Recent local context");
expect(starts[0]!.text).toContain("No recent session files were found.");
} finally {
diff --git a/src/daemon/src/daemon/createDaemon.ts b/src/daemon/src/daemon/createDaemon.ts
index 6734e3ac9..3e154a878 100644
--- a/src/daemon/src/daemon/createDaemon.ts
+++ b/src/daemon/src/daemon/createDaemon.ts
@@ -71,8 +71,6 @@ export const RUNTIME_RAW_TRACE_AGENT_IDS_ENV = "ALOOK_RUNTIME_RAW_TRACE_AGENT_ID
/** How often the daemon rewrites the `daemon status` snapshot file (batch E2). */
const STATUS_WRITE_INTERVAL_MS = 5_000;
const TOKEN_USAGE_BACKENDS = new Set<BuiltinBackendId>(["claude", "codex", "grok", "opencode", "pi", "antigravity"]);
-const ONBOARDING_RECENT_SESSION_FILES_TOP_K = 10;
-const ONBOARDING_RECENT_PROJECTS_TOP_K = 5;
export function parseRuntimeRawTraceAgentIds(value: string | undefined): ReadonlySet<string> {
return new Set(
@@ -400,8 +398,6 @@ export async function createDaemon(opts: CreateDaemonOptions): Promise<RunningDa
const recentContextSdk = createBuiltinAgentDriverSdk();
const appendRecentContext = createRecentContextPromptAppender(
(input) => recentContextSdk.discoverRecentContext(input as never),
- ONBOARDING_RECENT_SESSION_FILES_TOP_K,
- ONBOARDING_RECENT_PROJECTS_TOP_K,
);
const fallbackBase = (process.env.ALOOK_PROJECT_ROOT || `${homedir()}/.alook`) + "/daemon";
const workingDirectoryBase = opts.workingDirectoryBase ?? fallbackBase;
diff --git a/src/daemon/src/daemon/recentContextPrompt.test.ts b/src/daemon/src/daemon/recentContextPrompt.test.ts
index 10b5358be..3c9ce9764 100644
--- a/src/daemon/src/daemon/recentContextPrompt.test.ts
+++ b/src/daemon/src/daemon/recentContextPrompt.test.ts
@@ -87,7 +87,7 @@ describe("appendRecentContextToPrompt", () => {
});
});
- it("defaults to ten recent sessions and five recent projects", async () => {
+ it("defaults to twenty recent sessions and five recent projects", async () => {
const discover = vi.fn(async () => ({
ok: true as const,
sessionFiles: { capability: "supported" as const, items: [] },
@@ -104,7 +104,7 @@ describe("appendRecentContextToPrompt", () => {
expect(discover).toHaveBeenCalledWith({
backend: "codex",
- recentSessionFilesTopK: 10,
+ recentSessionFilesTopK: 20,
recentProjectsTopK: 5,
});
});
diff --git a/src/daemon/src/daemon/recentContextPrompt.ts b/src/daemon/src/daemon/recentContextPrompt.ts
index 57a4966a2..a613b1b2e 100644
--- a/src/daemon/src/daemon/recentContextPrompt.ts
+++ b/src/daemon/src/daemon/recentContextPrompt.ts
@@ -70,7 +70,7 @@ export function appendRecentContextToPrompt(
export function createRecentContextPromptAppender(
discover: RecentContextDiscoverer,
- recentSessionFilesTopK = 10,
+ recentSessionFilesTopK = 20,
recentProjectsTopK = 5,
): (prompt: string, runtimeConfig: RuntimeConfig) => Promise<string> {
return async (prompt, runtimeConfig) => {
diff --git a/src/web/src/app/api/community/servers/[id]/onboard/route.test.ts b/src/web/src/app/api/community/servers/[id]/onboard/route.test.ts
index 8ebf78c38..a46cc5cf5 100644
--- a/src/web/src/app/api/community/servers/[id]/onboard/route.test.ts
+++ b/src/web/src/app/api/community/servers/[id]/onboard/route.test.ts
@@ -8,6 +8,7 @@ const mocks = vi.hoisted(() => ({
getBotWakeContext: vi.fn(),
getServer: vi.fn(),
listServerChannels: vi.fn(),
+ listCategories: vi.fn(),
markRead: vi.fn(),
push: vi.fn(),
fanOutServer: vi.fn(),
@@ -32,6 +33,9 @@ vi.mock("@alook/shared", async (importOriginal) => {
communityChannel: {
listServerChannels: (...args: unknown[]) => mocks.listServerChannels(...args),
},
+ communityCategory: {
+ listCategoriesByServer: (...args: unknown[]) => mocks.listCategories(...args),
+ },
communityServer: {
getServer: (...args: unknown[]) => mocks.getServer(...args),
},
@@ -127,9 +131,11 @@ describe("POST /api/community/servers/[id]/onboard", () => {
joinedAt: "2026-09-04T00:00:00.000Z",
}))
mocks.listServerChannels.mockResolvedValue([
- { id: "public-1", name: "all", type: "text" },
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ { id: "tasks-1", name: "tasks", type: "forum", categoryId: "public-cat" },
{ id: "private-1", name: "room", type: "text" },
])
+ mocks.listCategories.mockResolvedValue([{ id: "public-cat", private: 0 }])
mocks.createMessage.mockResolvedValue({
ok: true,
row: {
@@ -148,6 +154,35 @@ describe("POST /api/community/servers/[id]/onboard", () => {
mocks.broadcastToUser.mockResolvedValue(undefined)
})
+ it("injects the actual forum reference into every role's space", () => {
+ expect(onboardingPromptWithSpace("Wake", "Room#0042", "all", "Tasks")).toContain(
+ "- Public tasks forum: /Room#0042/Tasks",
+ )
+ })
+
+ it.each([
+ ["missing", null],
+ ["text channel", { id: "tasks-1", name: "tasks", type: "text", categoryId: "public-cat" }],
+ ["different category", { id: "tasks-1", name: "tasks", type: "forum", categoryId: "private-cat" }],
+ ])("rejects a %s tasks forum before membership or wake", async (_label, tasks) => {
+ mocks.listServerChannels.mockResolvedValue([
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ ...(tasks ? [tasks] : []),
+ ])
+ const response = await POST(request(onboardBody()), { params: { id: "server-1" } })
+ expect(response.status).toBe(409)
+ expect(mocks.addMember).not.toHaveBeenCalled()
+ expect(mocks.push).not.toHaveBeenCalled()
+ })
+
+ it("rejects a private tasks forum even when all is in the same category", async () => {
+ mocks.listCategories.mockResolvedValue([{ id: "public-cat", private: 1 }])
+ const response = await POST(request(onboardBody()), { params: { id: "server-1" } })
+ expect(response.status).toBe(409)
+ expect(mocks.addMember).not.toHaveBeenCalled()
+ expect(mocks.push).not.toHaveBeenCalled()
+ })
+
it("formats three or more teammate handles as an Oxford list", () => {
expect(onboardingGettingReadyMessage(["@One#0001", "@Two#0002", "@Three#0003"]))
.toContain("with @One#0001, @Two#0002, and @Three#0003")
@@ -234,17 +269,17 @@ describe("POST /api/community/servers/[id]/onboard", () => {
type: "agent:event",
agentId: "bot-a",
includeRecentContext: true,
- prompt: onboardingPromptWithSpace("Wake bot-a", "Ada-dev-room#5620", "all"),
+ prompt: onboardingPromptWithSpace("Wake bot-a", "Ada-dev-room#5620", "all", "tasks"),
}),
expect.objectContaining({
type: "agent:event",
agentId: "bot-b",
- prompt: onboardingPromptWithSpace("Wake bot-b", "Ada-dev-room#5620", "all"),
+ prompt: onboardingPromptWithSpace("Wake bot-b", "Ada-dev-room#5620", "all", "tasks"),
}),
expect.objectContaining({
type: "agent:event",
agentId: "bot-c",
- prompt: onboardingPromptWithSpace("Wake bot-c", "Ada-dev-room#5620", "all"),
+ prompt: onboardingPromptWithSpace("Wake bot-c", "Ada-dev-room#5620", "all", "tasks"),
}),
])
expect(mocks.push.mock.calls[1]![2]).not.toHaveProperty("includeRecentContext")
diff --git a/src/web/src/app/api/community/servers/[id]/onboard/route.ts b/src/web/src/app/api/community/servers/[id]/onboard/route.ts
index 91080284b..15d567743 100644
--- a/src/web/src/app/api/community/servers/[id]/onboard/route.ts
+++ b/src/web/src/app/api/community/servers/[id]/onboard/route.ts
@@ -39,6 +39,7 @@ export function onboardingPromptWithSpace(
prompt: string,
serverHandle: string,
channelName: string,
+ tasksChannelName: string,
) {
const serverRef = `/${serverHandle}`
return [
@@ -48,6 +49,7 @@ export function onboardingPromptWithSpace(
"",
`- Server: ${serverRef}`,
`- Public channel: ${serverRef}/${channelName}`,
+ `- Public tasks forum: ${serverRef}/${tasksChannelName}`,
].join("\n")
}
@@ -72,14 +74,25 @@ export const POST = withAuth(async (req: NextRequest, ctx) => {
bots.push({ bot, wakeContext, wakePrompt: requestedBot.wakePrompt })
}
- const publicChannel = (await queries.communityChannel.listServerChannels(db, serverId))
- .find((channel) => channel.name === "all" && channel.type === "text")
+ const channels = await queries.communityChannel.listServerChannels(db, serverId)
+ const publicChannel = channels.find((channel) => channel.name === "all" && channel.type === "text")
if (!publicChannel) return writeError("the new server is missing its public channel", 409)
+ const tasksChannel = channels.find((channel) => channel.name?.toLowerCase() === "tasks" && channel.type === "forum")
+ if (!tasksChannel || tasksChannel.categoryId !== publicChannel.categoryId) {
+ return writeError("the onboarding server is missing its public tasks forum beside all", 409)
+ }
+ if (tasksChannel.categoryId) {
+ const category = (await queries.communityCategory.listCategoriesByServer(db, serverId))
+ .find((entry) => entry.id === tasksChannel.categoryId)
+ if (!category || category.private) {
+ return writeError("the onboarding tasks forum must be public", 409)
+ }
+ }
const serverHandle = formatHandle(server.name, server.discriminator)
const eventBots = bots.map((entry) => ({
...entry,
- eventPrompt: onboardingPromptWithSpace(entry.wakePrompt, serverHandle, publicChannel.name),
+ eventPrompt: onboardingPromptWithSpace(entry.wakePrompt, serverHandle, publicChannel.name, tasksChannel.name),
}))
if (eventBots.some(({ eventPrompt }) => eventPrompt.length > AGENT_EVENT_PROMPT_MAX_LENGTH)) {
return writeError("wakePrompt is too long after adding the Alook space refs", 400)
diff --git a/src/web/src/components/community/onboarding/community-onboarding-form.tsx b/src/web/src/components/community/onboarding/community-onboarding-form.tsx
index c46c35d9c..8e0eedbd0 100644
--- a/src/web/src/components/community/onboarding/community-onboarding-form.tsx
+++ b/src/web/src/components/community/onboarding/community-onboarding-form.tsx
@@ -80,7 +80,7 @@ export function CommunityOnboardingForm() {
assert()
await queryClient.query({ ...options, select: undefined })
assert()
- return [...origin.registry!.collections.channels.values()].filter((channel) => channel.serverId === serverId && !channel.parentChannelId).map(({ id, name }) => ({ id, name }))
+ return [...origin.registry!.collections.channels.values()].filter((channel) => channel.serverId === serverId && !channel.parentChannelId).map(({ id, name, type, categoryId }) => ({ id, name, type, categoryId: categoryId ?? null }))
} finally { assert.signal.removeEventListener("abort", unsubscribe); unsubscribe() }
},
},
diff --git a/src/web/src/components/community/onboarding/initialize-community-onboarding.test.ts b/src/web/src/components/community/onboarding/initialize-community-onboarding.test.ts
index 1287ab745..67c537d6a 100644
--- a/src/web/src/components/community/onboarding/initialize-community-onboarding.test.ts
+++ b/src/web/src/components/community/onboarding/initialize-community-onboarding.test.ts
@@ -73,10 +73,12 @@ describe("initializeCommunityOnboarding", () => {
.mockResolvedValueOnce({ server: { id: "server-1" } })
.mockResolvedValueOnce({
channels: [
- { id: "public-1", name: "all" },
- { id: "private-1", name: "room" },
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ { id: "private-1", name: "room", type: "text", categoryId: "private-cat" },
],
})
+ .mockResolvedValueOnce({ channel: { id: "tasks-1", name: "tasks", type: "forum", categoryId: "public-cat" } })
+ .mockResolvedValueOnce({ ok: true })
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
@@ -107,7 +109,15 @@ describe("initializeCommunityOnboarding", () => {
expect(result.bots.map(({ id }) => owner.registry.collections.profiles.get(id))).toMatchObject([
{ name: "Lin", discriminator: "0001" }, { name: "Kit", discriminator: "0002" }, { name: "Moss", discriminator: "0003" },
])
- expect(apiFetch).toHaveBeenCalledTimes(10)
+ expect(apiFetch).toHaveBeenNthCalledWith(6, "/api/community/channels", expect.objectContaining({
+ method: "POST",
+ body: JSON.stringify({ serverId: "server-1", name: "tasks", type: "forum", categoryId: "public-cat" }),
+ }))
+ expect(apiFetch).toHaveBeenNthCalledWith(7, "/api/community/servers/server-1/channels/reorder", expect.objectContaining({
+ method: "PATCH",
+ body: JSON.stringify({ channelIds: ["public-1", "tasks-1", "private-1"] }),
+ }))
+ expect(apiFetch).toHaveBeenCalledTimes(12)
for (const [index, template] of pack.bots.entries()) {
expect(apiFetch).toHaveBeenNthCalledWith(index + 1, "/api/community/bots", expect.objectContaining({
method: "POST",
@@ -120,7 +130,7 @@ describe("initializeCommunityOnboarding", () => {
}),
}))
}
- const onboardPayload = JSON.parse(apiFetch.mock.calls[5]![1].body)
+ const onboardPayload = JSON.parse(apiFetch.mock.calls[7]![1].body)
expect(onboardPayload.leadBotId).toBe("bot-lin")
expect(onboardPayload.bots.map((bot: { id: string }) => bot.id)).toEqual([
"bot-lin",
@@ -131,18 +141,19 @@ describe("initializeCommunityOnboarding", () => {
expect(onboardPayload.bots[0].wakePrompt).toContain("@Ada Lovelace#0042")
expect(onboardPayload.bots[1].wakePrompt).toContain("Send exactly one short sentence")
expect(onboardPayload.bots[2].wakePrompt).toContain("You are the Reviewer")
- expect(apiFetch.mock.calls.slice(5, 8).map((call) => JSON.parse(call[1].body).action)).toEqual([
+ expect(apiFetch.mock.calls.slice(7, 10).map((call) => JSON.parse(call[1].body).action)).toEqual([
{ type: "wake", botId: "bot-lin" },
{ type: "wake", botId: "bot-kit" },
{ type: "wake", botId: "bot-moss" },
])
- expect(JSON.parse(apiFetch.mock.calls[8]![1].body).action).toEqual({ type: "finalize" })
- expect(apiFetch).toHaveBeenNthCalledWith(10, "/api/community/channels/private-1/members", expect.objectContaining({
+ expect(JSON.parse(apiFetch.mock.calls[10]![1].body).action).toEqual({ type: "finalize" })
+ expect(apiFetch).toHaveBeenNthCalledWith(12, "/api/community/channels/private-1/members", expect.objectContaining({
method: "POST",
body: JSON.stringify({ userId: "bot-lin" }),
}))
expect(checkpoints.at(-1)).toMatchObject({
botsOnboarded: true,
+ tasksChannelId: "tasks-1",
leadAddedToPrivate: true,
})
})
@@ -154,10 +165,12 @@ describe("initializeCommunityOnboarding", () => {
.mockResolvedValueOnce({ server: { id: "server-1" } })
.mockResolvedValueOnce({
channels: [
- { id: "public-1", name: "all" },
- { id: "private-1", name: "room" },
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ { id: "private-1", name: "room", type: "text", categoryId: "private-cat" },
],
})
+ .mockResolvedValueOnce({ channel: { id: "tasks-1", name: "tasks", type: "forum", categoryId: "public-cat" } })
+ .mockResolvedValueOnce({ ok: true })
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
.mockResolvedValueOnce({ onboarded: 0, finalized: true })
@@ -197,6 +210,7 @@ describe("initializeCommunityOnboarding", () => {
serverId: "server-1",
publicChannelId: "public-1",
privateChannelId: "private-1",
+ tasksChannelId: "tasks-1",
botsOnboarded: true,
},
})
@@ -218,6 +232,7 @@ describe("initializeCommunityOnboarding", () => {
serverId: "server-1",
publicChannelId: "public-1",
privateChannelId: "private-1",
+ tasksChannelId: "tasks-1",
}
apiFetch
.mockResolvedValueOnce({ onboarded: 1, finalized: false })
@@ -258,6 +273,82 @@ describe("initializeCommunityOnboarding", () => {
])
})
+ it.each(["creation-response", "reorder"])("recovers a failed %s without duplicating resources or waking early", async (failure) => {
+ const checkpoint: OnboardingInitializationCheckpoint = {
+ bots: [{ key: "lead", id: "bot-a" }, { key: "doer", id: "bot-b" }],
+ serverId: "server-1",
+ }
+ const all = { id: "public-1", name: "all", type: "text", categoryId: "public-cat" }
+ const room = { id: "private-1", name: "room", type: "text", categoryId: "private-cat" }
+ const tasks = { id: "tasks-1", name: "tasks", type: "forum", categoryId: "public-cat" }
+ const checkpoints: OnboardingInitializationCheckpoint[] = []
+ apiFetch.mockResolvedValueOnce({ channels: [all, room] })
+ if (failure === "reorder") apiFetch.mockResolvedValueOnce({ channel: tasks })
+ apiFetch.mockRejectedValueOnce(new Error("connection lost"))
+
+ await expect(initializeCommunityOnboarding({
+ machineId: "machine-1", runtime: "codex", identity: "founder", userName: "Grace", checkpoint,
+ onCheckpoint: (next) => checkpoints.push(next),
+ })).rejects.toThrow("connection lost")
+ expect(checkpoints.at(-1)).not.toHaveProperty("tasksChannelId")
+ expect(apiFetch.mock.calls.some(([path]) => path.endsWith("/onboard"))).toBe(false)
+
+ apiFetch
+ .mockResolvedValueOnce({ channels: [all, room, tasks] })
+ .mockResolvedValueOnce({ ok: true })
+ .mockResolvedValueOnce({ onboarded: 1, finalized: false })
+ .mockResolvedValueOnce({ onboarded: 1, finalized: false })
+ .mockResolvedValueOnce({ onboarded: 0, finalized: true })
+ .mockResolvedValueOnce({ ok: true })
+ await initializeCommunityOnboarding({
+ machineId: "machine-1", runtime: "codex", identity: "founder", userName: "Grace",
+ checkpoint: checkpoints.at(-1), onCheckpoint: (next) => checkpoints.push(next),
+ })
+ expect(apiFetch.mock.calls.filter(([path]) => path === "/api/community/channels")).toHaveLength(1)
+ expect(apiFetch.mock.calls.filter(([path]) => path === "/api/community/bots" || path === "/api/community/servers")).toHaveLength(0)
+ expect(checkpoints.at(-1)).toMatchObject({ tasksChannelId: "tasks-1", botsOnboarded: true })
+ })
+
+ it("adds tasks to an older completed checkpoint without replaying completed bot wakes", async () => {
+ apiFetch
+ .mockResolvedValueOnce({ channels: [
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ { id: "private-1", name: "room", type: "text", categoryId: "private-cat" },
+ ] })
+ .mockResolvedValueOnce({ channel: { id: "tasks-1", name: "tasks", type: "forum", categoryId: "public-cat" } })
+ .mockResolvedValueOnce({ ok: true })
+ await initializeCommunityOnboarding({
+ machineId: "machine-1", runtime: "codex", identity: "founder", userName: "Grace",
+ checkpoint: {
+ bots: [{ key: "lead", id: "bot-a" }, { key: "doer", id: "bot-b" }],
+ serverId: "server-1", publicChannelId: "public-1", privateChannelId: "private-1",
+ botsOnboarded: true, leadAddedToPrivate: true,
+ },
+ })
+ expect(apiFetch.mock.calls.map(([path]) => path)).toEqual([
+ "/api/community/servers/server-1/channels", "/api/community/channels",
+ "/api/community/servers/server-1/channels/reorder",
+ ])
+ })
+
+ it.each([
+ { type: "text", categoryId: "public-cat" },
+ { type: "forum", categoryId: "private-cat" },
+ ])("rejects a conflicting tasks channel (%j) before waking bots", async (tasks) => {
+ apiFetch.mockResolvedValueOnce({ channels: [
+ { id: "public-1", name: "all", type: "text", categoryId: "public-cat" },
+ { id: "private-1", name: "room", type: "text", categoryId: "private-cat" },
+ { id: "tasks-1", name: "tasks", ...tasks },
+ ] })
+ await expect(initializeCommunityOnboarding({
+ machineId: "machine-1", runtime: "codex", identity: "founder", userName: "Grace",
+ checkpoint: {
+ bots: [{ key: "lead", id: "bot-a" }, { key: "doer", id: "bot-b" }], serverId: "server-1",
+ },
+ })).rejects.toThrow("The tasks channel must be a public forum beside all")
+ expect(apiFetch).toHaveBeenCalledOnce()
+ })
+
it("rejects a checkpoint that cannot restore the complete selected team", async () => {
apiFetch
.mockResolvedValueOnce({ bot: { id: "" } })
diff --git a/src/web/src/components/community/onboarding/initialize-community-onboarding.ts b/src/web/src/components/community/onboarding/initialize-community-onboarding.ts
index 10a7f8878..c5ea67138 100644
--- a/src/web/src/components/community/onboarding/initialize-community-onboarding.ts
+++ b/src/web/src/components/community/onboarding/initialize-community-onboarding.ts
@@ -31,7 +31,7 @@ export type OnboardingBotCreateResponse = {
}
}
type ServerCreateResponse = { server: { id: string; name?: string } }
-type ChannelRow = { id: string; name: string }
+type ChannelRow = { id: string; name: string; type: string; categoryId: string | null }
const ROOM_NAMES: Record<string, string> = {
office: "work-room",
@@ -140,7 +140,7 @@ export async function initializeCommunityOnboarding({
if (!serverId) throw new Error("Setup progress could not be restored")
onProgress?.("inviting-bots")
- if (!progress.publicChannelId || !progress.privateChannelId) {
+ if (!progress.publicChannelId || !progress.privateChannelId || !progress.tasksChannelId) {
const channels = await services.readChannels(serverId)
services.assert()
const publicChannel = channels.find((channel) => channel.name === "all")
@@ -149,6 +149,31 @@ export async function initializeCommunityOnboarding({
throw new Error("The new room is missing its default channels")
}
save({ publicChannelId: publicChannel.id, privateChannelId: privateChannel.id })
+ if (!publicChannel.id || !privateChannel.id) throw new Error("Default channels could not be restored")
+ if (!progress.tasksChannelId) {
+ let tasksChannel = channels.find((channel) => channel.name.toLowerCase() === "tasks")
+ if (tasksChannel && (tasksChannel.type !== "forum" || tasksChannel.categoryId !== publicChannel.categoryId)) {
+ throw new Error("The tasks channel must be a public forum beside all")
+ }
+ if (!tasksChannel) {
+ const created = await services.request<{ channel: ChannelRow }>("/api/community/channels", {
+ method: "POST",
+ body: JSON.stringify({ serverId, name: "tasks", type: "forum", categoryId: publicChannel.categoryId }),
+ })
+ services.assert()
+ tasksChannel = created.channel
+ }
+ if (!tasksChannel?.id) throw new Error("The tasks forum could not be restored")
+ await services.request(`/api/community/servers/${serverId}/channels/reorder`, {
+ method: "PATCH",
+ body: JSON.stringify({ channelIds: [
+ publicChannel.id,
+ tasksChannel.id,
+ ...channels.filter((channel) => channel.id !== publicChannel.id && channel.id !== tasksChannel.id).map((channel) => channel.id),
+ ] }),
+ })
+ save({ tasksChannelId: tasksChannel.id })
+ }
}
const { publicChannelId, privateChannelId } = progress
diff --git a/src/web/src/components/community/onboarding/onboarding-machine-dialog.dom.test.ts b/src/web/src/components/community/onboarding/onboarding-machine-dialog.dom.test.ts
index d1a5b0055..77cc1b606 100644
--- a/src/web/src/components/community/onboarding/onboarding-machine-dialog.dom.test.ts
+++ b/src/web/src/components/community/onboarding/onboarding-machine-dialog.dom.test.ts
@@ -2,16 +2,18 @@ import React from "react"
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"
import { act, fireEvent } from "@/test/react-dom-harness"
import { renderCommunity as render } from "@/test/community-owner-harness"
+import type { CommunityMachineSummary } from "@alook/shared"
const mocks = vi.hoisted(() => ({
apiFetch: vi.fn(),
refetch: vi.fn(),
+ machines: [] as Pick<CommunityMachineSummary, "id" | "hostname" | "status" | "availableRuntimes">[],
}))
vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }))
vi.mock("@/lib/api/client", () => ({ apiFetch: mocks.apiFetch }))
vi.mock("@/hooks/community/use-machines", () => ({
- useMachines: () => ({ machines: [], isSuccess: true, refetch: mocks.refetch }),
+ useMachines: () => ({ machines: mocks.machines, isSuccess: true, refetch: mocks.refetch }),
}))
vi.mock("@/components/community/machines/pair-machine-sheet", () => ({
buildPairCommand: (tokenId: string) => `pair ${tokenId}`,
@@ -39,11 +41,71 @@ const mockedSteps = vi.mocked(PairMachineSteps)
describe("OnboardingMachineDialog", () => {
beforeEach(() => {
vi.clearAllMocks()
+ mocks.apiFetch.mockReset()
+ mocks.machines = []
vi.useFakeTimers()
})
afterEach(() => vi.useRealTimers())
+ const props = () => ({
+ open: true,
+ harness: "codex",
+ harnessLabel: "Codex",
+ onConnected: vi.fn(),
+ onChooseAnotherHarness: vi.fn(),
+ onManageMachines: vi.fn(),
+ })
+
+ it("advances an already online matching machine once without pairing or clicking Continue", () => {
+ mocks.machines = [{ id: "machine-1", hostname: "host", status: "online", availableRuntimes: [{ id: "codex", status: "healthy" }] }]
+ const input = props()
+ const view = render(React.createElement(OnboardingMachineDialog, input))
+ expect(input.onConnected).toHaveBeenCalledExactlyOnceWith("machine-1")
+ expect(mocks.apiFetch).not.toHaveBeenCalled()
+ view.rerender(React.createElement(OnboardingMachineDialog, { ...input, onConnected: (id) => input.onConnected(id) }))
+ expect(input.onConnected).toHaveBeenCalledOnce()
+ })
+
+ it("advances when an offline machine becomes online with the selected harness", () => {
+ mocks.machines = [{ id: "machine-1", hostname: "host", status: "offline", availableRuntimes: [{ id: "codex", status: "healthy" }] }]
+ mocks.apiFetch.mockReturnValue(new Promise(() => undefined))
+ const input = props()
+ const view = render(React.createElement(OnboardingMachineDialog, input))
+ expect(input.onConnected).not.toHaveBeenCalled()
+ mocks.machines = [{ ...mocks.machines[0], status: "online" }]
+ view.rerender(React.createElement(OnboardingMachineDialog, input))
+ expect(input.onConnected).toHaveBeenCalledExactlyOnceWith("machine-1")
+ })
+
+ it.each([
+ { label: "wrong harness", availableRuntimes: [{ id: "claude-code", status: "healthy" as const }] },
+ { label: "unhealthy harness", availableRuntimes: [{ id: "codex", status: "unhealthy" as const }] },
+ { label: "missing harness", availableRuntimes: [] },
+ ])("waits when the online machine has a $label", ({ availableRuntimes }) => {
+ mocks.machines = [{ id: "machine-1", hostname: "host", status: "online", availableRuntimes }]
+ mocks.apiFetch.mockReturnValue(new Promise(() => undefined))
+ const input = props()
+ render(React.createElement(OnboardingMachineDialog, input))
+ expect(input.onConnected).not.toHaveBeenCalled()
+ })
+
+ it("does not advance a closed dialog but advances when opened", () => {
+ mocks.machines = [{ id: "machine-1", hostname: "host", status: "online", availableRuntimes: [{ id: "codex", status: "healthy" }] }]
+ const input = props()
+ const view = render(React.createElement(OnboardingMachineDialog, { ...input, open: false }))
+ expect(input.onConnected).not.toHaveBeenCalled()
+ view.rerender(React.createElement(OnboardingMachineDialog, input))
+ expect(input.onConnected).toHaveBeenCalledExactlyOnceWith("machine-1")
+ })
+
+ it("automatically advances online preview without creating a pairing token", () => {
+ const input = props()
+ render(React.createElement(OnboardingMachineDialog, { ...input, previewConnectedMachine: { id: "preview-machine", hostname: "Preview" } }))
+ expect(input.onConnected).toHaveBeenCalledExactlyOnceWith("preview-machine")
+ expect(mocks.apiFetch).not.toHaveBeenCalled()
+ })
+
it("coalesces overlapping command generation attempts", async () => {
let resolvePair!: (value: { tokenId: string; expiresAt: string }) => void
mocks.apiFetch.mockReturnValue(new Promise((resolve) => {
diff --git a/src/web/src/components/community/onboarding/onboarding-machine-dialog.tsx b/src/web/src/components/community/onboarding/onboarding-machine-dialog.tsx
index da161f056..28fed54a1 100644
--- a/src/web/src/components/community/onboarding/onboarding-machine-dialog.tsx
+++ b/src/web/src/components/community/onboarding/onboarding-machine-dialog.tsx
@@ -64,6 +64,15 @@ export function OnboardingMachineDialog({
[harness, machines],
)
const autoMint = useCreateAtom<AbortSignal | null>(null)
+ const autoAdvance = useCreateAtom<AbortSignal | null>(null)
+ const readyMachineId = previewConnectedMachine?.id ?? onlineMachine?.id
+ useEffect(() => {
+ if (!open) { autoAdvance.set(null); return }
+ if (!readyMachineId || autoAdvance.get() === source.signal) return
+ source.capture()()
+ autoAdvance.set(source.signal)
+ onConnected(readyMachineId)
+ }, [open, readyMachineId, source, onConnected, autoAdvance])
const generation = useMutation({ meta: { observabilityAction: "machine.pair.generate" },
mutationKey: ["community", "onboarding-machine-pair", harness], gcTime: 0,
mutationFn: async ({ token, assert }: { token: ReturnType<typeof origin.begin>["token"]; assert: ReturnType<typeof source.capture> }) => {
diff --git a/src/web/src/components/community/onboarding/onboarding-select-dialog.tsx b/src/web/src/components/community/onboarding/onboarding-select-dialog.tsx
index 98e6d9ed5..2a5c00b37 100644
--- a/src/web/src/components/community/onboarding/onboarding-select-dialog.tsx
+++ b/src/web/src/components/community/onboarding/onboarding-select-dialog.tsx
@@ -233,7 +233,7 @@ export function OnboardingSelectDialog({
data-disabled={option.disabled || locked || undefined}
data-selected={selected || undefined}
className={cn(
- "min-h-14 cursor-pointer rounded-lg border-0 bg-transparent px-2 py-3 text-left shadow-none transition-colors duration-150 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border-0 *:data-[slot=field]:p-0 hover:bg-accent/50 active:bg-accent has-focus-visible:ring-3 has-focus-visible:ring-ring/40 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-muted/40 data-[disabled=true]:text-muted-foreground",
+ "min-h-14 cursor-pointer justify-center rounded-lg border-0 bg-transparent px-2 py-3 text-left shadow-none transition-colors duration-150 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border-0 *:data-[slot=field]:p-0 hover:bg-accent/50 active:bg-accent has-focus-visible:ring-3 has-focus-visible:ring-ring/40 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-muted/40 data-[disabled=true]:text-muted-foreground",
selected && "bg-accent",
)}
>
diff --git a/src/web/src/components/community/onboarding/starter-packs.test.ts b/src/web/src/components/community/onboarding/starter-packs.test.ts
index 095c3bcd2..e0555f904 100644
--- a/src/web/src/components/community/onboarding/starter-packs.test.ts
+++ b/src/web/src/components/community/onboarding/starter-packs.test.ts
@@ -84,14 +84,14 @@ describe("starter packs", () => {
expect(prompts[0]).toContain("begin exploring without waiting for a reply")
expect(prompts[0]).toContain("Exploration is read-only")
expect(prompts[0]).toContain("After you finish exploring")
- expect(prompts[0]).toContain("offers up to three concrete action suggestions")
+ expect(prompts[0]).toContain("offers up to three concrete directions")
expect(prompts[0]).toContain("Then wait for the owner to choose, redirect, or confirm an action")
- expect(prompts[0]).toContain("Do not open a task thread, assign work, or begin executing")
- expect(prompts[0]).toContain("Open a task thread only after the owner chooses or assigns concrete work")
+ expect(prompts[0]).toContain("Do not create a task post, assign work, or begin executing")
+ expect(prompts[0]).toContain("Create a post in the exact tasks forum listed there only after the owner chooses or assigns concrete work")
expect(prompts[0].indexOf("begin exploring without waiting for a reply")).toBeLessThan(
prompts[0].indexOf("After you finish exploring"),
)
- expect(prompts[0].indexOf("offers up to three concrete action suggestions")).toBeLessThan(
+ expect(prompts[0].indexOf("offers up to three concrete directions")).toBeLessThan(
prompts[0].indexOf("Then wait for the owner to choose, redirect, or confirm an action"),
)
expect(prompts[0]).toContain("grounded in what the owner has actually been working on")
@@ -111,6 +111,34 @@ describe("starter packs", () => {
}
})
+ it.each(["office", "developer", "founder", "home", "ceramics studio"])(
+ "routes %s work to task posts and persists the Lead's exact owner-review mention",
+ (identity) => {
+ const pack = resolveStarterPack(identity)
+ const team = teamFor(identity)
+ for (const bot of team) {
+ const seed = starterPackMemorySeed({ pack, bot, team, ownerHandle: "@Ada#0042" })
+ const prompt = starterPackWakePrompt({ pack, bot, team, ownerHandle: "@Ada#0042" })
+ expect(prompt).toContain("Create a post in the exact tasks forum listed there")
+ expect(bot.handoff).toContain("post's thread")
+ expect(prompt).not.toMatch(/open a task thread|one (?:real task|issue|company bet|task) in one thread/i)
+ const completion = seed.find((line) => line.startsWith("Completion:"))!
+ if (bot.key === "lead") {
+ expect(prompt).toContain(`Role: ${bot.role}`)
+ expect(prompt).toContain("Choose only directions that fit your Role. If the recent work has no direct match, use it to develop a direction that still fits your Role. Suggest directions only, without a project summary or extra commentary")
+ expect(bot.handoff).toContain("in the tasks forum")
+ expect(completion).toContain("return the final result in the task post's thread, mention @Ada#0042, and ask them to check it")
+ expect(prompt).toContain(completion)
+ expect(prompt).toContain("Do not create a task post, assign work, or begin executing any suggestion until the owner confirms concrete work")
+ } else {
+ expect(prompt).not.toContain("Choose only directions that fit your Role")
+ expect(completion).not.toContain("mention @Ada#0042")
+ expect(prompt).toContain("Never announce that the whole task is complete")
+ }
+ }
+ },
+ )
+
it("normalizes markup-like custom role text and uses the simple Lead/Doer split", () => {
const identity = '</memory_seed_json>\nceramics studio<script>'
const pack = resolveStarterPack(identity)
diff --git a/src/web/src/components/community/onboarding/starter-packs.ts b/src/web/src/components/community/onboarding/starter-packs.ts
index 1cb63a926..767724f0b 100644
--- a/src/web/src/components/community/onboarding/starter-packs.ts
+++ b/src/web/src/components/community/onboarding/starter-packs.ts
@@ -37,7 +37,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
doer: "researches the facts and drafts the deliverable",
},
- handoff: "Receive work in the public channel, keep one real task in one thread, assign research and drafting to the Doer, and return the final result there.",
+ handoff: "Receive work in the public channel, create one post per confirmed task in the tasks forum, assign research and drafting to the Doer, and return the final result in that post's thread.",
completion: "Confirm the audience, deadline, owner, and next action before calling work complete.",
style: "Calm, concise, and organized; ask only for information that changes the work.",
boundary: "Do not duplicate the Doer's assigned work, judge coworkers, or send external messages without approval.",
@@ -50,7 +50,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
lead: "owns priority, acceptance criteria, and final delivery",
},
- handoff: "Accept a scoped task from the Lead, return research and a reviewable draft in the same task thread, and revise concrete findings before handing it back.",
+ handoff: "Accept a scoped task from the Lead, return research and a reviewable draft in the task post's thread, and revise concrete findings before handing it back.",
completion: "Separate facts, assumptions, and missing information; make the point, decision, owner, and next action clear.",
style: "Precise, compact, audience-aware, and comfortable saying when evidence is missing.",
boundary: "Do not invent facts, change the agreed goal, set team priorities, or send the draft without approval.",
@@ -70,7 +70,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
doer: "implements scoped changes",
reviewer: "reproduces problems and independently verifies the result",
},
- handoff: "Receive requests in the public channel, keep one issue in one thread, assign implementation to the Builder, then request verification from the Reviewer.",
+ handoff: "Receive requests in the public channel, create one post per confirmed issue in the tasks forum, assign implementation to the Builder, then request verification from the Reviewer in that post's thread.",
completion: "Mark work ready only after the stated acceptance criteria and relevant checks pass; leave merge and release decisions to the owner.",
style: "Direct, technical, and evidence-led; inspect code or reproduce the issue before claiming a cause.",
boundary: "Do not compete with the Builder for the same edit, bypass review, merge, deploy, or expand scope without approval.",
@@ -84,7 +84,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
lead: "owns scope and acceptance criteria",
reviewer: "reviews the diff and test evidence",
},
- handoff: "Accept a scoped task from the Tech Lead, report changed files and behavior, run relevant checks, then hand the result to the Reviewer.",
+ handoff: "Accept a scoped task from the Tech Lead, report changed files and behavior in the task post's thread, run relevant checks, then hand the result to the Reviewer there.",
completion: "Provide a reviewable diff, test results, and any known limitation; say clearly when a check could not run.",
style: "Prefer small diffs, existing project conventions, and working code over speculative redesigns.",
boundary: "Do not rewrite unrelated code, hide failing tests, merge, deploy, or enlarge scope without Lead and owner approval.",
@@ -98,7 +98,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
lead: "owns the task and final summary",
doer: "owns implementation and responds to concrete findings",
},
- handoff: "Review the Builder's result in the same issue thread, return pass or fail with evidence, and send required changes back through the Tech Lead.",
+ handoff: "Review the Builder's result in the task post's thread, return pass or fail with evidence, and send required changes back through the Tech Lead.",
completion: "Map verification to the acceptance criteria and distinguish blockers from optional improvements.",
style: "Skeptical, specific, and fair; criticize behavior and risk, not the person.",
boundary: "Do not rewrite the implementation unless assigned, block over personal style, merge, deploy, or announce the whole task complete.",
@@ -117,8 +117,8 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
doer: "finds customer evidence and turns it into a concrete go-to-market experiment",
},
- handoff: "Receive work in the public channel, keep one company bet in one thread, ask the Doer for evidence and an action grounded in it, then assemble the final plan.",
- completion: "Record the decision, owner, success condition, review date, and unresolved risk in the same thread.",
+ handoff: "Receive work in the public channel, create one post per confirmed company bet in the tasks forum, ask the Doer for evidence and an action grounded in it, then assemble the final plan in that post's thread.",
+ completion: "Record the decision, owner, success condition, review date, and unresolved risk in the task post's thread.",
style: "Practical, candid, and persistent about promises and dates; surface contradictions without drama.",
boundary: "Do not call yourself a cofounder, make equity or personnel decisions, or present an untested assumption as company truth.",
},
@@ -130,7 +130,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
lead: "sets the company question, priority, and final plan",
},
- handoff: "Accept one defined hypothesis from the Lead, label evidence, inference, and unknowns, then return the smallest useful experiment with copy, channel, metric, and end date.",
+ handoff: "Accept one defined hypothesis from the Lead, label evidence, inference, and unknowns, then return the smallest useful experiment with copy, channel, metric, and end date in the task post's thread.",
completion: "State the audience, evidence, promise, distribution action, success threshold, and what the result will teach.",
style: "Curious, concrete, economical, and resistant to confirmation bias and generic claims.",
boundary: "Do not invent customer pain or quotes, declare product-market fit from anecdotes, or launch externally without approval.",
@@ -149,7 +149,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
doer: "builds practical plans and verifies prices, rules, availability, and safety details",
},
- handoff: "Receive requests in the public channel, keep work involving time or people in one thread, assign the plan and checks to the Doer, then collect confirmations.",
+ handoff: "Receive requests in the public channel, create one post per confirmed household task in the tasks forum, assign the plan and checks to the Doer, then collect confirmations in that post's thread.",
completion: "Record who is involved, the agreed time, decisions still open, and the next person who needs to respond.",
style: "Warm, clear, neutral, and easy for nontechnical family members to read.",
boundary: "Do not command family members, assign blame, mediate relationships, or reveal one person's private conversation to the household.",
@@ -162,7 +162,7 @@ const PRESET_PACKS: Record<Exclude<StarterPack["id"], "custom">, StarterPack> =
collaboratorNotes: {
lead: "confirms participants, constraints, and final decisions",
},
- handoff: "Ask the Lead for missing constraints, offer two or three practical options, verify prices, timing, rules, and availability, then return a ready-to-confirm plan.",
+ handoff: "Ask the Lead for missing constraints, offer two or three practical options, verify prices, timing, rules, and availability, then return a ready-to-confirm plan in the task post's thread.",
completion: "Include time, cost range, participants, restrictions, needed bookings or purchases, source dates, and a short checklist.",
style: "Friendly, practical, cautious, and concise; narrow choices instead of flooding the family with options.",
boundary: "Do not choose how the family spends money, ignore dietary or accessibility constraints, diagnose medical issues, or make purchases without approval.",
@@ -188,7 +188,7 @@ function customPack(identity: string): StarterPack {
collaboratorNotes: {
doer: "does the scoped work and returns concrete results",
},
- handoff: "Receive requests in the public channel, keep one task in one thread, give the Doer a clear scope, and return the final result.",
+ handoff: "Receive requests in the public channel, create one post per confirmed task in the tasks forum, give the Doer a clear scope, and return the final result in that post's thread.",
completion: "State the goal, owner, next action, and any unresolved question.",
style: "Clear, concise, and practical.",
boundary: "Do not expand scope, send externally, spend money, or make irreversible decisions without approval.",
@@ -200,7 +200,7 @@ function customPack(identity: string): StarterPack {
collaboratorNotes: {
lead: "owns the brief, priorities, and final delivery",
},
- handoff: "Accept a scoped task from the Lead, report the work and evidence in the same thread, and hand the result back for final delivery.",
+ handoff: "Accept a scoped task from the Lead, report the work and evidence in the task post's thread, and hand the result back for final delivery.",
completion: "Return the requested result, what was checked, and any limitation.",
style: "Direct, careful, and action-oriented.",
boundary: "Do not change the goal, claim unverified facts, send externally, or announce the whole task complete.",
@@ -249,7 +249,7 @@ export function starterPackMemorySeed({
`Role: ${bot.role}`,
`Collaborators: ${collaborators}.`,
`Handoff: ${bot.handoff}`,
- `Completion: ${bot.completion}`,
+ `Completion: ${bot.completion}${bot.key === "lead" ? ` After completing the work, return the final result in the task post's thread, mention ${ownerHandle}, and ask them to check it.` : ""}`,
`Style: ${bot.style}`,
`Boundary: ${bot.boundary}`,
]
@@ -280,7 +280,7 @@ export function starterPackWakePrompt({
"",
"## How this team works",
"",
- "Read the exact public channel listed in the Alook space section below before doing anything else. Open a task thread only after the owner chooses or assigns concrete work, then keep that work and its handoffs in the same thread.",
+ "Read the exact public channel listed in the Alook space section below before doing anything else. Create a post in the exact tasks forum listed there only after the owner chooses or assigns concrete work. Keep execution, handoffs, review, and final delivery in that post's thread.",
]
if (bot.key === "lead") {
@@ -288,7 +288,7 @@ export function starterPackWakePrompt({
"",
"## Your first move",
"",
- `You are the Lead. After saving your memory, read the public channel and review only the recent-context index appended below. Before opening or reading any specific session or project, send one brief message in the public channel that mentions ${ownerHandle}, explains what you propose to explore and why, and invites the owner to guide or redirect you. Once that message is sent, begin exploring without waiting for a reply. Exploration is read-only: inspect only the relevant sessions or projects, following the selective-reading instructions below. After you finish exploring, send one brief message in the public channel that mentions ${ownerHandle} and offers up to three concrete action suggestions grounded in what the owner has actually been working on. Then wait for the owner to choose, redirect, or confirm an action. Do not open a task thread, assign work, or begin executing any suggestion until the owner confirms concrete work. Do not paste private paths or unrelated content into Alook. If no useful recent context exists, ask the owner what they want to start with and wait instead of inventing generic suggestions. If a Lead already posted the pre-exploration message, do not repeat it. If the Lead already posted action suggestions, do not repeat or begin them; follow the owner's latest guidance.`,
+ `You are the Lead. After saving your memory, read the public channel and review only the recent-context index appended below. Choose only directions that fit your Role. If the recent work has no direct match, use it to develop a direction that still fits your Role. Suggest directions only, without a project summary or extra commentary. Before opening or reading any specific session or project, send one brief message in the public channel that mentions ${ownerHandle}, explains what you propose to explore and why, and invites the owner to guide or redirect you. Once that message is sent, begin exploring without waiting for a reply. Exploration is read-only: inspect only the relevant sessions or projects, following the selective-reading instructions below. After you finish exploring, send one brief message in the public channel that mentions ${ownerHandle} and offers up to three concrete directions grounded in what the owner has actually been working on. Then wait for the owner to choose, redirect, or confirm an action. Do not create a task post, assign work, or begin executing any suggestion until the owner confirms concrete work. Do not paste private paths or unrelated content into Alook. If no useful recent context exists, ask the owner what they want to start with and wait instead of inventing generic suggestions. If a Lead already posted the pre-exploration message, do not repeat it. If the Lead already posted action suggestions, do not repeat or begin them; follow the owner's latest guidance.`,
)
return briefing.join("\n")
}
diff --git a/src/web/src/lib/community/models/onboarding.ts b/src/web/src/lib/community/models/onboarding.ts
index 7ab1e133f..a084b5d01 100644
--- a/src/web/src/lib/community/models/onboarding.ts
+++ b/src/web/src/lib/community/models/onboarding.ts
@@ -14,6 +14,7 @@ export type OnboardingInitializationCheckpoint = {
serverId?: string
publicChannelId?: string
privateChannelId?: string
+ tasksChannelId?: string
requestedServerName?: string
onboardedBotIds?: string[]
botsOnboarded?: boolean