Skip to content

Commit 641ffdc

Browse files
author
Roman Snapko
committed
Remove stepDisplayName from context structure and update related test cases
1 parent 8088fae commit 641ffdc

1 file changed

Lines changed: 4 additions & 38 deletions

File tree

packages/server/api/test/unit/ai/prompts.service.test.ts

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,13 @@ describe('getSystemPrompt', () => {
257257
steps: [
258258
{
259259
id: 'step1',
260-
stepDisplayName: 'step1',
261260
variables: [
262261
{ name: 'var1', value: 'value1' },
263262
{ name: 'var2', value: 'value2' },
264263
],
265264
},
266265
{
267266
id: 'step2',
268-
stepDisplayName: 'step2',
269267
variables: [{ name: 'var3', value: 'value3' }],
270268
},
271269
],
@@ -300,10 +298,7 @@ describe('getSystemPrompt', () => {
300298
const enrichedContext = {
301299
flowId: 'test-flow-id',
302300
flowVersionId: 'test-flow-version-id',
303-
steps: [
304-
{ id: 'step1', stepDisplayName: 'step1' },
305-
{ id: 'step2', stepDisplayName: 'step2' },
306-
],
301+
steps: [{ id: 'step1' }, { id: 'step2' }],
307302
};
308303

309304
const result = await getBlockSystemPrompt(
@@ -358,16 +353,13 @@ describe('getSystemPrompt', () => {
358353
steps: [
359354
{
360355
id: 'step1',
361-
stepDisplayName: 'step1',
362356
variables: [{ name: 'var1', value: 'value1' }],
363357
},
364358
{
365359
id: 'step2',
366-
stepDisplayName: 'step2',
367360
},
368361
{
369362
id: 'step3',
370-
stepDisplayName: 'step3',
371363
variables: [{ name: 'var2', value: 'value2' }],
372364
},
373365
],
@@ -438,7 +430,6 @@ describe('buildUIContextSection', () => {
438430
flowVersionId: 'version-456',
439431
runId: 'run-789',
440432
currentStepId: 'step-abc',
441-
currentStepName: 'Data Processing Step',
442433
};
443434

444435
const EXPECTED_STRINGS = {
@@ -544,26 +535,6 @@ describe('buildUIContextSection', () => {
544535
},
545536
`flow ${TEST_IDS.flowId} with flowVersion ${TEST_IDS.flowVersionId} with step id ${TEST_IDS.currentStepId}`,
546537
],
547-
[
548-
'basic fields with currentStepName',
549-
{
550-
flowId: TEST_IDS.flowId,
551-
flowVersionId: TEST_IDS.flowVersionId,
552-
currentStepDisplayName: TEST_IDS.currentStepName,
553-
},
554-
`flow ${TEST_IDS.flowId} with flowVersion ${TEST_IDS.flowVersionId} with step name "${TEST_IDS.currentStepName}"`,
555-
],
556-
[
557-
'all fields including step info',
558-
{
559-
flowId: TEST_IDS.flowId,
560-
flowVersionId: TEST_IDS.flowVersionId,
561-
runId: TEST_IDS.runId,
562-
currentStepId: TEST_IDS.currentStepId,
563-
currentStepDisplayName: TEST_IDS.currentStepName,
564-
},
565-
`flow ${TEST_IDS.flowId} with flowVersion ${TEST_IDS.flowVersionId} with run ${TEST_IDS.runId} with step id ${TEST_IDS.currentStepId} with step name "${TEST_IDS.currentStepName}"`,
566-
],
567538
])(
568539
'should build context with %s',
569540
async (
@@ -581,15 +552,15 @@ describe('buildUIContextSection', () => {
581552
describe('handles edge cases', () => {
582553
it.each([
583554
[
584-
'mixed empty and valid context fields',
555+
'mixed empty and valid context fields (step name ignored)',
585556
{
586557
flowId: TEST_IDS.flowId,
587558
flowVersionId: '',
588559
runId: TEST_IDS.runId,
589560
currentStepId: '',
590-
currentStepDisplayName: TEST_IDS.currentStepName,
591561
},
592-
`flow ${TEST_IDS.flowId} with run ${TEST_IDS.runId} with step name "${TEST_IDS.currentStepName}"`,
562+
// step name is ignored; empty flowVersion/currentStepId removed
563+
`flow ${TEST_IDS.flowId} with run ${TEST_IDS.runId}`,
593564
],
594565
[
595566
'undefined optional fields gracefully',
@@ -598,7 +569,6 @@ describe('buildUIContextSection', () => {
598569
flowVersionId: TEST_IDS.flowVersionId,
599570
runId: undefined,
600571
currentStepId: undefined,
601-
currentStepDisplayName: undefined,
602572
},
603573
`flow ${TEST_IDS.flowId} with flowVersion ${TEST_IDS.flowVersionId}`,
604574
],
@@ -610,14 +580,10 @@ describe('buildUIContextSection', () => {
610580
steps: [
611581
{
612582
id: 'step1',
613-
stepDisplayName: 'Step One',
614-
stepIndex: 1,
615583
variables: [{ name: 'var1', value: 'value1' }],
616584
},
617585
{
618586
id: 'step2',
619-
stepDisplayName: 'Step Two',
620-
stepIndex: 2,
621587
},
622588
],
623589
},

0 commit comments

Comments
 (0)