feat: prepare Zhinian desktop pilot
This commit is contained in:
@@ -4,7 +4,7 @@ import { stripProcessMessagePrefix } from '@/pages/Chat/message-utils';
|
||||
import type { RawMessage, ToolStatus } from '@/stores/chat';
|
||||
|
||||
describe('deriveTaskSteps', () => {
|
||||
it('builds running steps from streaming thinking and tool status', () => {
|
||||
it('builds running steps from streaming tool status without exposing thinking blocks', () => {
|
||||
const streamingTools: ToolStatus[] = [
|
||||
{
|
||||
name: 'web_search',
|
||||
@@ -27,12 +27,6 @@ describe('deriveTaskSteps', () => {
|
||||
});
|
||||
|
||||
expect(steps).toEqual([
|
||||
expect.objectContaining({
|
||||
id: 'stream-thinking-0',
|
||||
label: 'Thinking',
|
||||
status: 'running',
|
||||
kind: 'thinking',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
label: 'web_search',
|
||||
status: 'running',
|
||||
@@ -160,7 +154,7 @@ describe('deriveTaskSteps', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
it('keeps recent completed steps from assistant history', () => {
|
||||
it('keeps recent completed tool steps from assistant history without exposing thinking blocks', () => {
|
||||
const messages: RawMessage[] = [
|
||||
{
|
||||
role: 'assistant',
|
||||
@@ -179,12 +173,6 @@ describe('deriveTaskSteps', () => {
|
||||
});
|
||||
|
||||
expect(steps).toEqual([
|
||||
expect.objectContaining({
|
||||
id: 'history-thinking-assistant-1-0',
|
||||
label: 'Thinking',
|
||||
status: 'completed',
|
||||
kind: 'thinking',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: 'tool-2',
|
||||
label: 'read_file',
|
||||
@@ -194,7 +182,7 @@ describe('deriveTaskSteps', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('splits cumulative streaming thinking into separate execution steps', () => {
|
||||
it('keeps thinking-only stream chunks out of the execution graph', () => {
|
||||
const steps = deriveTaskSteps({
|
||||
messages: [],
|
||||
streamingMessage: {
|
||||
@@ -208,23 +196,7 @@ describe('deriveTaskSteps', () => {
|
||||
streamingTools: [],
|
||||
});
|
||||
|
||||
expect(steps).toEqual([
|
||||
expect.objectContaining({
|
||||
id: 'stream-thinking-0',
|
||||
detail: 'Reviewing X.',
|
||||
status: 'completed',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: 'stream-thinking-1',
|
||||
detail: 'Comparing Y.',
|
||||
status: 'completed',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: 'stream-thinking-2',
|
||||
detail: 'Drafting answer.',
|
||||
status: 'running',
|
||||
}),
|
||||
]);
|
||||
expect(steps).toEqual([]);
|
||||
});
|
||||
|
||||
it('keeps earlier reply segments in the graph when the last streaming segment is rendered separately', () => {
|
||||
|
||||
Reference in New Issue
Block a user