chat: a verification chat can never appear in the operator's list
The operator's chat list showed ~99 stray "New chat" entries. The listing was already fail-closed (registry-only); the fault was what got recorded: an automated UI check drives the real page, so its throwaway chat was recorded as an operator chat exactly like a manually created one and stayed in the list for ever (each run added one). Server: chat_create takes an optional ephemeral flag. The session is created, bootstrapped, usable, closable and reopenable exactly like any other, but its registry row is hidden, so chat_sessions never lists it. operator_sessions gains an ephemeral column (idempotent migration, existing rows default to listed) and the list query filters it; the single-row lookup does not, so close/reopen keep working. RecordVerificationSession is the hidden recorder. Web: the page marks a create ephemeral only when automation asks for it (__pipelinesEphemeralChat, set by the UI smoke for its throwaway chat), so the smoke's own runs stop polluting while a manual create is unchanged. Tests: a hidden row is never listed yet is still looked up and closable; a normal re-record of the same id lists it again; a pre-ephemeral database migrates with every existing chat still listed. Live data pruned separately (107 -> 8 registry rows, backed up).
This commit is contained in:
@@ -3371,7 +3371,11 @@ try {
|
||||
await page.fill("#chatInput", "");
|
||||
|
||||
// (e) `/new` creates a fresh throwaway session (C2's chat_create, sent directly
|
||||
// until C2 lands) and opens it. The operator's session is left untouched.
|
||||
// until C2 lands) and opens it. The operator's session is left untouched. The
|
||||
// throwaway is created EPHEMERAL: this check drives the real page, so without it
|
||||
// every run would leave a permanent "New chat" in the operator's chat list (the
|
||||
// server writes no operator-registry row for an ephemeral create).
|
||||
await page.evaluate(`window.__pipelinesEphemeralChat = true`);
|
||||
await page.fill("#chatInput", "/new");
|
||||
await page.evaluate(
|
||||
`document.querySelector("#chatInput").dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true, cancelable: true }))`,
|
||||
|
||||
Reference in New Issue
Block a user