Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/api/src/harness/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {toolsFor} from './tool-surface';
// How the agent talking with the person is to go about it: it does nothing itself, and hands
// every piece of work to a sub-agent.
const MAIN_FLOW =
'You are talking with the person directly, on the Chat page of Personal Agent Proxy; what you write is shown to them as a chat message, rendered as Markdown, so write short, and answer what they asked: plain sentences for most things, a list or a table where it lays out better, no headings. You make no calls to their accounts yourself: you have one tool, delegate, which starts a sub-agent on a piece of work with the same access as you. Where these instructions name a tool such as read, run, entries_list or entries_create, that is what a sub-agent does on your behalf: put it in its brief. The sub-agent knows nothing but its brief and can’t ask anything, so put in it everything it needs, including what to report back. delegate answers at once that the sub-agent has started; its report comes to you as a message when it is done. Until then, go on, or, when there is nothing to do but wait, tell the person briefly what is under way and stop; say nothing of waiting on a sub-agent as a thing of its own, the person sees it. Start several at once when the pieces are independent. When a report comes, tell the person what matters of it, or start the next piece. A long conversation is summarized for you as it goes, and older reports are cleared from it: take a summary as what happened, and don’t mention that the conversation was summarized.';
'You are talking with the person directly, on the Chat page of Personal Agent Proxy; what you write is shown to them as a chat message, rendered as Markdown, so write short, and answer what they asked: plain sentences for most things, a list or a table where it lays out better, no headings. You make no calls to their accounts yourself: you have one tool, delegate, which starts a sub-agent on a piece of work with the same access as you. Where these instructions name a tool such as read, run, entries_list or entries_create, that is what a sub-agent does on your behalf: put it in its brief. The sub-agent knows nothing but its brief and can’t ask anything, so put in it everything it needs, including what to report back. delegate answers at once that the sub-agent has started; its report comes to you as a message when it is done. Until then, go on, or, when there is nothing to do but wait, tell the person in a few words what you are looking into, such as “Looking through your inboxes and notes for the Lisbon trip.”, and stop. Never tell the person how you work: say nothing of sub-agents, briefs, reports or searches you started or are waiting on; to them, you are doing the work yourself. Hand one question to one sub-agent, even when the answer spans several accounts: it can look in them all. Start several only for separate pieces of work, each a sizeable job of its own. When a report comes, tell the person what matters of it, or start the next piece; while other sub-agents you started are still working, say nothing of a report unless it changes what the person should know now, and answer once you have the whole picture. A long conversation is summarized for you as it goes, and older reports are cleared from it: take a summary as what happened, and don’t mention that the conversation was summarized.';

// How a sub-agent is to go about it: one brief, its tools, and a report at the end.
const SUB_FLOW =
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/harness/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ import {ensureBuiltInAgent} from './built-in-agent';
const MAX_MESSAGE = 20_000;

/** A persona as the page lists it, whether the viewer may change it, and the last thing said in their conversation with it, cut to a line; null before anything was said. */
export type PersonaResponse = {id: string; name: string; look: Look; color: string; mayChange: boolean; lastMessage: {kind: 'person' | 'assistant'; text: string; at: string} | null};
type PersonaResponse = {id: string; name: string; look: Look; color: string; mayChange: boolean; lastMessage: {kind: 'person' | 'assistant'; text: string; at: string} | null};

/** A turn of the conversation as the page shows it: what the person said, or what the persona answered, which is what went wrong where its turn failed. What the persona did in between is in the activity log, not here. */
export type EntryResponse = {id: string; kind: 'person' | 'assistant'; text: string; isError: boolean; at: string};
type EntryResponse = {id: string; kind: 'person' | 'assistant'; text: string; isError: boolean; at: string};

/** The member's conversation with a persona: the persona, its turns, and what the persona is up to: busy on it, asleep until a time, or waiting for the person. */
export type ThreadLogResponse = {persona: PersonaResponse; entries: EntryResponse[]; busy: boolean; sleepingUntil: string | null};
type ThreadLogResponse = {persona: PersonaResponse; entries: EntryResponse[]; busy: boolean; sleepingUntil: string | null};

// Whether the viewer may rename, reface or delete the persona: whoever made it, or the organization's owner (utils/manages.ts).
function managesPersona(viewer: OrgViewer, persona: PersonaRow): boolean {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/harness/tool-surface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TASK_TOOLS = new Set(['start_task', 'finish_task']);
const DELEGATE: ModelTool = {
name: DELEGATE_TOOL,
description:
'Starts a sub-agent on a piece of work with the person’s accounts, with the same access as you. It answers at once that the sub-agent has started, and the sub-agent’s report comes to you as a message when it is done: go on meanwhile, or, when there is nothing to do until then, say so to the person and stop. Give `title`, what the work is in a few words, which the person sees, and `brief`, everything the sub-agent needs: it knows nothing of this conversation but the brief, and can’t ask you or the person anything. Several started in one turn run side by side.',
'Starts a sub-agent on a piece of work with the person’s accounts, with the same access as you. It answers at once that the sub-agent has started, and the sub-agent’s report comes to you as a message when it is done: go on meanwhile, or, when there is nothing to do until then, tell the person what you are looking into and stop. Give `title`, what the work is in a few words, which the person sees, and `brief`, everything the sub-agent needs: it knows nothing of this conversation but the brief, and can’t ask you or the person anything. One sub-agent can look in several accounts: start another only for a separate piece of work.',
parameters: {
type: 'object',
properties: {
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/pages/chat-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ function Conversation({loaded}: {loaded: Loaded}) {
<Head look={current.look} color={current.color} size={64} />
<p className="text-lg font-medium">What should {current.name} do?</p>
<p className="max-w-md text-sm text-muted-foreground">
This conversation is yours alone. {current.name} hands each piece of work to a
sub-agent, which can use what is shared with everyone and what you connected
yourself, as far as its access allows. Every call is in the activity log.
This conversation is yours alone. {current.name} can use what is shared with
everyone and what you connected yourself, as far as its access allows.
Everything it does is in the activity log.
</p>
</div>
)}
Expand Down
Loading