(page)
| 363 | } |
| 364 | |
| 365 | async function k17(page) { |
| 366 | await openWorkflowFile(page); |
| 367 | await loadModel(page); |
| 368 | await openChat(page); |
| 369 | await explanationDone(page); |
| 370 | // A question the model answers: "was kannst du mir über ..." is answered from the file since C7, and the point here is a model answer that must not come back. |
| 371 | const exploreAnswer = await ask(page, 'Welche Aktion nutzt dieses aktuelle File?'); |
| 372 | await shot(page, 'K17', 'explore-answer', 'A question about the YAML workflow in Explore and its answer.'); |
| 373 | await tab(page, 'galaxy'); |
| 374 | await galaxyReady(page); |
| 375 | await select(page, 'JSONBAgg'); |
| 376 | await scopeSettled(page); |
| 377 | await explanationDone(page); |
| 378 | let mark = await markWorker(page); |
| 379 | const galaxyAnswer = await ask(page, 'What does JSONBAgg do?'); |
| 380 | const [request] = await sentSince(page, mark); |
| 381 | const text = promptText(request); |
| 382 | await shot(page, 'K17', 'galaxy-answer', 'In Galaxy a divider marks the new topic JSONBAgg; New conversation sits in the chat header.'); |
| 383 | const header = await page.locator('.cbm-chat-header').innerText(); |
| 384 | const header1 = await page.locator('.cbm-chat-header .cbm-chat-new').boundingBox(); |
| 385 | if (header1) await shot(page, 'K17', 'header-crop', 'Crop of the chat header with the New conversation button.', { clip: { x: header1.x - 260, y: header1.y - 14, width: header1.width + 320, height: header1.height + 28 } }); |
| 386 | const assistantTurns = (request?.messages ?? []).filter((message) => message.role === 'assistant').length; |
| 387 | // Back to the same workflow file: "Zurück zu" and its own earlier turn is sent again, nothing of JSONBAgg (B4). |
| 388 | await tab(page, 'explore'); |
| 389 | await page.waitForFunction(() => /New contributor message/.test(document.body.innerText), null, { timeout: 30000 }).catch(() => {}); |
| 390 | await explanationDone(page); |
| 391 | mark = await markWorker(page); |
| 392 | const returnAnswer = await ask(page, 'Und was noch?'); |
| 393 | const [back] = await sentSince(page, mark); |
| 394 | const backText = promptText(back); |
| 395 | const divider = await page.locator('.cbm-chat-topic-break').allInnerTexts(); |
| 396 | await shot(page, 'K17', 'explore-return', 'Back in Explore on the same file: a divider "Zurück zu: .github/workflows/new_contributor_pr.yml"; the earlier question about the file is in the prompt, nothing of JSONBAgg.'); |
| 397 | const dividerBox = await page.locator('.cbm-chat-topic-break').last().boundingBox(); |
| 398 | if (dividerBox) await shot(page, 'K17', 'explore-return-crop', 'Crop of the divider above the returned question.', { clip: { x: dividerBox.x - 8, y: Math.max(0, dividerBox.y - 8), width: dividerBox.width + 16, height: 220 } }); |
| 399 | const backAssistant = (back?.messages ?? []).filter((message) => message.role === 'assistant'); |
| 400 | const backUsers = (back?.messages ?? []).filter((message) => message.role === 'user').map((message) => message.content.split('\n').at(-1)); |
| 401 | check('K17', 'Earlier answers about another topic are not sent; coming back to a file says "Zurück zu" and sends that file\'s own earlier turn; topic breaks and New conversation visible', Boolean(request) && !/Welche Aktion nutzt dieses aktuelle File/.test(text) |
| 402 | && assistantTurns === 0 && /New conversation/.test(header) && divider.some((item) => /New topic: JSONBAgg/.test(item)) |
| 403 | && Boolean(back) && backAssistant.length === 1 && !/JSONBAgg/.test(backText) |
| 404 | && JSON.stringify(backUsers) === JSON.stringify(['Welche Aktion nutzt dieses aktuelle File?', 'Und was noch?']) && divider.some((item) => /Zurück zu: \.github\/workflows\/new_contributor_pr\.yml\. Die früheren Nachrichten dazu werden wieder mitgeschickt/.test(item)), |
| 405 | { assistantMessagesInPrompt: assistantTurns, flake8InPrompt: /flake8/i.test(text), exploreQuestionInPrompt: /aktuelle File/.test(text), header, divider, exploreAnswer: exploreAnswer.slice(0, 200), galaxyAnswer: galaxyAnswer.slice(0, 200), |
| 406 | returnPrompt: { assistantMessages: backAssistant.map((message) => message.content.slice(0, 160)), userMessages: backUsers, jsonbAggInPrompt: /JSONBAgg/.test(backText) }, returnAnswer: returnAnswer.slice(0, 200) }); |
| 407 | await save('K17', 'prompt-galaxy.txt', text); |
| 408 | await save('K17', 'prompt-explore-return.txt', backText); |
| 409 | } |
| 410 | |
| 411 | async function setAutomatic(page, on) { |
| 412 | await openConfig(page); |
nothing calls this directly
no test coverage detected