Browse Source

fix(snapshot): stabilize workflow prompt order

Dudu-0223 2 weeks ago
parent
commit
f2bb5cef05
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/workflow/tool-workflow/tests/tool-workflow.spec.ts

+ 4 - 0
packages/workflow/tool-workflow/tests/tool-workflow.spec.ts

@@ -379,6 +379,10 @@ describe('dsh-tool-workflow', () => {
     const section = sections.find(s => s.name === 'tool:orchestrate')
     expect(section?.text).toContain('orchestrate')
     expect(sections.some(s => s.name === 'tool:workflow')).toBe(false)
+    ctx.systemPrompt.section({ name: 'tool:cordis-order-probe', order: 115.5, text: 'Cordis' })
+    expect((await ctx.systemPrompt.assemble()).sections
+      .filter(s => s.name === 'tool:cordis-order-probe' || s.name === 'tool:orchestrate')
+      .map(s => s.name)).toEqual(['tool:cordis-order-probe', 'tool:orchestrate'])
     await fiber.dispose()
     expect(ctx.tools.get('orchestrate')).toBeUndefined()
     // …and gone with the fiber — a reload must not leak a stale section.