From 430c7924009524395d051eda7e2bfdaad8f9c20c Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sun, 22 Nov 2026 12:12:20 +0100 Subject: [PATCH 1/2] mason: persist full-after-thread cache boundaries --- CHANGELOG.md | 1 + .../core/src/message-thread-tail-store.ts | 281 ++++++++++++++++++ packages/core/src/message-threads.ts | 112 +++++-- .../tests/message-thread-tail-audit.test.ts | 176 +++++++++++ packages/opencode/src/v2/adapter.ts | 2 +- packages/pi/src/index.ts | 2 +- packages/pi/src/stream.ts | 9 +- 7 files changed, 547 insertions(+), 36 deletions(-) create mode 100644 packages/core/src/message-thread-tail-store.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 1182bceb5..0effe1759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This repo is a CortexKit-maintained Anthropic auth monorepo for OpenCode and Pi. ## Unreleased - OpenCode 2: the serving account's model-scoped weekly windows and credits now refresh from Insula (vault) or the regular poll (local) while response headers keep arriving, so the sidebar no longer shows a growing 'checked … ago' for it. +- OpenCode 2 and Pi: after a host restart, the first full request of a threaded session reuses the previous full request's cache boundary, instead of rewriting the conversation. - OpenCode 2: retries after a rate limit try other available accounts before cycling back to one that already refused the request. Accounts with confirmed exhaustion are skipped. - OpenCode 1 and 2: every step served by Anthropic's safety fallback now writes one log line with per-attempt token counts; OpenCode 2 previously logged nothing. The safety-fallback notice no longer says follow-up requests stay on the fallback model. diff --git a/packages/core/src/message-thread-tail-store.ts b/packages/core/src/message-thread-tail-store.ts new file mode 100644 index 000000000..fe8ac9539 --- /dev/null +++ b/packages/core/src/message-thread-tail-store.ts @@ -0,0 +1,281 @@ +import { createHash, randomUUID } from 'node:crypto' +import { constants, type Stats } from 'node:fs' +import { lstat, mkdir, open, readdir, rm, writeFile } from 'node:fs/promises' +import { join } from 'node:path' +import { getHostDataHome } from './host-paths.ts' +import { + createWindowsOwnerOnly, + ensureWindowsOwnerOnlyDirectory, + isOwnerOnly, + readWindowsOwnerOnly, +} from './owner-only.ts' +import { renameWithWindowsSharingRetry } from './publication-rename.ts' + +const FILE = /^[a-f0-9]{64}\.json$/ +const TEMP = /^[a-f0-9]{64}\.json\.[a-f0-9-]+\.tmp$/ +const HASH = /^[a-f0-9]{64}$/ +const MAX_RECORD_BYTES = 4096 +const MAX_SESSIONS = 1024 +const READ_TIMEOUT_MS = 50 +const SWEEP_INTERVAL_MS = 60_000 +const LONG_LIFETIME_MS = 3_600_000 + +export type MessageThreadTailHost = 'opencode2' | 'pi' + +export interface FullCacheTail { + identity: string + messageIndex: number + blockPath: number[] + prefix: string + control: { type: 'ephemeral'; ttl?: '1h' | '5m' } + acceptedAt: number +} + +interface Entry { + continued: boolean + tail: FullCacheTail +} + +export function fullCacheTailExpired( + tail: FullCacheTail, + now: number, +): boolean { + return ( + now < tail.acceptedAt || + now >= + tail.acceptedAt + (tail.control.ttl === '1h' ? LONG_LIFETIME_MS : 300_000) + ) +} + +function entryFromBytes(bytes: Buffer): Entry | undefined { + if (bytes.length > MAX_RECORD_BYTES) return undefined + const value = JSON.parse(bytes.toString('utf8')) as Partial & { + v?: number + } + const tail = value?.tail + if ( + value?.v !== 1 || + typeof value.continued !== 'boolean' || + !tail || + typeof tail.identity !== 'string' || + !HASH.test(tail.identity) || + typeof tail.prefix !== 'string' || + !HASH.test(tail.prefix) || + !Number.isSafeInteger(tail.messageIndex) || + tail.messageIndex < 0 || + !Array.isArray(tail.blockPath) || + !tail.blockPath.length || + !tail.blockPath.every( + (index) => Number.isSafeInteger(index) && index >= 0, + ) || + tail.control?.type !== 'ephemeral' || + (tail.control.ttl !== undefined && + tail.control.ttl !== '1h' && + tail.control.ttl !== '5m') || + !Number.isSafeInteger(tail.acceptedAt) || + tail.acceptedAt < 0 + ) + return undefined + return { + continued: value.continued, + tail: { + identity: tail.identity, + messageIndex: tail.messageIndex, + blockPath: tail.blockPath, + prefix: tail.prefix, + control: { + type: 'ephemeral', + ...(tail.control.ttl && { ttl: tail.control.ttl }), + }, + acceptedAt: tail.acceptedAt, + }, + } +} + +/** Saves where each accepted full request marked its prefix, without saving the request. */ +export class MessageThreadTailStore { + readonly directory: string + private writes: Promise = Promise.resolve() + private nextSweep = 0 + + constructor( + host: MessageThreadTailHost, + root = getHostDataHome(), + private readonly now = Date.now, + ) { + this.directory = join( + root, + 'cortexkit', + 'anthropic-auth', + 'thread-tails', + host, + ) + } + + private pathFor(session: string): string { + const key = createHash('sha256').update(session).digest('hex') + return join(this.directory, `${key}.json`) + } + + private async directoryReady(create: boolean): Promise { + if (create && !(await ensureWindowsOwnerOnlyDirectory(this.directory))) + await mkdir(this.directory, { recursive: true, mode: 0o700 }) + const stat = await lstat(this.directory) + return ( + stat.isDirectory() && + (await isOwnerOnly( + this.directory, + () => stat.uid === process.getuid?.() && (stat.mode & 0o777) === 0o700, + )) + ) + } + + private async read(path: string, stat: Stats): Promise { + if ( + !stat.isFile() || + stat.size > MAX_RECORD_BYTES || + !(await isOwnerOnly( + path, + () => stat.uid === process.getuid?.() && (stat.mode & 0o777) === 0o600, + )) + ) + return undefined + try { + const windows = await readWindowsOwnerOnly(path) + if (windows) return entryFromBytes(windows) + const file = await open( + path, + constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK, + ) + try { + const actual = await file.stat() + if ( + !actual.isFile() || + actual.uid !== process.getuid?.() || + (actual.mode & 0o777) !== 0o600 || + actual.size > MAX_RECORD_BYTES + ) + return undefined + const bytes = Buffer.alloc(MAX_RECORD_BYTES + 1) + const { bytesRead } = await file.read(bytes) + return entryFromBytes(bytes.subarray(0, bytesRead)) + } finally { + await file.close() + } + } catch { + return undefined + } + } + + async load(session: string): Promise { + const path = this.pathFor(session) + const read = async () => { + if (!(await this.directoryReady(false))) return undefined + const stat = await lstat(path) + const entry = await this.read(path, stat) + // Return expired records so request preparation still logs `expired`. + if (entry && fullCacheTailExpired(entry.tail, this.now())) + this.enqueue(() => this.removeUnchanged(path, stat)) + return entry + } + let cancelTimeout: (() => void) | undefined + try { + return await Promise.race([ + read().catch(() => undefined), + new Promise((resolve) => { + const timeout = setTimeout(resolve, READ_TIMEOUT_MS) + timeout.unref() + cancelTimeout = () => clearTimeout(timeout) + }), + ]) + } finally { + cancelTimeout?.() + } + } + + private enqueue(action: () => Promise): void { + this.writes = this.writes.then(action).catch(() => {}) + } + + changed( + session: string, + tail: FullCacheTail | undefined, + continued: boolean, + ) { + const path = this.pathFor(session) + this.enqueue(async () => { + if (!(await this.directoryReady(Boolean(tail)))) return + const now = this.now() + if (tail && !fullCacheTailExpired(tail, now)) { + const data = JSON.stringify({ v: 1, continued, tail }) + if (Buffer.byteLength(data) <= MAX_RECORD_BYTES) + await this.publish(path, data) + else await rm(path, { force: true }) + } else await rm(path, { force: true }) + await this.prune(now) + }) + } + + private async publish(path: string, data: string): Promise { + const temp = `${path}.${randomUUID()}.tmp` + try { + if (!(await createWindowsOwnerOnly(temp, data))) + await writeFile(temp, data, { flag: 'wx', mode: 0o600 }) + await renameWithWindowsSharingRetry(temp, path) + } finally { + await rm(temp, { force: true }) + } + } + + private async removeUnchanged(path: string, stat: Stats): Promise { + const current = await lstat(path).catch(() => undefined) + // Another host process may have published a newer file since the scan. + if ( + current?.dev === stat.dev && + current.ino === stat.ino && + current.ctimeMs === stat.ctimeMs + ) + await rm(path, { force: true }) + } + + private async prune(now: number): Promise { + const names = await readdir(this.directory) + const files = names.filter((name) => FILE.test(name)) + const sweep = now >= this.nextSweep + if (!sweep && files.length <= MAX_SESSIONS) return + if (sweep) this.nextSweep = now + SWEEP_INTERVAL_MS + const candidates = sweep + ? [...files, ...names.filter((name) => TEMP.test(name))] + : files + const live: { path: string; stat: Stats }[] = [] + for (let i = 0; i < candidates.length; i += 32) { + await Promise.all( + candidates.slice(i, i + 32).map(async (name) => { + const path = join(this.directory, name) + const stat = await lstat(path).catch(() => undefined) + if (!stat?.isFile()) return + if (TEMP.test(name)) { + if (stat.mtimeMs <= Date.now() - LONG_LIFETIME_MS) + await this.removeUnchanged(path, stat) + return + } + if (sweep) { + const entry = await this.read(path, stat) + if (!entry || fullCacheTailExpired(entry.tail, now)) { + await this.removeUnchanged(path, stat) + return + } + } + live.push({ path, stat }) + }), + ) + } + live.sort((a, b) => b.stat.mtimeMs - a.stat.mtimeMs) + for (const { path, stat } of live.slice(MAX_SESSIONS)) + await this.removeUnchanged(path, stat) + } + + async drain(): Promise { + await this.writes + } +} diff --git a/packages/core/src/message-threads.ts b/packages/core/src/message-threads.ts index a6c51ed11..0be41d18c 100644 --- a/packages/core/src/message-threads.ts +++ b/packages/core/src/message-threads.ts @@ -1,6 +1,12 @@ import { createHash, type Hash, randomUUID } from 'node:crypto' import { signRequestBody } from './cch.ts' import { logger } from './logger.ts' +import { + type FullCacheTail, + fullCacheTailExpired, + type MessageThreadTailHost, + MessageThreadTailStore, +} from './message-thread-tail-store.ts' import type { NativeLocalPoolBinding } from './pool-binding.ts' import { isServerFallbackUsageMarker } from './server-fallback-usage.ts' import { createSseFramer, decodeSseFrame, parseSseFrame } from './sse.ts' @@ -74,6 +80,7 @@ export type MessageThreadDisposition = | 'thread_rejected' | 'account_disabled' | 'evicted' + | 'session_closed' | 'session_deleted' /** Refresh preserves the local epoch; replacing a login advances it even when the row id is reused. */ @@ -686,15 +693,6 @@ export interface MessageThreadCompletion { reply?: unknown } -interface FullCacheTail { - identity: string - messageIndex: number - blockPath: number[] - prefix: string - control: { type: 'ephemeral'; ttl?: '1h' | '5m' } - acceptedAt: number -} - interface FullTailHistory { hadThread: boolean continued: boolean @@ -869,11 +867,7 @@ function restoreFullCacheTail( if (!tail) return { reason: 'no_full_tail' } if (tail.identity !== hash([input.account, input.credential])) return { reason: 'account_changed' } - if ( - now < tail.acceptedAt || - now >= tail.acceptedAt + (tail.control.ttl === '1h' ? 3_600_000 : 300_000) - ) - return { reason: 'expired' } + if (fullCacheTailExpired(tail, now)) return { reason: 'expired' } if (input.body.cache_control) return { reason: 'slot_taken' } const slot = input.cacheSlot?.(input.body) if (!slot) return { reason: 'slot_taken' } @@ -930,6 +924,7 @@ export class MessageThreadTracker { private messageHashes = 0 private readonly dispositions = new Map() private readonly instance = randomUUID() + readonly #tailStore?: MessageThreadTailStore // One hash-only full-render boundary per session, independent of continue age. private readonly fullTails = new Map() @@ -937,7 +932,52 @@ export class MessageThreadTracker { private readonly capacity = MAX_SESSIONS, private readonly now = Date.now, private readonly hashBudget = MAX_MESSAGE_HASHES, - ) {} + tailStore?: MessageThreadTailStore, + ) { + this.#tailStore = tailStore + } + + static withTailPersistence(host: MessageThreadTailHost) { + return new MessageThreadTracker( + MAX_SESSIONS, + Date.now, + MAX_MESSAGE_HASHES, + new MessageThreadTailStore(host), + ) + } + + private canLoadFullTail(session: string): boolean { + const disposition = this.dispositions.get(session) + return ( + !this.fullTails.has(session) && + !this.sessions.has(session) && + disposition !== 'session_deleted' && + disposition !== 'evicted' + ) + } + + loadFullTail(session: string): Promise | undefined { + if (!this.#tailStore || !this.canLoadFullTail(session)) return + const disposition = this.dispositions.get(session) + return this.#tailStore.load(session).then((entry) => { + if ( + entry && + this.dispositions.get(session) === disposition && + this.canLoadFullTail(session) + ) + this.rememberFullTail(session, { hadThread: true, ...entry }) + }) + } + + private rememberFullTail(session: string, history: FullTailHistory): void { + this.fullTails.delete(session) + this.fullTails.set(session, history) + while (this.fullTails.size > this.capacity) { + const oldest = this.fullTails.keys().next().value + if (oldest === undefined) break + this.fullTails.delete(oldest) + } + } forget( session: string, @@ -945,6 +985,8 @@ export class MessageThreadTracker { ): void { if (disposition === 'session_deleted' || disposition === 'evicted') this.fullTails.delete(session) + if (disposition === 'session_deleted') + this.#tailStore?.changed(session, undefined, false) this.messageHashes -= this.sessions.get(session)?.anchor?.messages.length ?? 0 this.sessions.delete(session) @@ -1164,24 +1206,28 @@ export class MessageThreadTracker { const completedAt = this.now() accepted = true const sentInput = { ...input, body: tailResult?.body ?? input.body } - this.fullTails.delete(input.session) - if (decision.type === 'create') { - if (!input.stateless || oldTail?.hadThread) - this.fullTails.set(input.session, { - hadThread: true, - continued: false, - tail: fullCacheTail(sentInput, completedAt), - }) - } else - this.fullTails.set(input.session, { + if ( + decision.type === 'continue' || + !input.stateless || + oldTail?.hadThread + ) { + const continued = decision.type === 'continue' + const tail = continued + ? oldTail?.tail + : fullCacheTail(sentInput, completedAt) + this.rememberFullTail(input.session, { hadThread: true, - continued: true, - tail: oldTail?.tail, + continued, + tail, }) - while (this.fullTails.size > this.capacity) { - const oldest = this.fullTails.keys().next().value - if (oldest === undefined) break - this.fullTails.delete(oldest) + } + if (this.#tailStore) { + const history = this.fullTails.get(input.session) + this.#tailStore.changed( + input.session, + history?.tail, + history?.continued ?? false, + ) } if (input.stateless) return // Compute a create request's history fingerprint after response completion. @@ -1511,6 +1557,10 @@ export async function prepareMessageThreadRequest( const fullText = input.bodyText let full: Body | undefined const fullBody = () => (full ??= JSON.parse(fullText) as Body) + if (input.session) { + const loading = tracker.loadFullTail(input.session) + if (loading) await loading + } const accountKey = input.account let threading = !disabledThreadAccounts.has(accountKey) if (threading) messageThreadBetas(input.headers) diff --git a/packages/core/src/tests/message-thread-tail-audit.test.ts b/packages/core/src/tests/message-thread-tail-audit.test.ts index d69d9b754..9bb9f1b14 100644 --- a/packages/core/src/tests/message-thread-tail-audit.test.ts +++ b/packages/core/src/tests/message-thread-tail-audit.test.ts @@ -1,9 +1,22 @@ import { describe, expect, spyOn, test } from 'bun:test' +import { + mkdtemp, + readdir, + readFile, + rm, + stat, + utimes, + writeFile, +} from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' import { logger } from '../logger.ts' +import { MessageThreadTailStore } from '../message-thread-tail-store.ts' import { type MessageThreadInput, MessageThreadTracker, messageThreadBetas, + messageThreadCachePrefix, prepareMessageThreadRequest, } from '../message-threads.ts' @@ -110,6 +123,169 @@ function expectSkip( } } +async function restartFixture(acceptContinuation = true) { + const root = await mkdtemp(join(tmpdir(), 'thread-tail-restart-')) + let now = 1_000 + const clock = () => now + const first = initial() + first.betas = messageThreadBetas(new Headers({ 'anthropic-beta': 'base' })) + const continued = next(first) + const originalStore = new MessageThreadTailStore('opencode2', root, clock) + const original = new MessageThreadTracker(20, clock, undefined, originalStore) + const create = original.prepare(first) + expect(create.decision.type).toBe('create') + complete(create) + const prepared = original.prepare(continued) + expect(prepared.decision.type).toBe('continue') + now += 100 + if (acceptContinuation) complete(prepared) + original.forget(first.session, 'session_closed') + await originalStore.drain() + const store = new MessageThreadTailStore('opencode2', root, clock) + const tracker = new MessageThreadTracker(20, clock, undefined, store) + return { + close: () => rm(root, { recursive: true, force: true }), + expire: () => { + now = 3_601_000 + }, + path: async () => + join(store.directory, (await readdir(store.directory))[0]!), + store, + first, + request: next(continued), + render: (request: MessageThreadInput) => + prepareMessageThreadRequest(tracker, { + ...request, + headers: new Headers({ 'anthropic-beta': 'base' }), + bodyText: JSON.stringify(request.body), + }), + } +} + +describe('full tails across a host restart', () => { + test('the first create reuses the accepted full prefix without storing message text', async () => { + const f = await restartFixture() + try { + const outgoing = JSON.parse((await f.render(f.request)).bodyText) + expect(outgoing.thread).toEqual({ type: 'create' }) + expect(outgoing.messages[2].content[0].cache_control).toEqual(long) + expect(outgoing.system[0].cache_control).toBeUndefined() + const prefix = messageThreadCachePrefix( + f.first.body, + 2, + [0], + f.first.betas, + ) + expect(messageThreadCachePrefix(outgoing, 2, [0], f.first.betas)).toBe( + prefix, + ) + const path = await f.path() + expect(await readdir(f.store.directory)).toHaveLength(1) + const raw = await readFile(path, 'utf8') + expect(JSON.parse(raw)).toMatchObject({ + continued: true, + tail: { prefix, messageIndex: 2, blockPath: [0], acceptedAt: 1_000 }, + }) + for (const secret of [ + 'old full tail', + 'audit-tail', + 'account', + 'credential', + ]) + expect(raw).not.toContain(secret) + if (process.platform !== 'win32') { + expect((await stat(path)).mode & 0o777).toBe(0o600) + expect((await stat(f.store.directory)).mode & 0o777).toBe(0o700) + } + } finally { + await f.close() + } + }) + + test('an accepted create alone does not make a stored tail reusable', async () => { + const f = await restartFixture(false) + try { + const raw = JSON.parse(await readFile(await f.path(), 'utf8')) + expect(raw.continued).toBe(false) + const prepared = await f.render(f.request) + expect(prepared.bodyText).toBe(JSON.stringify(fullBody(f.request))) + } finally { + await f.close() + } + }) + + test('the restart directory retains only the newest 1,024 sessions', async () => { + const f = await restartFixture() + try { + const path = await f.path() + const raw = await readFile(path, 'utf8') + for (let i = 0; i < 1024; i += 32) { + await Promise.all( + Array.from({ length: 32 }, async (_, offset) => { + const n = i + offset + const copy = join( + f.store.directory, + `${n.toString(16).padStart(64, '0')}.json`, + ) + await writeFile(copy, raw, { mode: 0o600 }) + await utimes(copy, n + 1, n + 1) + }), + ) + } + f.store.changed(f.first.session, JSON.parse(raw).tail, true) + await f.store.drain() + const remaining = await readdir(f.store.directory) + expect(remaining).toHaveLength(1024) + expect(remaining).not.toContain(`${'0'.repeat(64)}.json`) + expect(await readFile(path, 'utf8')).toBe(raw) + } finally { + await f.close() + } + }) + + test.each([ + ['prefix', 'prefix_changed'], + ['account', 'account_changed'], + ['credential', 'account_changed'], + ['lifetime', 'expired'], + ['corrupt', 'no_anchor'], + ['missing', 'no_anchor'], + ] as const)( + 'ignores a persisted tail on %s failure', + async (variant, reason) => { + const f = await restartFixture() + const log = spyOn(logger, 'debug') + try { + const { request } = f + if (variant === 'prefix') + (request.body.messages as Message[])[0]!.content[0]!.text = 'changed' + if (variant === 'account' || variant === 'credential') + request[variant] = 'changed' + if (variant === 'lifetime') f.expire() + if (variant === 'corrupt') + await writeFile(await f.path(), 'invalid json') + if (variant === 'missing') await rm(await f.path()) + const prepared = await f.render(request) + expect(prepared.bodyText).toBe(JSON.stringify(fullBody(request))) + const event = + reason === 'no_anchor' + ? 'message_thread_create' + : 'message_thread_tail_marker' + expect( + log.mock.calls.find((call) => call[1] === event)?.[2], + ).toMatchObject({ reason }) + if (variant === 'lifetime') { + await f.store.drain() + expect(await readdir(f.store.directory)).toEqual([]) + } + } finally { + log.mockRestore() + await f.close() + } + }, + ) +}) + describe('full-tail state and wire invariants', () => { test.each(['same lifetime', 'different lifetime'] as const)( 'create snapshot follows actual wire after an earlier edit: %s', diff --git a/packages/opencode/src/v2/adapter.ts b/packages/opencode/src/v2/adapter.ts index ce0743937..5af677b42 100644 --- a/packages/opencode/src/v2/adapter.ts +++ b/packages/opencode/src/v2/adapter.ts @@ -1255,7 +1255,7 @@ export function createNativeAnthropicAdapter( return { headers: relayHeaders ?? headers, attempt: data } } - const messageThreads = new MessageThreadTracker() + const messageThreads = MessageThreadTracker.withTailPersistence('opencode2') const threadRequests = new WeakMap< Data, { diff --git a/packages/pi/src/index.ts b/packages/pi/src/index.ts index 15483b102..762d0f21a 100644 --- a/packages/pi/src/index.ts +++ b/packages/pi/src/index.ts @@ -192,7 +192,7 @@ export default async function cortexKitPiAnthropicAuth( piForkEffortSnapshots.forget(sessionId) workingMessageBySession.delete(sessionId) sessionCacheActivity.forget(sessionId) - forgetPiMessageThread(sessionId) + forgetPiMessageThread(sessionId, 'session_closed') } await stopPiCacheKeep() await closePiNativeRuntime(storagePath) diff --git a/packages/pi/src/stream.ts b/packages/pi/src/stream.ts index 5aacc1682..d8c1e43dd 100644 --- a/packages/pi/src/stream.ts +++ b/packages/pi/src/stream.ts @@ -174,7 +174,7 @@ import { requirePiOAuthOrigin, } from './transport.ts' -const messageThreads = new MessageThreadTracker() +const messageThreads = MessageThreadTracker.withTailPersistence('pi') const dumpResponseObservers = new WeakMap< Response, ReturnType @@ -233,8 +233,11 @@ function isPiPrimaryThreadRequest( ) } -export function forgetPiMessageThread(sessionId: string): void { - messageThreads.forget(sessionId) +export function forgetPiMessageThread( + sessionId: string, + disposition: 'session_closed' | 'session_deleted' = 'session_deleted', +): void { + messageThreads.forget(sessionId, disposition) } /** Dump label for a physical send that failed before any response arrived. */ From 0669bfa52cb34556419ddb8402ea544d01c075b0 Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sun, 22 Nov 2026 12:41:09 +0100 Subject: [PATCH 2/2] Retrigger CI