feat: update Makelore modules and conversations
This commit is contained in:
@@ -6,9 +6,40 @@ import {
|
||||
getToolVisibilityId,
|
||||
} from '@/pages/Chat/chat-transcript';
|
||||
import { stripProcessMessagePrefix } from '@/pages/Chat/message-utils';
|
||||
import { hydrateOpenCodeSession } from '@/lib/opencode-session-state';
|
||||
import type { RawMessage, ToolStatus } from '@/types/chat';
|
||||
|
||||
describe('deriveTaskSteps', () => {
|
||||
it('uses canonical Part order to keep pre-subtask text in the execution trace', () => {
|
||||
const transcript = hydrateOpenCodeSession('ses_native', [{
|
||||
info: { id: 'msg_native', role: 'assistant', sessionID: 'ses_native' },
|
||||
parts: [
|
||||
{ id: 'part_narration', type: 'text', text: 'Inspecting the project.' },
|
||||
{ id: 'part_subtask', type: 'subtask', sessionID: 'ses_child' },
|
||||
{ id: 'part_answer', type: 'text', text: 'The project is ready.' },
|
||||
],
|
||||
}]);
|
||||
const steps = deriveTaskSteps({
|
||||
messages: [{
|
||||
id: 'msg_native',
|
||||
role: 'assistant',
|
||||
content: [
|
||||
{ type: 'text', id: 'part_narration', text: 'Inspecting the project.' },
|
||||
{ type: 'text', id: 'part_answer', text: 'The project is ready.' },
|
||||
],
|
||||
}],
|
||||
nativeTranscript: transcript,
|
||||
streamingMessage: null,
|
||||
streamingTools: [],
|
||||
});
|
||||
|
||||
expect(steps).toEqual(expect.arrayContaining([
|
||||
expect.objectContaining({ kind: 'message', detail: 'Inspecting the project.' }),
|
||||
expect.objectContaining({ kind: 'system', id: 'native-part_subtask' }),
|
||||
]));
|
||||
expect(steps.some((step) => step.detail === 'The project is ready.')).toBe(false);
|
||||
});
|
||||
|
||||
it('builds running steps from streaming thinking and tool status', () => {
|
||||
const streamingTools: ToolStatus[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user