feat(codex): import and resume sessions from runners (#1088)

* fix codex import resume flow

* fix hub restart session active state

* fix codex transcript workspace scoping

* Address Codex import review findings

* Fix Codex import machine selection

* Update Codex sessions error test

* Address Codex import review findings

* Preserve forked Codex session id on sync

* Make Codex duplicate cleanup source-aware

* Handle Codex archive failures

* Limit existing session flag to Codex

* Preserve Codex import machine binding

* fix: rebase runner Codex import onto current main

* fix: preserve runner-scoped Codex import behavior

---------

Co-authored-by: syy <815728149@qq.com>
This commit is contained in:
NightWatcher314
2026-07-19 14:14:42 +08:00
committed by GitHub
co-authored by syy
parent 651c83a1d9
commit 64834467e3
42 changed files with 2536 additions and 133 deletions
+26
View File
@@ -171,6 +171,7 @@ export type CodexDesktopScriptResponse = {
syncedCount?: number
// 中文注释:这里存放本次导入对应的 Codex thread ID 列表,方便日志和排查 direct import 结果。
sessionIds?: string[]
hapiSessionIds?: string[]
}
export type CodexLocalSessionSummary = {
@@ -182,16 +183,41 @@ export type CodexLocalSessionSummary = {
modifiedAt: number
originator?: string | null
cliVersion?: string | null
source?: string | null
threadSource?: string | null
forkedFromId?: string | null
}
export type CodexLocalSessionsResponse = {
success: true
sessions: CodexLocalSessionSummary[]
machineId?: string
} | {
success: false
error: string
sessions: []
machineId?: string
}
export type CodexArchiveSessionResponse = {
success: true
archivedPath: string
machineId?: string
} | {
success: false
error: string
machineId?: string
}
export type CodexDesktopSyncRequest = {
// 中文注释:前端弹窗直接提交 Codex thread ID,后端会按这些 transcript 直接导入到 Hapi。
sessionIds: string[]
cwd?: string | null
machineId?: string | null
model?: string | null
modelReasoningEffort?: string | null
yolo?: boolean
}
export type CodexDesktopStatusResponse = {