feat(codex): share sessions across terminal and web

Use one native app-server for terminal, Web and phone clients while retaining the existing CLI and Runner lifecycle.

Synchronize native queues, permissions, question history and steering state; preserve explicit permission precedence and per-turn usage models. Resume inactive clear commands through Runner and reject independent child cold resumes.

Add shared-runtime regression tests, generated protocol fixtures and lifecycle documentation.
This commit is contained in:
weishu
2026-09-12 10:59:17 +08:00
parent 25af3f8e13
commit 0c4abcb3d1
111 changed files with 4684 additions and 960 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ function normalizeServiceTiers(value: unknown): string[] | undefined {
return tokens.size > 0 ? [...tokens] : undefined;
}
function normalizeModel(entry: unknown): CodexModelSummary | null {
export function normalizeCodexModel(entry: unknown): CodexModelSummary | null {
if (!entry || typeof entry !== 'object') {
return null;
}
@@ -143,7 +143,7 @@ async function fetchCodexModelsFromAppServer(includeHidden: boolean): Promise<Co
const response = await client.listModels({ includeHidden });
return Array.isArray(response.data)
? response.data.map(normalizeModel).filter((model): model is CodexModelSummary => model !== null)
? response.data.map(normalizeCodexModel).filter((model): model is CodexModelSummary => model !== null)
: [];
} catch (error) {
throw new Error(getErrorMessage(error, 'Failed to list Codex models'));