fix(codex): persist Round duration across session reloads (#2025)

* fix(codex): persist Round duration across session reloads

* fix(codex): preserve completed plan summaries between turns

* test(ios): make plan transcript recycling deterministic

* fix(ios): preserve reading anchors with stale sizing attributes
This commit is contained in:
SSU-WEI HUANG
2026-10-26 10:26:55 +08:00
committed by GitHub
parent 713b2d1a7f
commit c64051eba6
24 changed files with 828 additions and 78 deletions
+4 -3
View File
@@ -112,8 +112,9 @@ export class SharedCodexRoot {
}
this.publishPlan();
}
const receivedAt = Date.now();
const modelAtReceipt = record(params).threadId === this.threadId ? this.settings.model ?? undefined : undefined;
this.notifications = this.notifications.then(() => this.notification(method, params, modelAtReceipt)).catch(error => logger.debug('[Codex shared] projection', error));
this.notifications = this.notifications.then(() => this.notification(method, params, modelAtReceipt, receivedAt)).catch(error => logger.debug('[Codex shared] projection', error));
});
this.client.setTransportAbandonedHandler(() => { void this.reconnect(); });
this.session.onUserMessage((message, localId) => {
@@ -272,7 +273,7 @@ export class SharedCodexRoot {
for (const listener of this.settingsListeners) listener();
this.publishPlan();
}
private async notification(method: string, params: unknown, modelAtReceipt?: string): Promise<void> {
private async notification(method: string, params: unknown, modelAtReceipt?: string, receivedAt = Date.now()): Promise<void> {
if (!this.threadId || this.closed) return;
const p = record(params);
if (method === 'thread/started') {
@@ -312,7 +313,7 @@ export class SharedCodexRoot {
if (method === 'thread/queue/changed') {
for (const id of await this.queue.reconcile()) this.dequeuedInputs.add(id);
}
await this.projection.notification(method, params, modelAtReceipt); this.publishCompaction(); this.alive();
await this.projection.notification(method, params, modelAtReceipt, receivedAt); this.publishCompaction(); this.alive();
}
async readThread(threadId = this.threadId): Promise<Record<string, unknown>> {
let thread = record(record(await this.client.request('thread/read', { threadId, includeTurns: false })).thread);