mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-29 06:13:46 +00:00
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:
+18
-1
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user