Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Show queued Assistant follow-ups in activity

rcourtmanb87341fcae96
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 52cba6ed6a..eef015daeb 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -1459,6 +1459,20 @@ runtime cost control, and shared AI transport surfaces.
and outputs may remain collapsed inside the row, but context/read/query
tools must not be replaced by a generic grouped footer that makes several
operations appear all at once.
+ Queued follow-up turns are active session pressure, not hidden backlog.
+ The referenced OpenCode source at fetched `origin/dev` commit
+ `e82542b8023a8374f29c23b70ec019c8f256354e`
+ `packages/opencode/src/tool/todowrite.txt` describes status tracking as
+ surfacing progress to the user at line 1 and requires status updates in real
+ time rather than batched completion at line 25, while
+ `packages/opencode/src/session/tools.ts` updates running tool metadata with
+ title, status, input, and start time at lines 54-63. Pulse adapts that
+ session-activity pattern by keeping queued follow-ups visible in the
+ Assistant activity dock and appending the queued count to the active-turn
+ headline while the current response is streaming. The queued row may retain
+ edit, remove, promote, resume, and clear controls, but the primary headline
+ must not imply the user's just-submitted follow-up disappeared behind a
+ generic `Generating response` state.
7. Keep AI chat presentation helpers aligned through `frontend-modern/src/components/AI/Chat/` and the shared `frontend-modern/src/utils/textPresentation.ts`
8. Keep assistant drawer context, session, and org-switch reset state aligned through the shared `frontend-modern/src/stores/aiChat.ts` boundary instead of letting `frontend-modern/src/App.tsx`, `frontend-modern/src/AppLayout.tsx`, or feature callers fork their own assistant shell state
That shared drawer ownership also covers passive resource reads while the
@@ -2187,6 +2201,10 @@ and the autonomous control warning in the input-adjacent composer/status rail.
Those items stay visible and actionable, but they do not compete with the
transcript as separate top-of-drawer banners unless they are provider readiness
or scoped handoff context surfaces with their own governed content.
+Queued follow-up pressure is part of that active-turn state: the frontend
+derives the count from queued user transcript turns, appends it to the primary
+active Assistant headline while a turn is running, and keeps the separate
+queued-follow-up row actionable for reorder/cancel operations.
Assistant command access follows the same OpenCode-referenced footer principle:
commands are reachable from prompt-adjacent chrome, not only from a hidden slash
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
index 21f70c000d..92ab1b7bc8 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
@@ -5433,7 +5433,7 @@ describe('AIChat', () => {
expect(activityDock).toContainElement(screen.getByLabelText('Assistant active turn status'));
expect(screen.getByLabelText('Assistant active turn status')).toHaveTextContent(
- 'Generating response',
+ 'Generating response · 1 follow-up queued',
);
expect(activityDock).toContainElement(screen.getByLabelText('Queued follow-up messages'));
expect(screen.getByText('1 follow-up queued')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts
index b6a1bd5507..bbdc58fbf2 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts
@@ -61,7 +61,7 @@ describe('getAssistantActiveTurnStatus', () => {
),
).toEqual({
type: 'thinking',
- text: 'Sending prompt',
+ text: 'Sending prompt · 1 follow-up queued',
startedAt: 1_000,
});
});
@@ -810,6 +810,33 @@ describe('getAssistantActiveTurnStatus', () => {
});
});
+ it('surfaces queued follow-up pressure in the active status headline', () => {
+ expect(
+ getAssistantActiveTurnStatus(
+ [
+ assistantMessage({
+ content: 'Partial answer',
+ isStreaming: true,
+ }),
+ userMessage({
+ id: 'queued-1',
+ content: 'Follow up once',
+ delivery: 'queued',
+ }),
+ userMessage({
+ id: 'queued-2',
+ content: 'Follow up twice',
+ delivery: 'queued',
+ }),
+ ],
+ true,
+ ),
+ ).toEqual({
+ type: 'generating',
+ text: 'Generating response · 2 follow-ups queued',
+ });
+ });
+
it('lets newer streamed content replace an older pending tool footer status', () => {
expect(
getAssistantActiveTurnStatus(
diff --git a/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts b/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
index 5d6cec2f3a..0eb5ea4661 100644
--- a/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
+++ b/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
@@ -573,6 +573,31 @@ const initialRequestStatus = (
};
};
+const queuedFollowUpCount = (messages: ChatMessage[]): number =>
+ messages.reduce(
+ (count, message) =>
+ message.role === 'user' && message.delivery === 'queued' ? count + 1 : count,
+ 0,
+ );
+
+const queuedFollowUpSuffix = (messages: ChatMessage[]): string => {
+ const count = queuedFollowUpCount(messages);
+ if (count <= 0) return '';
+ return ` · ${count} ${count === 1 ? 'follow-up' : 'follow-ups'} queued`;
+};
+
+const withQueuedFollowUpStatus = (
+ status: AssistantActiveTurnStatus,
+ messages: ChatMessage[],
+): AssistantActiveTurnStatus => {
+ const suffix = queuedFollowUpSuffix(messages);
+ if (!suffix) return status;
+ return {
+ ...status,
+ text: `${status.text}${suffix}`,
+ };
+};
+
export const getAssistantActiveTurnStatus = (
messages: ChatMessage[],
isLoading: boolean,
@@ -582,7 +607,7 @@ export const getAssistantActiveTurnStatus = (
const assistantMessage = [...messages].reverse().find((message) => message.role === 'assistant');
if (!assistantMessage) {
- return initialRequestStatus(messages);
+ return withQueuedFollowUpStatus(initialRequestStatus(messages), messages);
}
const statusCandidates: AssistantActiveTurnStatusCandidate[] = [];
@@ -622,16 +647,22 @@ export const getAssistantActiveTurnStatus = (
);
if (freshestStatus) {
- return {
- type: freshestStatus.type,
- text: freshestStatus.text,
- startedAt: freshestStatus.startedAt,
- };
+ return withQueuedFollowUpStatus(
+ {
+ type: freshestStatus.type,
+ text: freshestStatus.text,
+ startedAt: freshestStatus.startedAt,
+ },
+ messages,
+ );
}
if (hasVisibleAssistantOutput(assistantMessage)) {
- return { type: 'generating', text: 'Generating response' };
+ return withQueuedFollowUpStatus(
+ { type: 'generating', text: 'Generating response' },
+ messages,
+ );
}
- return initialRequestStatus(messages, assistantMessage);
+ return withQueuedFollowUpStatus(initialRequestStatus(messages, assistantMessage), messages);
};