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
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ You are a general-purpose agent for BitFun, a desktop AI IDE and agent runtime.

{LANGUAGE_PREFERENCE}

## When to use this agent

Use this agent **only** when the task requires file modifications, shell commands, or other write operations. For read-only exploration and research, prefer the `Explore` or `FileFinder` subagents instead. This agent has write capabilities (Write, Edit, Delete, Bash) and cannot run in parallel with other write-capable agents for safety reasons.

## Strengths

- Implementing features, fixing bugs, and refactoring code
- Running build, test, and validation commands via Bash
- Searching for code, configurations, and patterns across large codebases
- Analyzing multiple files to understand system architecture
- Investigating complex questions that require exploring many files
- Performing multi-step research tasks
- Performing multi-step research tasks that may require edits

## Working style

Expand All @@ -31,5 +36,5 @@ You are a general-purpose agent for BitFun, a desktop AI IDE and agent runtime.

- Keep the final response concise and concrete.
- Include the relevant file paths you changed or inspected when they matter to the parent agent.
- Include short code snippets only when the exact text is load-bearing.
- Include short code snippets only when the exact code is load-bearing.
- Avoid emojis.
200 changes: 126 additions & 74 deletions src/web-ui/src/flow_chat/components/modern/VirtualMessageList.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import type {
FlowToolEvent,
ParamsPartialToolEvent,
ProgressToolEvent,
QueuedToolEvent,
StartedToolEvent,
WaitingToolEvent,
} from '../EventBatcher';

const log = createLogger('ToolEventModule');
Expand Down Expand Up @@ -69,6 +71,16 @@ export function processToolEvent(
handleParamsPartial(store, sessionId, turnId, toolEvent);
break;
}

case 'Queued': {
handleQueued(store, sessionId, turnId, toolEvent);
break;
}

case 'Waiting': {
handleWaiting(store, sessionId, turnId, toolEvent);
break;
}

case 'Started': {
flushPendingBatchedEvents(context);
Expand Down Expand Up @@ -357,6 +369,40 @@ function handleParamsPartial(
applyParamsPartial(store, sessionId, turnId, toolEvent);
}

/**
* Handle tool queued event
*/
function handleQueued(
store: FlowChatStore,
sessionId: string,
turnId: string,
toolEvent: QueuedToolEvent
): void {
const existingItem = store.findToolItem(sessionId, turnId, toolEvent.tool_id);
if (existingItem && existingItem.type === 'tool') {
updateToolItem(store, sessionId, turnId, toolEvent.tool_id, {
status: 'queued',
});
}
}

/**
* Handle tool waiting event
*/
function handleWaiting(
store: FlowChatStore,
sessionId: string,
turnId: string,
toolEvent: WaitingToolEvent
): void {
const existingItem = store.findToolItem(sessionId, turnId, toolEvent.tool_id);
if (existingItem && existingItem.type === 'tool') {
updateToolItem(store, sessionId, turnId, toolEvent.tool_id, {
status: 'waiting',
});
}
}

/**
* Handle tool started event
*/
Expand Down
4 changes: 3 additions & 1 deletion src/web-ui/src/flow_chat/tool-cards/BaseToolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { ToolCardStatusIcon } from './ToolCardStatusIcon';
import './BaseToolCard.scss';

const LOADING_SHIMMER_STATUSES = new Set([
'queued',
'waiting',
'preparing',
'streaming',
'receiving',
Expand All @@ -29,7 +31,7 @@ function statusUsesLoadingShimmer(status: string): boolean {

export interface BaseToolCardProps {
/** Tool status */
status: 'pending' | 'preparing' | 'streaming' | 'receiving' | 'running' | 'completed' | 'error' | 'cancelled' | 'analyzing' | 'pending_confirmation' | 'confirmed';
status: 'pending' | 'queued' | 'waiting' | 'preparing' | 'streaming' | 'receiving' | 'running' | 'completed' | 'error' | 'cancelled' | 'analyzing' | 'pending_confirmation' | 'confirmed';
/** Whether expanded */
isExpanded?: boolean;
/** Card click callback */
Expand Down
18 changes: 18 additions & 0 deletions src/web-ui/src/flow_chat/tool-cards/DefaultToolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ export const DefaultToolCard: React.FC<ToolCardProps> = ({
}

switch (status) {
case 'queued':
return t('toolCards.default.queued');
case 'waiting':
return t('toolCards.default.waiting');
case 'streaming':
case 'running':
return t('toolCards.default.executing');
Expand Down Expand Up @@ -187,6 +191,20 @@ export const DefaultToolCard: React.FC<ToolCardProps> = ({
return progressMessage;
}

if (status === 'queued') {
const preview = getInlinePreview(filteredInput);
return preview
? `${t('toolCards.default.queued')} - ${preview}`
: t('toolCards.default.queued');
}

if (status === 'waiting') {
const preview = getInlinePreview(filteredInput);
return preview
? `${t('toolCards.default.waiting')} - ${preview}`
: t('toolCards.default.waiting');
}

if (status === 'completed') {
const preview = getInlinePreview(toolResult?.result) || getInlinePreview(filteredInput);
return preview
Expand Down
5 changes: 4 additions & 1 deletion src/web-ui/src/flow_chat/tool-cards/ToolCardStatusSlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import React, { ReactNode } from 'react';
import { Check, X } from 'lucide-react';
import { Check, X, Clock } from 'lucide-react';
import { ToolProcessingDots } from '@/component-library';
import type { ToolProcessingDotsSize } from '@/component-library';
import type { BaseToolCardProps } from './BaseToolCard';
Expand Down Expand Up @@ -43,6 +43,9 @@ function StatusIcon({ status, size }: { status: ToolCardStatusSlotStatus; size:
return <X size={size} className="tcss-error" />;
case 'cancelled':
return <X size={size} className="tcss-cancelled" />;
case 'queued':
case 'waiting':
return <Clock size={size} className="tcss-waiting" />;
default:
return <ToolProcessingDots size={size} />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/web-ui/src/flow_chat/types/flow-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface FlowItem {
id: string;
type: 'text' | 'tool' | 'image-analysis' | 'thinking' | 'user-steering';
timestamp: number;
status: 'pending' | 'preparing' | 'running' | 'streaming' | 'receiving' | 'completed' | 'cancelled' | 'error' | 'analyzing' | 'pending_confirmation' | 'confirmed'; // Includes error, analyzing, and confirmation states.
status: 'pending' | 'queued' | 'waiting' | 'preparing' | 'running' | 'streaming' | 'receiving' | 'completed' | 'cancelled' | 'error' | 'analyzing' | 'pending_confirmation' | 'confirmed'; // Includes error, analyzing, and confirmation states.

/**
* Session-scoped subagent linkage.
Expand Down
2 changes: 2 additions & 0 deletions src/web-ui/src/locales/en-US/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@
},
"default": {
"waitingConfirm": "Waiting for confirmation",
"queued": "Queued",
"waiting": "Waiting",
"executing": "Executing...",
"completed": "Completed",
"cancelled": "Cancelled",
Expand Down
2 changes: 2 additions & 0 deletions src/web-ui/src/locales/zh-CN/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@
},
"default": {
"waitingConfirm": "等待确认",
"queued": "排队中",
"waiting": "等待中",
"executing": "执行中...",
"completed": "已完成",
"cancelled": "已取消",
Expand Down
2 changes: 2 additions & 0 deletions src/web-ui/src/locales/zh-TW/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@
},
"default": {
"waitingConfirm": "等待確認",
"queued": "排隊中",
"waiting": "等待中",
"executing": "執行中...",
"completed": "已完成",
"cancelled": "已取消",
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/config/wdio.conf_l1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const config = createEmbeddedConfig(
'../specs/l1-session.spec.ts',
'../specs/l1-dialog.spec.ts',
'../specs/l1-chat.spec.ts',
'../specs/l1-chat-scroll-whitespace.spec.ts',
],
'L1'
);
Expand Down
Loading
Loading