Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
fix(home): say "Working…" while an employee answers in Talk
trohitg4c232660171d
diff --git a/client/src/features/home/__tests__/talk.test.tsx b/client/src/features/home/__tests__/talk.test.tsxindex b82210ec..fb54c613 100644--- a/client/src/features/home/__tests__/talk.test.tsx+++ b/client/src/features/home/__tests__/talk.test.tsx@@ -1,7 +1,7 @@/*** Talking to an employee on their page: the thread (every generation, with a* divider at each restart), sending (shown at once, taken back when the- * server refuses), "Thinking…" until the answer lands, one message queued+ * server refuses), "Working…" until the answer lands, one message queued* while paused, suggestions, Turn on Talk, and Apply. The reply wait's* fallbacks are checked on the hook itself.*/@@ -136,7 +136,7 @@ describe('sending', () => {fireEvent.keyDown(box, { key: 'Enter' });expect(box).toHaveValue('');- expect(screen.getByText('Thinking…')).toBeInTheDocument();+ expect(screen.getByText('Working…')).toBeInTheDocument();expect(await screen.findByText('Any bookings today?')).toBeInTheDocument();await waitFor(() =>expect(sendRequest).toHaveBeenCalledWith(@@ -153,7 +153,7 @@ describe('sending', () => {server.messages = [...server.messages, row(9, 'assistant', 'Two, at 10 and at 3.')];await chatUpdated();expect(await screen.findByText('Two, at 10 and at 3.')).toBeInTheDocument();- await waitFor(() => expect(screen.queryByText('Thinking…')).not.toBeInTheDocument());+ await waitFor(() => expect(screen.queryByText('Working…')).not.toBeInTheDocument());expect(screen.getByRole('button', { name: 'Send' })).toBeEnabled();expect(screen.getAllByText('Any bookings today?')).toHaveLength(1);});@@ -168,7 +168,7 @@ describe('sending', () => {await waitFor(() => expect(pillToast).toHaveBeenCalledWith('Maya isn’t running. Start them first.', { tone: 'error' }));expect(screen.getByRole('log', { name: 'Conversation with Maya' })).not.toHaveTextContent('Hello?');expect(box).toHaveValue('Hello?');- expect(screen.queryByText('Thinking…')).not.toBeInTheDocument();+ expect(screen.queryByText('Working…')).not.toBeInTheDocument();});it('lets one message wait while the employee is paused', async () => {@@ -182,13 +182,13 @@ describe('sending', () => {fireEvent.change(box, { target: { value: 'Call me back' } });fireEvent.keyDown(box, { key: 'Enter' });expect(await screen.findByText('Your message is waiting. Maya will read it when you resume them.')).toBeInTheDocument();- expect(screen.queryByText('Thinking…')).not.toBeInTheDocument();+ expect(screen.queryByText('Working…')).not.toBeInTheDocument();fireEvent.change(box, { target: { value: 'One more' } });expect(screen.getByRole('button', { name: 'Send' })).toBeDisabled();// Resumed: the waiting message goes to them now.rerender(employee({}, 'running'));- expect(await screen.findByText('Thinking…')).toBeInTheDocument();+ expect(await screen.findByText('Working…')).toBeInTheDocument();});it('gives the box to Start while the employee is not running', async () => {diff --git a/client/src/features/home/data/liveTask.ts b/client/src/features/home/data/liveTask.tsindex 99c9ef34..e4f7121b 100644--- a/client/src/features/home/data/liveTask.ts+++ b/client/src/features/home/data/liveTask.ts@@ -8,7 +8,7 @@* appointments"),* 2. otherwise, one of its watched nodes running ("Working on it..."),* except the agent answering the owner in Talk: the conversation shows- * its own "Thinking…",+ * its own "Working…",* 3. otherwise nothing, and the card shows the server's text ("Waiting for* new WhatsApp messages").*/diff --git a/client/src/features/home/data/talk.ts b/client/src/features/home/data/talk.tsindex 2f752a7a..50b854e7 100644--- a/client/src/features/home/data/talk.ts+++ b/client/src/features/home/data/talk.ts@@ -10,7 +10,7 @@* at once and leaves again if the server refuses it (`not_running`: it* saved nothing); the response's `delivery` says whether it went now or* waits for Resume.- * - `useReplyWait(...)`: "Thinking…" after a send. It follows the talk+ * - `useReplyWait(...)`: "Working…" after a send. It follows the talk* agent's node status (`useNodeStatusStore` directly, like `useLiveTask`:* the editor's hooks see only the workflow open in Dev mode), with* fallbacks for an agent that never picks the message up or never ends.@@ -33,7 +33,7 @@ import { parseEmployee, type EmployeeSummary } from './schemas';export const THREAD_LIMIT = 200;/** How long the talk agent has to pick a message up. */export const PICKUP_WAIT_MS = 30_000;-/** The longest "Thinking…" lasts, however long the agent works. */+/** The longest "Working…" lasts, however long the agent works. */export const REPLY_WAIT_MS = 180_000;/** Once the agent stops, how long its answer has to reach the thread. */export const SETTLE_WAIT_MS = 5_000;@@ -201,7 +201,7 @@ interface Wait {}export interface ReplyWait {- /** "Thinking…": the message box holds until this clears. */+ /** "Working…": the message box holds until this clears. */waiting: boolean;/** The last wait ended with no answer. */unanswered: boolean;diff --git a/client/src/features/home/employee/EmployeeTalk.tsx b/client/src/features/home/employee/EmployeeTalk.tsxindex 55357a8a..f11f3fbf 100644--- a/client/src/features/home/employee/EmployeeTalk.tsx+++ b/client/src/features/home/employee/EmployeeTalk.tsx@@ -7,7 +7,7 @@* questions and routine reports all land in it, and `drafts` (the ones* waiting for the owner's OK) follow the messages.* - While the employee runs, a message goes to them at once, and- * "Thinking…" holds the box until they answer (useReplyWait); overlapping+ * "Working…" holds the box until they answer (useReplyWait); overlapping* runs would each save over the other's conversation. While they are* paused, one message waits for Resume and then the box holds. Otherwise* the box gives way to their main action (Start, or what they are@@ -225,7 +225,7 @@ function Conversation({ employee, control, drafts }: { employee: EmployeeSummary))}<div className="flex flex-col gap-4">- {/* A log: screen readers announce new messages and "Thinking…". */}+ {/* A log: screen readers announce new messages and "Working…". */}<div role="log" aria-live="polite" aria-label={`Conversation with ${name}`} className="flex flex-col gap-4">{rows.map((row) =>row.kind === 'restart' ? (@@ -237,7 +237,7 @@ function Conversation({ employee, control, drafts }: { employee: EmployeeSummary{waiting && (<div className="flex items-center gap-3"><Avatar name={name} colorRole={employee.color_role} size="sm" />- <span className="text-sm text-fg-muted">Thinking…</span>+ <span className="text-sm text-fg-muted">Working…</span></div>)}{unanswered && !waiting && <p className={cn('m-0 text-xs text-fg-muted', PAST_AVATAR)}>No answer from {name} yet.</p>}diff --git a/docs-internal/normal_mode.md b/docs-internal/normal_mode.mdindex c8dc0911..5e070890 100644--- a/docs-internal/normal_mode.md+++ b/docs-internal/normal_mode.md@@ -376,7 +376,7 @@ and mutations are in [data/talk.ts](../client/src/features/home/data/talk.ts).- **The box** follows the control state the way `send_chat_message` does(`talkMode` in `presentation.ts`):- *send* (running, starting, resuming): a message shows at once- ("Sending…") and goes to the employee. "Thinking…" then holds the box+ ("Sending…") and goes to the employee. "Working…" then holds the boxuntil an answer arrives. `useReplyWait` follows the talk agent's nodestatus in `nodeStatusStore` (for any workflow, not only the one open inDev mode) and gives up after `PICKUP_WAIT_MS` if the agent never starts,@@ -457,7 +457,7 @@ otherwise (a chat trigger that feeds no agent counts here). While ageneration is live the summary reads the running snapshot, whose node ids arethe ones that report status; otherwise the saved graph. `talk.agent_node_id`is the agent that answers. It stays out of `watch_node_ids`, and `useLiveTask`-skips it: while it works, the conversation shows "Thinking…", and the+skips it: while it works, the conversation shows "Working…", and theWorkspace's task line stays on their other work.### Turn on Talk and Apply