From c2a8aa34bdd7bb3b7a9811533d5f6ade20b045bd Mon Sep 17 00:00:00 2001 From: Artur Veres Date: Wed, 2 Dec 2026 13:03:59 +0100 Subject: [PATCH] Reject conflict markers on every commit, and settle the demo check on a quiet chat A merge resolution committed with its markers passed every hook, the CHANGELOG structure check included. check-merge-conflict with --assume-in-merge now runs on each commit. The demo check slept 2.5 s after every click and waited up to 15 s for a run paused on an approval, which took about 11.5 minutes. It now settles once the chat is idle and its text has held still, or held still longer while a run waits: about 6.5 minutes, the rest being the mock streams' own pacing. Co-Authored-By: Claude Opus 5.5 --- .pre-commit-config.yaml | 3 +++ demo/check-reset.mjs | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c47c3c..dbfa834 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,9 @@ repos: - id: check-yaml exclude: '^mkdocs\.yml$' - id: check-json + # Every commit, not only during a merge: a resolution committed later still carries markers. + - id: check-merge-conflict + args: ["--assume-in-merge"] - id: check-added-large-files args: ["--maxkb=2000"] diff --git a/demo/check-reset.mjs b/demo/check-reset.mjs index 69de321..59cd756 100644 --- a/demo/check-reset.mjs +++ b/demo/check-reset.mjs @@ -59,12 +59,25 @@ const controls = () => // A DOM click, because some controls move the panel over the page's own buttons. const press = (label) => page.evaluate((name) => [...document.querySelectorAll(".try button")].find((b) => b.textContent === name).click(), label); -// Nothing navigates any more, so a load state says nothing: wait, then for the run. +// Settled once the chat is idle and its text has held still briefly, or held still for longer +// while a run waits on an approval; a fixed sleep per step made the check take minutes. const settle = async () => { - await page.waitForTimeout(2500); - await page - .waitForFunction(() => document.querySelector("ag-ui-chat")?.running === false, null, { timeout: 15000 }) - .catch(() => {}); + const started = Date.now(); + let last = null; + let since = Date.now(); + while (Date.now() - started < 15000) { + await page.waitForTimeout(150); + const now = await page.evaluate(() => { + const chat = document.querySelector("ag-ui-chat"); + return `${chat?.running}|${chat?.shadowRoot?.textContent?.length}|${location.pathname}`; + }); + if (now !== last) { + last = now; + since = Date.now(); + } + const quiet = Date.now() - since; + if ((now.startsWith("false|") && quiet >= 700) || quiet >= 2500) return; + } }; // A marker on window outlives every mount and dies with the document. const stayed = async (step) => {