Preserve and display the generating model for each assistant reply
This commit is contained in:
@@ -26,7 +26,7 @@ const markdown = [
|
||||
const chat = { id: "mobile-chat", title: "Mobile QA conversation with a long title", parentChatId: null, titleGenerationPending: false,
|
||||
createdAt: date, updatedAt: date, starred: false, starredAt: null, initiatedProvider: "openai", initiatedModel: "mobile-model-one",
|
||||
lastUsedProvider: "openai", lastUsedModel: "mobile-model-one", additionalSystemPrompt: null, enabledTools: [],
|
||||
messages: [{ id: "mobile-assistant", role: "assistant", content: markdown, createdAt: date, name: null, metadata: null }] };
|
||||
messages: [{ id: "mobile-assistant", role: "assistant", content: markdown, createdAt: date, name: null, metadata: { generation: { provider: "openai", model: "mobile-model-one" } } }] };
|
||||
const idle = { state: "idle", isThinking: false, queued: 0, backgroundWorkers: 0, tools: [], queuedMessages: [] };
|
||||
const errors = [], calls = [], forkRequests = [];
|
||||
let forkedChat;
|
||||
@@ -119,6 +119,7 @@ async function checkFooterAlignment() {
|
||||
assert.notEqual(layout.dateColor, layout.paragraphColor, "timestamp uses secondary color");
|
||||
assert.equal(await footer.locator("time").getAttribute("datetime"), date);
|
||||
assert.match(await footer.locator("time").textContent(), /2026/);
|
||||
assert.equal(await footer.locator("[data-message-generation]").textContent(), "OpenAI · mobile-model-one");
|
||||
}
|
||||
try {
|
||||
await page.goto(target.href, { waitUntil: "networkidle" });
|
||||
@@ -261,6 +262,23 @@ try {
|
||||
const viewport = await page.locator('meta[name="viewport"]').getAttribute("content");
|
||||
assert.match(viewport, /user-scalable=no/);
|
||||
assert.match(viewport, /maximum-scale=1\.0(?:,|$)/);
|
||||
// A mixed-model history keeps each attribution after reload, including unknown old replies.
|
||||
const longModel = "claude-" + "long-model-identifier-".repeat(8);
|
||||
chat.messages.push(
|
||||
{ ...chat.messages[0], id: "second-assistant", content: "A reply from a different provider.", metadata: { generation: { provider: "anthropic", model: longModel } } },
|
||||
{ ...chat.messages[0], id: "legacy-assistant", content: "A reply with no generation record.", metadata: null },
|
||||
);
|
||||
await page.reload({ waitUntil: "networkidle" });
|
||||
await page.getByRole("heading", { name: chat.title, exact: true }).waitFor();
|
||||
assert.deepEqual(await page.locator("main [data-message-generation]").allTextContents(), ["OpenAI · mobile-model-one", `Anthropic · ${longModel}`, "Model not recorded"]);
|
||||
for (const width of [320, 390, 1280]) {
|
||||
await page.setViewportSize({ width, height: 844 });
|
||||
if (width < 768) await page.waitForFunction(() => document.querySelector(".workspace-sidebar").getBoundingClientRect().right <= 1);
|
||||
await page.locator('[data-assistant-footer="second-assistant"]').evaluate(el => el.scrollIntoView({ block: "center" }));
|
||||
assert.ok(await page.locator('[data-assistant-footer="second-assistant"]').evaluate(el => el.scrollWidth <= el.clientWidth), "long model identifier wraps within the footer");
|
||||
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false, `${width}px model-label overflow`);
|
||||
if (artifactDir) await page.screenshot({ path: `${artifactDir}/mixed-models-${width}.png` });
|
||||
}
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.waitForFunction(() => document.querySelector(".workspace-sidebar").getBoundingClientRect().right <= 1);
|
||||
await drag(300, 8, -160);
|
||||
|
||||
Reference in New Issue
Block a user