@@ -5,6 +5,10 @@ import fs from "node:fs/promises";
55import os from "node:os" ;
66import path from "node:path" ;
77import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts" ;
8+ import {
9+ validateJsonSchemaValue ,
10+ type JsonSchemaObject ,
11+ } from "openclaw/plugin-sdk/json-schema-runtime" ;
812import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry" ;
913import type { PluginRuntime } from "openclaw/plugin-sdk/plugin-runtime" ;
1014import type { SessionCatalogProvider } from "openclaw/plugin-sdk/session-catalog" ;
@@ -120,6 +124,24 @@ type SessionEntrySummary = ReturnType<
120124
121125const config = { } as OpenClawConfig ;
122126
127+ async function normalizeCodexManifestConfig ( value : unknown ) : Promise < Record < string , unknown > > {
128+ const manifest = JSON . parse (
129+ await fs . readFile ( new URL ( "../openclaw.plugin.json" , import . meta. url ) , "utf8" ) ,
130+ ) as { configSchema : JsonSchemaObject } ;
131+ const result = validateJsonSchemaValue ( {
132+ cacheKey : "codex.session-catalog.manifest-config" ,
133+ schema : manifest . configSchema ,
134+ value,
135+ applyDefaults : true ,
136+ } ) ;
137+ if ( ! result . ok ) {
138+ throw new Error (
139+ `Expected valid Codex manifest config: ${ result . errors . map ( ( error ) => error . text ) . join ( ", " ) } ` ,
140+ ) ;
141+ }
142+ return result . value as Record < string , unknown > ;
143+ }
144+
123145function idleThread ( overrides : Partial < CodexThread > = { } ) : CodexThread {
124146 return {
125147 id : "thread-1" ,
@@ -429,7 +451,11 @@ describe("Codex session catalog errors", () => {
429451
430452describe ( "Codex supervision catalog" , ( ) => {
431453 it ( "lists non-archived interactive threads without probing transcript previews" , async ( ) => {
432- const pluginConfig = { supervision : { enabled : true } } ;
454+ const pluginConfig = await normalizeCodexManifestConfig ( {
455+ supervision : { enabled : true } ,
456+ appServer : { command : "codex-catalog" } ,
457+ } ) ;
458+ expect ( ( pluginConfig . appServer as Record < string , unknown > ) . homeScope ) . toBeUndefined ( ) ;
433459 commandRpcMocks . codexControlRequest . mockResolvedValue ( {
434460 data : [
435461 {
0 commit comments