mirror of
https://github.com/wu736139669/hapi.git
synced 2026-12-02 06:37:03 +00:00
fix(codex): preserve transcript sync across mode switches
This commit is contained in:
@@ -17,11 +17,11 @@ export class CodexSession extends AgentSessionBase<EnhancedMode> {
|
||||
readonly codexCliOverrides?: CodexCliOverrides;
|
||||
readonly startedBy: 'runner' | 'terminal';
|
||||
readonly startingMode: 'local' | 'remote';
|
||||
readonly replayTranscriptHistoryOnStart: boolean;
|
||||
readonly sourceSessionId?: string;
|
||||
localLaunchFailure: LocalLaunchFailure | null = null;
|
||||
|
||||
private transcriptPathCallbacks: Array<(path: string) => void> = [];
|
||||
private transcriptHistoryReplayPending: boolean;
|
||||
|
||||
constructor(opts: {
|
||||
api: ApiClient;
|
||||
@@ -68,7 +68,7 @@ export class CodexSession extends AgentSessionBase<EnhancedMode> {
|
||||
this.codexCliOverrides = opts.codexCliOverrides;
|
||||
this.startedBy = opts.startedBy;
|
||||
this.startingMode = opts.startingMode;
|
||||
this.replayTranscriptHistoryOnStart = opts.replayTranscriptHistoryOnStart ?? false;
|
||||
this.transcriptHistoryReplayPending = opts.replayTranscriptHistoryOnStart ?? false;
|
||||
this.sourceSessionId = opts.sourceSessionId;
|
||||
this.permissionMode = opts.permissionMode;
|
||||
this.model = opts.model;
|
||||
@@ -76,6 +76,14 @@ export class CodexSession extends AgentSessionBase<EnhancedMode> {
|
||||
this.collaborationMode = opts.collaborationMode;
|
||||
}
|
||||
|
||||
shouldReplayTranscriptHistory(): boolean {
|
||||
return this.transcriptHistoryReplayPending;
|
||||
}
|
||||
|
||||
markTranscriptHistoryReplayConsumed(): void {
|
||||
this.transcriptHistoryReplayPending = false;
|
||||
}
|
||||
|
||||
onTranscriptPathFound(path: string): void {
|
||||
if (this.transcriptPath === path) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user