Skip to content

Commit 28de444

Browse files
committed
fix: fix schema for codex and codex mcp
1 parent c0bca8b commit 28de444

3 files changed

Lines changed: 66 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.12.0",
3+
"version": "1.13.0-beta.3",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {

src/resources/codex/codex.ts

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,66 @@ import { CodexConfigParameter } from './config-parameter.js';
1616
import { codexMcpServerSchema } from './mcp-server-schema.js';
1717
import { CodexMcpServersParameter } from './mcp-servers-parameter.js';
1818

19+
const codexConfigSchema = z
20+
.object({
21+
model: z.string().optional().describe('Model name to use (e.g. "o4-mini", "gpt-4.1").'),
22+
model_provider: z.string().optional().describe('Provider for the model (e.g. "openai", "anthropic", "gemini").'),
23+
model_reasoning_effort: z
24+
.enum(['minimal', 'low', 'medium', 'high', 'xhigh'])
25+
.optional()
26+
.describe('Reasoning effort level for supported models.'),
27+
model_reasoning_summary: z
28+
.enum(['auto', 'concise', 'detailed', 'none'])
29+
.optional()
30+
.describe('How much detail to include in reasoning summaries.'),
31+
approval_policy: z
32+
.enum(['untrusted', 'on-request', 'never'])
33+
.optional()
34+
.describe(
35+
'When Codex asks for approval before running commands. ' +
36+
'"untrusted" auto-approves known-safe read-only commands; "on-request" lets the model decide; "never" auto-approves everything.',
37+
),
38+
sandbox_mode: z
39+
.enum(['read-only', 'workspace-write', 'danger-full-access'])
40+
.optional()
41+
.describe('Sandbox policy controlling what filesystem writes are allowed.'),
42+
sandbox_workspace_write: z
43+
.boolean()
44+
.optional()
45+
.describe('Allow writes within the workspace directory when sandbox_mode is active.'),
46+
web_search: z
47+
.enum(['disabled', 'cached', 'live'])
48+
.optional()
49+
.describe(
50+
'Web search access for the agent. "cached" uses an OpenAI-maintained index (default); ' +
51+
'"live" fetches the most recent data; "disabled" removes the tool.',
52+
),
53+
shell_environment_policy: z
54+
.object({
55+
inherit: z.enum(['all', 'core', 'none']).optional(),
56+
})
57+
.optional()
58+
.describe(
59+
'Which shell environment variables to inherit. "all" passes everything through; ' +
60+
'"core" keeps PATH and a minimal set; "none" starts with an empty environment.',
61+
),
62+
history: z
63+
.object({
64+
persistence: z.enum(['save-all', 'none']).optional(),
65+
})
66+
.optional()
67+
.describe('Session history settings. Set persistence to "save-all" to keep history or "none" to disable it.'),
68+
file_opener: z
69+
.enum(['vscode', 'vscode-insiders', 'windsurf', 'cursor', 'none'])
70+
.optional()
71+
.describe('Editor used when Codex opens a file.'),
72+
})
73+
.catchall(z.unknown())
74+
.describe('Typed Codex config keys. Unknown keys are passed through as-is.');
75+
1976
const schema = z
2077
.object({
21-
config: z
22-
.record(z.string(), z.unknown())
78+
config: codexConfigSchema
2379
.optional()
2480
.describe(
2581
'Settings to merge into ~/.codex/config.toml. Supports model, model_provider, approval_policy, ' +
@@ -47,26 +103,27 @@ const exampleSettings: ExampleConfig = {
47103
{
48104
type: 'codex',
49105
config: {
50-
model: 'gpt-5.1-codex',
51-
approval_policy: 'on-request',
106+
model: 'o4-mini',
107+
approval_policy: 'untrusted',
52108
sandbox_mode: 'workspace-write',
109+
web_search: 'cached',
53110
},
54111
},
55112
],
56113
};
57114

58115
const exampleWithMcp: ExampleConfig = {
59116
title: 'Codex with an MCP server',
60-
description: 'Install the Codex CLI and register a filesystem MCP server available to every project.',
117+
description: 'Install the Codex CLI and register a custom MCP server available to every project.',
61118
configs: [
62119
{
63120
type: 'codex',
64121
mcpServers: [
65122
{
66-
name: 'filesystem',
123+
name: 'my-mcp-server',
67124
type: 'stdio',
68125
command: 'npx',
69-
args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'],
126+
args: ['-y', 'my-mcp-package'],
70127
},
71128
],
72129
},

src/resources/codex/mcp-server-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const codexMcpStdioServerSchema = z.object({
44
name: z.string().describe('Unique name for this MCP server'),
55
type: z.literal('stdio'),
66
command: z.string().describe('Executable or command used to launch the MCP server process'),
7-
args: z.array(z.string()).optional().describe('Arguments passed to the command'),
7+
args: z.array(z.string()).optional().describe('Arguments passed to the command. Shell variable expansion (e.g. $HOME) does not occur — use absolute paths instead.'),
88
env: z.record(z.string(), z.string()).optional().describe('Static environment variables passed to the server process'),
99
envVars: z.array(z.string()).optional().describe('Names of environment variables forwarded from the Codex process environment'),
1010
cwd: z.string().optional().describe('Working directory for the server process'),

0 commit comments

Comments
 (0)