chore: rebuild CentOS7 release package
This commit is contained in:
23
server.js
23
server.js
@@ -6314,7 +6314,7 @@ wss.on('connection', (ws, req) => {
|
||||
handleImportNativeSession(ws, msg);
|
||||
break;
|
||||
case 'list_codex_sessions':
|
||||
handleListCodexSessions(ws);
|
||||
handleListCodexSessions(ws, msg);
|
||||
break;
|
||||
case 'import_codex_session':
|
||||
handleImportCodexSession(ws, msg);
|
||||
@@ -9878,8 +9878,13 @@ function handleImportNativeSession(ws, msg) {
|
||||
sendSessionList(ws);
|
||||
}
|
||||
|
||||
function handleListCodexSessions(ws) {
|
||||
const imported = getImportedCodexThreadIds();
|
||||
function resolveCodexImportAgent(value) {
|
||||
return value === 'codexapp' ? 'codexapp' : 'codex';
|
||||
}
|
||||
|
||||
function handleListCodexSessions(ws, msg = {}) {
|
||||
const importAgent = resolveCodexImportAgent(msg?.agent);
|
||||
const imported = getImportedCodexThreadIds(importAgent);
|
||||
const items = [];
|
||||
const seen = new Set();
|
||||
for (const filePath of getCodexRolloutFiles()) {
|
||||
@@ -9896,6 +9901,7 @@ function handleListCodexSessions(ws) {
|
||||
cliVersion: parsed.meta.cliVersion || '',
|
||||
source: parsed.meta.source || '',
|
||||
rolloutPath: filePath,
|
||||
agent: importAgent,
|
||||
alreadyImported: imported.has(parsed.meta.threadId),
|
||||
});
|
||||
}
|
||||
@@ -9904,6 +9910,7 @@ function handleListCodexSessions(ws) {
|
||||
|
||||
function handleImportCodexSession(ws, msg) {
|
||||
const threadId = String(msg?.threadId || '').trim();
|
||||
const importAgent = resolveCodexImportAgent(msg?.agent);
|
||||
if (!threadId) {
|
||||
return wsSend(ws, { type: 'error', message: '缺少 threadId' });
|
||||
}
|
||||
@@ -9932,7 +9939,8 @@ function handleImportCodexSession(ws, msg) {
|
||||
for (const f of fs.readdirSync(SESSIONS_DIR).filter(f => f.endsWith('.json'))) {
|
||||
try {
|
||||
const s = normalizeSession(JSON.parse(fs.readFileSync(path.join(SESSIONS_DIR, f), 'utf8')));
|
||||
if (s.codexThreadId === threadId) { existingSession = s; break; }
|
||||
const runtimeThreadId = importAgent === 'codexapp' ? s.codexAppThreadId : s.codexThreadId;
|
||||
if (runtimeThreadId === threadId) { existingSession = s; break; }
|
||||
} catch {}
|
||||
}
|
||||
} catch {}
|
||||
@@ -9944,10 +9952,11 @@ function handleImportCodexSession(ws, msg) {
|
||||
created: existingSession?.created || new Date().toISOString(),
|
||||
updated: new Date().toISOString(),
|
||||
pinnedAt: existingSession?.pinnedAt || null,
|
||||
agent: 'codex',
|
||||
agent: importAgent,
|
||||
claudeSessionId: null,
|
||||
codexThreadId: threadId,
|
||||
importedFrom: 'codex',
|
||||
codexThreadId: importAgent === 'codex' ? threadId : null,
|
||||
codexAppThreadId: importAgent === 'codexapp' ? threadId : null,
|
||||
importedFrom: importAgent,
|
||||
importedRolloutPath: parsed.filePath,
|
||||
model: existingSession?.model || null,
|
||||
permissionMode: existingSession?.permissionMode || 'yolo',
|
||||
|
||||
Reference in New Issue
Block a user