fix: preserve deployed session fixes

Persist paged Codex history checkpoints and bounded, acknowledged delivery.
Keep usage sources and accounting across deleted or merged sessions.
Include native Goal controls, faster peer/session queries, and release guards.
Track the complete deployed source so isolated builds cannot omit local fixes.

Validation: all typechecks pass. The full suite reports 7,997 passing tests
and 46 existing failures, each reproduced against the prior commit.
This commit is contained in:
2026-10-08 19:51:45 +08:00
parent 4d8a72c146
commit baeeb11356
85 changed files with 3647 additions and 691 deletions
+18 -1
View File
@@ -6,7 +6,8 @@ import {
DecryptedMessageSchema,
MachineSchema,
PermissionModeSchema,
SessionSchema
SessionSchema,
ThreadGoalSchema
} from './schemas'
import { AgentFlavorSchema } from './modes'
import type {
@@ -808,6 +809,22 @@ export const ImplementCodexPlanRequestSchema = z.object({
export type ImplementCodexPlanRequest = z.infer<typeof ImplementCodexPlanRequestSchema>
export const CodexGoalRequestSchema = z.discriminatedUnion('action', [
z.object({ action: z.literal('get') }).strict(),
z.object({
action: z.literal('update'),
objective: z.string().trim().min(1).refine(value => Array.from(value).length <= 4000, 'Goal must be at most 4000 characters'),
tokenBudget: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).nullable().optional()
}).strict(),
z.object({ action: z.literal('pause') }).strict(),
z.object({ action: z.literal('resume') }).strict(),
z.object({ action: z.literal('clear') }).strict()
])
export type CodexGoalRequest = z.infer<typeof CodexGoalRequestSchema>
export const CodexGoalResponseSchema = z.object({ goal: ThreadGoalSchema.nullable() })
export type CodexGoalResponse = z.infer<typeof CodexGoalResponseSchema>
export type ImplementCodexPlanResult = { ok: true } | {
ok: false
code: 'stale_plan' | 'unavailable' | 'indeterminate' | 'failed'